Welcome! Log In Create A New Profile

Advanced

Iomage IX2 really old uboot

Posted by dougdeep 
Iomage IX2 really old uboot
March 26, 2022 12:23AM
I have an Iomega IX2 2-drive NAS (original version) that I wanted to get working with a newer version of Linux. Iomega actually had the two hard drives arranged in two RAID 1’s – a small one for /tmp and user configurations, and a much larger RAID for data. Since the stock uboot booted Linux from NAND, it could still boot Linux even if one or both hard drives failed. As far as I know there is no replacement uboot available but I was able to get the stock uboot to bring up Debian 5.13.6. I still wanted it to boot in case one drive failed and I was following bobafetthotmail’s Making a Raid 1 rootfs but ran into a curious problem when trying to get uboot to choose which drive to boot.

Either the version of uboot on this IX2 is so old, or, Iomega chose not to include it, but the version of uboot on this NAS has no IF-THEN commands. It also has no FOR-NEXT or WHILE-DONE either. I came up with this to boot a working hard drive:
setenv bootargs_console 'console=ttyS0,115200'
setenv bootcmd_ide0 'ide reset; ext2load ide 0:1 0x800000 /boot/uImage; ext2load ide 0:1 0x2100000 /boot/uInitrd'
setenv bootcmd_ide1 'ide reset; ext2load ide 1:1 0x800000 /boot/uImage; ext2load ide 1:1 0x2100000 /boot/uInitrd'
setenv bootcmd_stock 'nand read 0x800000 uImage; nand read 0x2100000 uInitrd; bootm 0x00800000 0x2100000'
setenv bootcmd 'setenv bootargs $(bootargs_console) root=LABEL=rootfs rootfdelay=10 earlyprintk=serial; run bootcmd_ide1; run bootcmd_ide0; run bootcmd_stock'
This works and I tested it by having two identical boot drives. It still booted with one or the other removed. Since the idea was to make the rootfs into a RAID 1, this should be fine but it seems a bit clunky. Is there a better way to get uboot to choose a boot drive?
Re: Iomage IX2 really old uboot
March 26, 2022 03:42PM
dougdeep,

> This works and I tested it by having two identical
> boot drives. It still booted with one or the
> other removed. Since the idea was to make the
> rootfs into a RAID 1, this should be fine but it
> seems a bit clunky. Is there a better way to get
> uboot to choose a boot drive?

With this old u-boot, there is really no way to choose the boot drive. What you did was all you could do. There is no really foolproof way to implement that logic in u-boot.

What you can do is implement the bootcmd that execute each in certain order, if one is successful then it will ignore the rest.

setenv bootcmd 'mw 0x800000 0 1; run bootcmd_drive_0;  mw 0x800000 0 1; run bootcmd_drive_1; mw 0x800000 0 1; run boocmd_nand; reset'
mw 0x800000 0 1 is the old trick that seems to work in very old u-boot, that makes sure the memory is clear (there must have been a bug in those u-boot versions).

So you will always boot from drive 0 rootfs even if both drives are in the box. And note that the disk partition label must be different between these 2. IOW, if they are both rootfs, then there is no guarantee that the rootfs that will be mounted is the same drive as the the kernel being run.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Iomage IX2 really old uboot
March 27, 2022 02:34PM
Thank you for your reply. I'll give that a try next time I have the serial console attached. The fw_setenv command doesn't want to work on this box as well.
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: