Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- FW_SETENV="/usr/share/tek/fw_setenv"
- FW_PRINTENV="/usr/share/tek/fw_printenv"
- echo "Updating environment variables..."
- BOOTCMD=`$FW_PRINTENV bootcmd`
- ROMARGS=`$FW_PRINTENV romargs`
- ROMBOOT=`$FW_PRINTENV romboot`
- ROMBOOTCMD=`$FW_PRINTENV rombootcmd`
- RESERVE=`$FW_PRINTENV reserve`
- if [ "$BOOTCMD" != "bootcmd=run romboot" ]
- then
- $FW_SETENV bootcmd 'run romboot'
- BOOTCMD=`$FW_PRINTENV bootcmd`
- if [ "$BOOTCMD" != "bootcmd=run romboot" ]
- then
- echo "Failed to set bootcmd correctly"
- fi
- fi
- if [ "$ROMARGS" != "romargs=setenv bootargs console=ttymxc0,\${baudrate) arm_freq=800 \${quiet) \${panic) \${lockout} root=/dev/mtdblock5 rootfstype=squashfs ro" ]
- then
- $FW_SETENV romargs "setenv bootargs console=ttymxc0,\${baudrate) arm_freq=800 \${quiet) \${panic) \${lockout} root=/dev/mtdblock5 rootfstype=squashfs ro"
- ROMARGS=`$FW_PRINTENV romargs`
- if [ "$ROMARGS" != "romargs=setenv bootargs console=ttymxc0,\${baudrate) arm_freq=800 \${quiet) \${panic) \${lockout} root=/dev/mtdblock5 rootfstype=squashfs ro" ]
- then
- echo "Failed to set romargs correctly"
- fi
- fi
- if [ "$ROMBOOT" != "romboot=setenv bootcmd \${rombootcmd}; setenv verify yes; saveenv; boot" ]
- then
- $FW_SETENV romboot 'setenv bootcmd \${rombootcmd}; setenv verify yes; saveenv; boot'
- ROMBOOT=`$FW_PRINTENV romboot`
- if [ "$ROMBOOT" != "romboot=setenv bootcmd \${rombootcmd}; setenv verify yes; saveenv; boot" ]
- then
- echo "Failed to set romboot correctly"
- fi
- fi
- if [ "$ROMBOOTCMD" != "rombootcmd=run romargs; bootm 0C140000; bootm 0C540000" ]
- then
- $FW_SETENV rombootcmd 'run romargs; bootm 0C140000; bootm 0C540000'
- ROMBOOTCMD=`$FW_PRINTENV rombootcmd`
- if [ "$ROMBOOTCMD" != "rombootcmd=run romargs; bootm 0C140000; bootm 0C540000" ]
- then
- echo "Failed to set rombootcmd correctly"
- fi
- fi
- if [ "$RESERVE" != "reserve=14336" ]
- then
- $FW_SETENV reserve '14336'
- RESERVE=`$FW_PRINTENV reserve`
- if [ "$RESERVE" != "reserve=14336" ]
- then
- echo "Failed to set reserve correctly"
- fi
- fi
- echo "Finished updating environment variables."
- echo "Checking required environment variables..."
- BBOBOARD=`$FW_PRINTENV bboboard#`
- ETHADDR=`$FW_PRINTENV ethaddr`
- MODEL=`$FW_PRINTENV model`
- SERIAL=`$FW_PRINTENV serial#`
- echo "Finished checking required environment variables."
Advertisement
Add Comment
Please, Sign In to add comment