Setting Up GoFlex Net

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

Re: Setting Up GoFlex Net

Postby sambul13 » Mon Oct 29, 2012 12:34 pm

Your reply regarding using ANY label for rootfs in Uboot compare to Ubit using just rootfs hardcoded label doesn't address the issue that ArchLinux assigns /dev/sda1 always to SATA drive if present, even without rootfs and regardless of any label. It simply can't use the LABEL param supplied by Uboot. Because ArchLinux on a PC can be booted by various bootloaders which can deal with booting from a proper drive themselves with Mobo support, while ARM devices are booted by Uboot which also needs Mobo and Arch cooperation for that, technically it may look like a bug of ArchLinux ARM or the stage0/1 board boot logic/code. But I don't know, if anyone here is capable of fixing it.

For example, I run ArchLinux on a mutiboot laptop, and boot it via Grub4DOS having no issues of booting from USB disk provided USB boot is supported by the laptop Mobo. In fact can boot Arch via Plop from USB thumb or disk after booting to Grub4DOS on SATA drive, or select in Grub4DOS menu any other device to boot from. But for ARM devices, I'm not sure, on what stage /dev/sda1 is assigned to SATA when connected - it may be hardcoded, and why there is no check if the SATA drive has rootfs at all under any label, and what bootloader params are.

However, the fact that Debian can boot from USB on GFN via uInitrd while SATA device is present shows, its possible to fix the issues in ArchLinux ARM. The problem is, any bug reports I posted here were closed by the devs instead of fixing them. So it looks like a utopia movie: everything is always good here. They just jump on folks like me reporting the bugs. I don't think its good for business either, as customers aren't stupid, and Linux upstream always has numerous reported bugs as work in progress. :D
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Re: Setting Up GoFlex Net

Postby Kurlon » Mon Oct 29, 2012 2:43 pm

When you post non-bugs in the wrong place, expect them to be closed.

As noted, the current, default uboot setup on the GFN is working as intended.

I have mine booting off SATA with a thumb drive installed via USB, when I pull the SATA drive it boots off the thumb instead. Easy cheesy, I just had to tweak the uboot env to try and boot SATA first, then USB.

If you want to boot USB with SATA installed, you'll need to tweak the uboot env to account for the different device ID the USB drive will be assigned, so instead of setting the root entry to /dev/sda1, it'll likely be /dev/sdb1. The default boot env already preferences booting USB first so you won't have to alter the boot order.
Kurlon
 
Posts: 132
Joined: Fri Jan 06, 2012 10:05 pm

Re: Setting Up GoFlex Net

Postby pepedog » Mon Oct 29, 2012 3:06 pm

