# Here's the plan # 1. Read in the current (old) uboot environment and write it to $OLDENV # 2. cat $OLDENV | grep -v ^bootargs_console= | grep -v ^bootargs_root= | \ # grep -v ^bootcmd_rootdev= | grep -v ^bootcmd_initrd= | \ # grep -v ^bootcmd_kernel= | grep -v ^bootcmd= > $tempfile_1 # # Note that this will require some changes to the install instructions, # as it will abstract the process a bit more. As an example: # bootargs_console=console=ttyS0,115200 # bootargs_root=root=/dev/mmcblk0p2 waitforroot=10 rootfs=ext4 # bootcmd_rootdev=mmcinit # bootcmd_initrd=ext2load mmc 0:1 0x01100000 /uinitrd-kirkwood # bootcmd_kernel=ext2load mmc 0:1 0x00800000 /uImage-kirkwood # bootcmd=setenv bootargs $(bootargs_console) $(bootargs_root); \ # run bootcmd_rootdev; run bootcmd_initrd; run bootcmd_kernel; \ # bootm 0x00800000 0x01100000 # 3. So... we have to ask the user for a lot of stuff. # a. Do we want to declare bootargs_console without asking? IOW, is # that really subject to change at all? # b. re bootargs_root, we have to ask for the root device and filesystem # type on it, and store those somewhere to grab later; for the sake # of argument, let's call them $rootdev and $rootfs # *** edit *** Hrm, actually, won't these be in /etc/fstab (or the # equivalent tempfile if we're in the installer)? # c. re bootcmd_rootdev, we can (right?) assume that we'll be calling # either 'usbinit' or 'mmcinit' there, so we should be able to figure # that out based on the contents of $rootdev # d. re bootcmd_initrd, I guess we'll need to look at $rootfs to see if # we use 'ext2load' or something else, then $rootdev tells us if we # use 'usb' or 'mmc', then we use the device node name to figure out # the '0:1' part, then the rest is set in stone (or do we want to # make that configurable?) # e. re bootcmd_kernel, same as above re bootcmd_initrd # f. re bootcmd, this one should be set in stone, unless the memory holes # configured in (d) and (e) will be configurable # 4. We can then use 'cat << EOF >> $tempfile_2' to write out those six # environment settings. # 5. Finally, we cat $tempfile_1 $tempfile_2 > $NEWENV and write it back # to the nand. Well, I guess that process can be consolidated without # using the tempfiles... # ** Do we want to offer a chance to view the results? # ** Do we want ncurses/dialog support, or keep it text-only so that # it can always work in case the user only has a serial console? #