Release P-Boot


chaotix

Member
Joined
Jun 16, 2012
Messages
47
http://lxtek.de/pandora/pboot/


While trying to get Ubuntu to work I felt that it would be nice to have more flexible booting options. So I patched together an Initramfs that presents you a boot menu and allows you to boot from NFS, loopfiles, loopfiles from NFS (if your really feel the need to do that :)), USB thumb drives and of course from NAND or an SD-card partition.


I tried to implement this via kexec but either the kexec system call is broken in the Pandora 3.2 kernel or I just could not get it to work. So now it's just an initramfs. Although this setup does allow it to boot via NFS or from filesystems that are compiled as modules.


It can be used with different kernels as it bind mounts the modules directory either from NAND or from a user specified location for itself and for the root filesystem it boots.


This is probably only interesting to developers (just boot from NFS so you can make snapshots of the rootfs on the fly) and people who don't want to repartition their SD-cards to test out a new operating system (just put a loopfile with the operating system on you possibly FAT formatted partition).
 
Yes. That should be possible.


You can specify the modules you need in a pboot.cfg.d/usb.conf file. I don't know exactly which modules you need. You will need at least ehci_hcd. The rest might get loaded automatically. If not usb_storage is needed and possibly sg.


So to be on the safe side MODULES="ehci_hcd usb_storage sg" should do the job.


As you can leave most of the other variables empty this is a minimal config file to boot from the first partition on the first USB stick. Just save it as pboot/pboot.cfg.d/usb-sda1.conf



Code:
LABEL="USB boot, first partiton"

ROOT=/dev/sda1

MODULES="ehci_hcd usb_storage sg"
 
Yes. That should be possible.


You can specify the modules you need in a pboot.cfg.d/usb.conf file. I don't know exactly which modules you need. You will need at least ehci_hcd. The rest might get loaded automatically. If not usb_storage is needed and possibly sg.


So to be on the safe side MODULES="ehci_hcd usb_storage sg" should do the job.


As you can leave most of the other variables empty this is a minimal config file to boot from the first partition on the first USB stick. Just save it as pboot/pboot.cfg.d/usb-sda1.conf



Code:
LABEL="USB boot, first partiton"

ROOT=/dev/sda1

MODULES="ehci_hcd usb_storage sg"
hi i followed yr instructions to see if i can boot off usb stick but on the pandora boot screen (after pressing right shoulder button) i see no option to boot off usb stick?


i have yet to put on an image in the usb fat formatted disk i just wanted to test wether p boot would run.


what am i missing?


cheers


edit/


i install p boot on sdcard in first slot and can get to menu . can i mount an iso image using pboot automatically? if so how? thanks
 
Last edited by a moderator:
edit/


i install p boot on sdcard in first slot and can get to menu . can i mount an iso image using pboot automatically? if so how? thanks

Glad to hear that you could get it to work.


You could mount an ISO-image and boot from it. But as ISO-images are read-only this would only make any sense for specially crafted images that are the equivalent of Live-CDs for the Pandora. I'm not aware that anything like this exists.


But you can create a regular imagefile with a read/write filesystem on your FAT-formatted SD-card partition and boot from there. If this is what you mean, try this:



Code:
$ cd /mnt/sdcard

$ dd if=/dev/zero of=imagefile.img bs=1M count=1 seek=2047 	 # This creates a 2048 * 1MB (= 2GB) sized imagefile. Adjust as necessary

$ sudo mkfs.ext4 -O ^has_journal imagefile.img

$ sudo mount -o loop imagefile.img /mnt



Now the imagefile is mounted under /mnt. Copy your root filesystem there that you want to boot from.



Create the P-boot config file and save it as 'pboot.cfg.d/imageboot.conf'



Code:
LABEL="Boot from imagefile.img"

ROOT=/dev/mmcblk0p1

LOOP=imagefile.img


Of course, you have to adjust ROOT if you did not create the imagefile on the first partition.


Hope this helps,


Lars
 
thanks for info, yeah there is no iso for pandora true! i am trying to get piratebox running on pandora, and realised later that i would need to get an arm based image. need to investigate this.


regarding booting of usb card i still can't get that working it says waiting for usb device then stops?


thxs
 
regarding booting of usb card i still can't get that working it says waiting for usb device then stops?

Did you get to the P-Boot menu? Did you select a boot entry? What's in the associated config file? What's in the global config file? A couple of lines of output (maybe a picture of the screen) where it hangs would be helpful.


If you know your way around a shell and you did get to the P-Boot menu and can select an entry you could try to put PRE_MOUNT_SHELL=y in the config file. This will launch a shell before mounting the root filesystem. (To continue type 'exit'.)


If you can get it to mount the root filesystem by hand it should be possible to boot from it.
 
I installed pboot on my first partition (fat32, mmcblk0p1), but have a problem:
Adding entrys to the menu and booting works fine, but:

the first Partition is mounted READONLY on /pbootvfg, and I can't unmount or remount it READ/WRITE.

Any Ideas ?

;-----------------------------------

No Risc, no Run  -   Beware,  I'm ARMed  - Better ARM Inside then arm amputation - Ct.ger proofed Acorn Apologet
 
Last edited by a moderator:
Back
Top