I like to think outside the box. Now on the cubox (and trimslice) the uboot environment has scripts, looking thru devices for existance of boot.scr file. Maybe a similar thing looking for uImage, then using the found device to say "that's my rootfs" and "load that uImage"? This laungage is not bash, although quite similar. Here is the cubox environment (it also does ext4)
$this->bbcode_second_pass_code('', 'CuBox>> printenv
baudrate=115200
loads_echo=0
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
console=console=ttyS0,115200 useNandHal=single
mtdparts=mtdparts=spi0.0:768k(u-boot)ro,128k(uboot_env),-(kernel)
arcNumber=3905
CASset=min
MALLOC_len=5
ethprime=egiga0
bootargs_root=root=/dev/nfs rw
bootargs_end=:::dove:eth0:none
image_name=uImage
tftpbootcmd=tftpboot 0x2000000 ${image_name}; setenv bootargs ${console} ${mtdparts} ${bootargs_root} nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}${bootargs_end} usb0Mode=${usb0Mode} usb1Mode=${usb1Mode} video=dovefb:lcd0:${lcd0_params},lcd1:${lcd1_params} clcd.lcd0_enable=${lcd0_enable} clcd.lcd1_enable=${lcd1_enable}; bootm 0x2000000;
standalone=fsload 0x2000000 ${image_name};setenv bootargs ${console} ${mtdparts} root=/dev/mtdblock0 rw ip=${ipaddr}:${serverip}${bootargs_end} usb0Mode=${usb0Mode} usb1Mode=${usb1Mode} video=dovefb:lcd0:${lcd0_params},lcd1:${lcd1_params} clcd.lcd0_enable=${lcd0_enable} clcd.lcd1_enable=${lcd1_enable}; bootm 0x2000000;
bootsd=sflash read a0000 0x2000000 0x300000;setenv bootargs ${console} ${mtdparts} rootdelay=5 root=/dev/mmcblk0 rw usb0Mode=${usb0Mode} usb1Mode=${usb1Mode} video=dovefb:lcd0:${lcd0_params},lcd1:${lcd1_params} clcd.lcd0_enable=${lcd0_enable} clcd.lcd1_enable=${lcd1_enable}; bootm 0x2000000;
bootusb=sflash read a0000 0x2000000 0x300000;setenv bootargs ${console} ${mtdparts} rootdelay=5 root=/dev/sda rw usb0Mode=${usb0Mode} usb1Mode=${usb1Mode} video=dovefb:lcd0:${lcd0_params},lcd1:${lcd1_params} clcd.lcd0_enable=${lcd0_enable} clcd.lcd1_enable=${lcd1_enable}; bootm 0x2000000;
bootnand=sflash read a0000 0x2000000 0x300000;setenv bootargs ${console} ${mtdparts} ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs rw usb0Mode=${usb0Mode} usb1Mode=${usb1Mode} video=dovefb:lcd0:${lcd0_params},lcd1:${lcd1_params} clcd.lcd0_enable=${lcd0_enable} clcd.lcd1_enable=${lcd1_enable}; bootm 0x2000000;
disaMvPnp=no
ethaddr=00:50:43:36:36:01
usb0Mode=host
usb1Mode=host
yuk_ethaddr=00:00:00:EE:51:81
lcd0_enable=0
lcd1_enable=1
lcd0_params=1280x768-24@60
lcd1_params=640x480-16@60
ethact=egiga0
ipaddr=192.168.15.223
serverip=192.168.15.100
bootdelay=3
pre_burn=echo ========= Burning u-boot ========; sf protect off; sf erase 0 0x00080000
post_burn=resetenv; setenv mmc_started 0; setenv usb_started 0; setenv ide_started 0; setenv version 5.4.4_SR1; saveenv; sf protect on; reset
filesize=52DEC
version=5.4.4_SR1
stdin=serial
stdout=serial
stderr=serial
mtdids=nand0=dove-nand
passDramInitTag=yes
mainlineLinux=yes
enaMonExt=no
pexMode=RC
disL2Cache=no
disL2Ecc=no
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootscript=boot.scr
loadaddr=0x02000000
mmc_started=0
ide_started=0
usb_started=0
trydev=usb mmc ide
trypart=1 2
trydir=/ /boot/
tryfs=ext4 fat
bootcmd=for device_name in ${trydev} ; do for partition in ${trypart} ; do for directory in ${trydir} ;do for fstype in ${tryfs}; do echo ===> Executing ${fstype}load ${device_name} 0:${partition} ${loadaddr} ${directory}${bootscript};if itest.s $device_name -eq mmc; then if itest.s $mmc_started -ne 1; then mmcinfo; setenv mmc_started '1';fi;fi;if itest.s $device_name -eq usb; then if itest.s $usb_started -ne 1; then usb start; setenv usb_started '1';fi;fi;if itest.s $device_name -eq ide; then if itest.s $ide_started -ne 1; then ide reset; setenv ide_started '1';fi;fi;if ${fstype}load ${device_name} 0:${partition} ${loadaddr} ${directory}${bootscript}; then source ${loadaddr};fi;if itest.s $device_name -eq usb; then echo ===> Executing ${fstype}load ${device_name} 1:${partition} ${loadaddr} ${directory}${bootscript};if ${fstype}load ${device_name} 1:${partition} ${loadaddr} ${directory}${bootscript}; then source ${loadaddr};fi;fi;done;done;done;done;tftp ${loadaddr} ${bootscript};source ${loadaddr};
enaL2ExtraFeatures=yes
enaCpuStream=no
enaVpuPower=no
enaGpuPower=yes

Environment size: 3830/65532 bytes')
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Setting Up GoFlex Net

