[Dockstar]Multiboot from different partitions with Uboot?

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

Re: [Dockstar]Multiboot from different partitions with Uboot

Postby sambul13 » Thu Aug 30, 2012 1:38 pm

Just a few examples of multiboot with Uboot are posted on the web so far, but this starts capturing users interest as plug computers power and popularity grow. The above example uses PandaBoard with one SD Card and one USB slot.

Image

For that scenario, the author's approach to multiboot seems similar to SheevaPlug makers: one SD Card per OS with Uboot and specific boot scripts. A multipartition USB Thumb stores rootfs for each OS. Its similar to Install OS using 2 partitions approach. The difference is, Uboot here allows to select SD Card configured OS at boot time, otherwise default OS is started. Selection is done via a serial console or netconsole running on your PC.

I wonder if its possible to place Uboot files on the 1st partition of the same USB disk instead of SD Card, and move specific boot scripts to each OS partition, or choose a boot script at boot time from several stored on 1st partition. Since Dockstar and Pogo devices offer 4 USB ports and no SD Card port, this needs adaptation, unless external USB Card Reader is used with Dockstar.
Last edited by sambul13 on Fri Aug 31, 2012 5:11 pm, edited 2 times in total.
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Re: [Dockstar]Multiboot from different partitions with Uboot

Postby sambul13 » Fri Aug 31, 2012 3:34 pm

Its often desirable to boot not from the 1st but another partition or drive when testing a new OS release. More details on configuring Uboot in that case is given in Load Linux from other than first partition thread. You may want to choose a more advanced file system to try along with new OS, but Uboot and your kernel version must have built in support for that FS.

Being able to select a partition to boot even in a static setup is the great step towards multiboot. With current config Uboot scans all USB devices and boots from a first bootable device, or NAND if no bootable USB device is present. Even now, you can disconnect one drive and hook another bootable, and Uboot will load OS from it, if the drives choice is added to its environment. For example:

adjust the scanner to boot from the 5s partition:

$this->bbcode_second_pass_code('', 'setenv usb_scan_1 'usb=0:5 dev=sda5'
setenv usb_scan_2 'usb=1:5 dev=sdb5'
setenv usb_scan_3 'usb=2:5 dev=sdc5'
setenv usb_scan_4 'usb=3:5 dev=sdd5'
saveenv')

or set Uboot to boot from sda5 only:

$this->bbcode_second_pass_code('', 'setenv usb_init
setenv usb_device '0:5'
setenv usb_root '/dev/sda5'
saveenv')

where 'setenv usb_init' command disables the drive scanner. To re-enable it, run 'setenv usb_init run usb_scan'. When connecting several drives in random order, label your boot partition, since device assignment may change:

$this->bbcode_second_pass_code('', 'setenv usb_bootcmd 'run usb_init; setenv usb_root LABEL=rootfs; run usb_set_bootargs; run usb_boot'')
Last edited by sambul13 on Sat Sep 01, 2012 5:13 am, edited 4 times in total.
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Re: [Dockstar]Multiboot from different partitions with Uboot

Postby sambul13 » Fri Aug 31, 2012 8:45 pm

When planning multiboot, it makes sense to optimally partition your drives first. The "official" ArchLinux ARM Guides deal with installing the OS to a smaller (thumb) drive with one partition. How would you install it to a multi-partition drive?

One way is to backup your data, load your USB or SATA drive in Parted Magic or Gparted on your PC or inside a Virtual Machine, and conveniently partition there. Delete existing partitions, create 1st partition 2Gb EXT2, 2nd partition 256MB SWAP (size equal to your device RAM), and the rest of a larger drive use at your discretion: create EXT4, NTFS or XFS partition(s) for your media files.

If you plan to hook the drive in Windows as well (for faster media transfer compare to network), it may popup "Non-partitioned drive" error, since it expects NTFS be 1st partition (and doesn't expect a thumb drive be multi-partitioned). NTFS and FAT32 are likely the only partitions it will mount. For that case, create 1st NTFS partition on the drive in Windows, and then in Gparted create 2nd (or 3rd+) 2Gb EXT2 partition followed by Linux SWAP partition.

Then hook up the drive to your Plug and boot Pogo OS, install Uboot and correct its environment to boot OS from the 2Gb EXT2 partition, mount and cd to it, install ArchLinux ARM. Reboot to ALARM and configure the OS to your liking - may take some learning curve, look at local Support Guides first. Install Samba to mount the drive remotely on your PC, etc. When installing miniDLNA for media streaming, look through local and common ArchLinux Wiki.
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Previous

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 31 guests