Postby sambul13 » Mon Oct 29, 2012 5:34 pm

$this->bbcode_second_pass_quote('Kurlon', 'I')f you want to boot USB with SATA installed, you'll need to tweak the uboot env to account for the different device ID the USB drive will be assigned, so instead of setting the root entry to /dev/sda1, it'll likely be /dev/sdb1. The default boot env already preferences booting USB first so you won't have to alter the boot order.
Did you actually try that? If you did, can you be MORE specific, which env var you corrected before it booted like you said and mounted the Thumb's fs, not SATA'a? :D

I corrected usb_root=/dev/sdb1 , because kernel assigns /dev/sdb to the thumb when SATA (with or without rootfs) is present. After that, if only USB thumb is hooked, kernel boots OK while still assigning it /dev/sda1 regardless of the Uboot setting. If SATA media collection drive without rootfs is also hooked, here we go with friendly Netconsole:

$this->bbcode_second_pass_code('', '[ 27.888554] List of all partitions:
[ 27.892109] 1f00 1024 mtdblock0 (driver?)
[ 27.897229] 1f01 4096 mtdblock1 (driver?)
[ 27.902356] 1f02 32768 mtdblock2 (driver?)
[ 27.907472] 1f03 224256 mtdblock3 (driver?)
[ 27.912593] 0800 58605120 sda driver: sd
[ 27.917276] 0801 26836551 sda1 00000000-0000-0000-0000-000000000000
[ 27.924410] 0802 4200997 sda2 00000000-0000-0000-0000-000000000000
[ 27.931543] 0803 27567540 sda3 00000000-0000-0000-0000-000000000000
[ 27.938670] 0810 3954688 sdb driver: sd
[ 27.943348] 0811 2621440 sdb1 00000000-0000-0000-0000-000000000000
[ 27.950483] 0812 131072 sdb2 00000000-0000-0000-0000-000000000000
[ 27.957597] 0813 1201152 sdb3 00000000-0000-0000-0000-000000000000
[ 27.964725] No filesystem could mount root, tried: ext2
[ 27.970134] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)
[ 27.978474] [<c000d074>] (unwind_backtrace+0x0/0xe0) from [<c043603c>] (panic+0x80/0x1dc)
[ 27.986707] [<c043603c>] (panic+0x80/0x1dc) from [<c05c0cec>] (mount_block_root+0x234/0x284)
[ 27.995195] [<c05c0cec>] (mount_block_root+0x234/0x284) from [<c05c0ff8>] (prepare_namespace+0x15c/0x1bc)
[ 28.004812] [<c05c0ff8>] (prepare_namespace+0x15c/0x1bc) from [<c05c0974>] (kernel_init+0x1bc/0x1fc)
[ 28.013995] [<c05c0974>] (kernel_init+0x1bc/0x1fc) from [<c0009588>] (kernel_thread_exit+0x0/0x8)')

If SATA has rootfs, it will boot it and mount SATA volume as rootfs, as reported here, despite Uboot tells to boot from USB. I don't need rootfs on SATA drive, and most users either, since 90% of Plugs are used mostly for media streaming a few hours/day. On GFN current kernel always assigns SATA drive /dev/sda1, while ignoring Uboot params to continue boot from USB thumb /dev/sdb1 . But... may be we need to correct a different Uboot var, like custom_parameters, etc. :twisted:

$this->bbcode_second_pass_quote('pepedog', 'M')aybe a similar thing looking for uImage, then using the found device to say "that's my rootfs" and "load that uImage"?


Here is how Debian does it, when installed on a USB thumb hooked to GFN with SATA drive attached:

"I assume you're booting Debian! the label won't work without uInitrd, and Arch does not use it. "

So we're back to Square1, namely ArchLinux ARM bug reports are always immediately closed without any attempt to fix, while claiming the solution exists, and generally any solutions are available via forum, but forgetting to point to it. I wonder, if Linux bugs were all fixed upstream through denial they exist and referral to mailing lists, how would ArchLinux progress look like? :lol:
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Re: Setting Up GoFlex Net

Postby bodhi » Mon Oct 29, 2012 10:11 pm

$this->bbcode_second_pass_quote('pepedog', 'I') like to think outside the box. Now on the cubox (and trimslice) the uboot environment has scripts, looking thru devices for existance of boot.scr file. Maybe a similar thing looking for uImage, then using the found device to say "that's my rootfs" and "load that uImage"?


IMHO, this would be the best approach. And we could also set the boot priority to boot either from NAND or the device that has the boot.scr.
bodhi
 
Posts: 225
Joined: Sat Aug 13, 2011 10:06 am
Top

Re: Setting Up GoFlex Net

Postby bodhi » Mon Oct 29, 2012 10:13 pm

$this->bbcode_second_pass_quote('sambul13', 'S')o we're back to Square1, namely ArchLinux ARM bug reports are always immediately closed without any attempt to fix, while claiming the solution exists, and generally any solutions are available via forum, but forgetting to point to it. I wonder, if Linux bugs were all fixed upstream through denial they exist and referral to mailing lists, how would ArchLinux progress look like? :lol:


But this is not a bug.
bodhi
 
Posts: 225
Joined: Sat Aug 13, 2011 10:06 am
Top

Re: Setting Up GoFlex Net

Postby sambul13 » Mon Oct 29, 2012 10:16 pm

This is missing rootfs choice support in current kernel, which is not admitted to here. After some research can tell: there is no straightforward solution to the issue at the moment. There're a few less acceptable workarounds:

- create an uInitrd, add it to your ArchLinux /boot dir, then correct Uboot env to: usb_root=/dev/disk/by-label/<label> OR
- reformat your MBR/NT USB Thumb as EFI GPT disk with gdisk, then set Uboot env to: usb_root=PARTUUID=<PARTUUID> OR
- wait non-specified time, until PARTUUID param support will be added to Linux kernel for MBR/NT disk signatures
Last edited by sambul13 on Mon Oct 29, 2012 10:23 pm, edited 1 time in total.
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Re: Setting Up GoFlex Net

Postby Kurlon » Mon Oct 29, 2012 10:22 pm

uboot on the GFN doesn't support GPT.

There is an easy solution, update your uboot env to do what you want, or set up an initrd system and update your uboot env to use it. That's the beauty of ALARM, you're provided a simple framework that you can adapt to your needs as you see fit.
Last edited by Kurlon on Mon Oct 29, 2012 10:25 pm, edited 1 time in total.
Kurlon
 
Posts: 132
Joined: Fri Jan 06, 2012 10:05 pm

Re: Setting Up GoFlex Net

Postby bodhi » Mon Oct 29, 2012 10:24 pm

$this->bbcode_second_pass_quote('sambul13', 'T')his is missing support in current kernel, which is not admitted to here.
...
- create an uInitrd, add it to your ArchLinux /boot dir, then correct Uboot env to: usb_root=/dev/disk/by-label/<label>


Some kernel distributions dont' use initrd, I think that 's the choice, not a bug. It does not prevent us to create our own uInitrd for booting.
bodhi
 
Posts: 225
Joined: Sat Aug 13, 2011 10:06 am
Top

Re: Setting Up GoFlex Net

Postby sambul13 » Mon Oct 29, 2012 10:28 pm

$this->bbcode_second_pass_quote('Kurlon', 'T')here is an easy solution
This is an empty phrase for vast majority of Plug users, not familiar with Linux or Uboot programming. You seems to proven it when suggesting to change usb_root=/dev/sdb1. Was that easy choice for you - if yes, did it actually work for you - if yes, can you post your kernel output here? :lol:

We all can spill empty talk, or suggest to search forum, when unable to post the code that works. :roll:

$this->bbcode_second_pass_quote('bodhi', 'S')ome kernel distributions dont' use initrd, I think that 's the choice, not a bug. It does not prevent us to create our own uInitrd for booting.

It can only be classified as a neutral choice if it doesn't negatively affect basic Plug device functionality, or complemented by solutions introduced at the same time that mitigate such effect. Otherwise, if a feature is removed, resulting in severely degraded device functionality, this is the 1st priority bug - never addressed or even admitted here. ;)
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm
Top

PreviousNext

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 8 guests