maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Troubleshooting (https://talk.maemo.org/forumdisplay.php?f=6)
-   -   How to boot from USB HD? (https://talk.maemo.org/showthread.php?t=23039)

qole 2008-08-21 00:37

[SOLVED] How to boot from USB HD
 
Hey all hacker-types,

I have created an ext3 partition on my USB HDD, and I cloned my Diablo to it. I then tried to boot from this partition, but my bootmenu just says N/A beside that option. Is it because the USB drive doesn't mount right away? Is there something I have to add to the initfs / bootmenu to get the drive to mount?

just for your info, it is /sys/block/sda/sda2

I have several working bootable partitions on my SD cards, I just wanted to try an actual HD and see what the speed difference is...

Thanks in advance!

EDIT: Got it working! See this post for the how-to.

qole 2008-08-21 17:06

Re: How to boot from USB HD?
 
I notice that older versions of fanoush's bootmenu had a USB HD menu choice. Can someone post the details for that menu item here? fanoush? qwerty12?

This is what I have:
Code:

USB_HDD="sda"
MENU_5_NAME="External USB HDD"
MENU_5_ID="usbsda"
MENU_5_DEVICE="sda2"
MENU_5_MODULES="mbcache ext3"
MENU_5_FSTYPE="ext3"
MENU_5_FSOPTIONS="noatime"
[ -d "/sys/block/${USB_HDD}/${MENU_5_DEVICE}" ] || MENU_5_NAME="(${MENU_5_NAME}) N/A"

Perhaps there's something that has to be done to put the N800 into host mode (I do have the OTG dongle)?

qwerty12 2008-08-21 17:11

Re: How to boot from USB HD?
 
Quote:

Originally Posted by qole (Post 216139)
I notice that older versions of fanoush's bootmenu had a USB HD menu choice. Can someone post the details for that menu item here? fanoush? qwerty12?

This is what I have:
Code:

USB_HDD="sda"
MENU_5_NAME="External USB HDD"
MENU_5_ID="usbsda"
MENU_5_DEVICE="sda2"
MENU_5_MODULES="mbcache ext3"
MENU_5_FSTYPE="ext3"
MENU_5_FSOPTIONS="noatime"
[ -d "/sys/block/${USB_HDD}/${MENU_5_DEVICE}" ] || MENU_5_NAME="(${MENU_5_NAME}) N/A"

Perhaps there's something that has to be done to put the N800 into host mode (I do have the OTG dongle)?

It's still in the latest bootmenu, just only in bootmenu.sh and not bootmenu.conf.example.n8x0 (something like that) and bootmenu.conf, as you know, "overwrites" options in bootmenu.conf if it is present.

Anyway, this is the entries I took from bootmenu.sh:
Quote:

MENU_4_NAME="USB hard drive"
MENU_4_ID="usb"
usb is a "special" identifer and is identifed in linuxrc as follows:
Quote:

usb)
root_dev=sda1
root_dev_name="USB hard drive"
root_dev_set=1
root_fstype=""
root_fsoptions=""
;;
Fanoush has a command for setting the usb mode with a menu entry:
Quote:

MENU_4_USBMODE=host

qole 2008-08-21 18:43

Re: How to boot from USB HD?
 
I added the line
Code:

MENU_5_USBMODE=host
..and I removed the line that makes it N/A. I also tried adding the stock USB command.

Still no luck.

Is there something else I can try (maybe I'm using the wrong device name? maybe I have to force-mount the partition?), or is there just no support for booting from a second partition on an external drive (sda2)?

nhanquy 2008-08-22 05:55

Re: How to boot from USB HD?
 
MENU_5_USBMODE=host

will let set_usb_mode() to set the IT in host mode but I still don't know at what time we have /sys/block/sda/sda2 ....

MENU_5_MODULES="mbcache ext3"
MENU_5_FSTYPE="ext3"

Don't you need jbd in MENU_5_MODULES ?

fanoush 2008-08-22 07:12

Re: How to boot from USB HD?
 
Quote:

Originally Posted by qole (Post 216180)
Is there something else I can try (maybe I'm using the wrong device name? maybe I have to force-mount the partition?), or is there just no support for booting from a second partition on an external drive (sda2)?

if you need sda2 don't use 'usb' id, it is hardcoded to sda1 in linuxrc. In that case fill same fields like with any card partition and enable host mode (if you don't have cable that does it for you).

Most probably there are two issues left (did not try)

1. there may be missing /dev/sda2 device node in initfs

2. there is timing problem, usb storage device discovery is slow

1 can be solved by creating it by hand (in initfs_flasher/initfs/dev) from another shell while initfs_flasher is waiting for dropbear/bootmenu.conf answer

2 can be solved by hacking end of bootmenu.sh, there is case for special ids so you may need to add similar one to the end after line that sets usb mode to host. Simple sleep should be enough.

Benson 2008-08-22 15:29

Re: How to boot from USB HD?
 
Quote:

Originally Posted by qole (Post 215933)
Hey all hacker-types,

I have created an ext3 partition on my USB HDD, and I cloned my Diablo to it. I then tried to boot from this partition, but my bootmenu just says N/A beside that option. Is it because the USB drive doesn't mount right away? Is there something I have to add to the initfs / bootmenu to get the drive to mount?

Well, note that saying N/A is a different problem from not being able to boot; you can still boot even if it wasn't detected at the time the boot-menu was generated. IIUC, it'll always be bracketed out (if you use the standard test), because you're not in host mode at the time it checks for the device. So do make sure you actually try booting it; though I guess you already did.

qole 2008-08-22 17:45

Re: How to boot from USB HD?
 
nhanquy: Yes, I noticed the missing jbd. Thanks for pointing it out. Still no luck.
Benson: I did try booting it, no luck, and I have an OTG adapter so shouldn't that force host mode?
fanoush: You've suggested some very interesting things, but your "x can be solved" lines are way too vague and over my head. Can you give me more detailed instructions? Something I can edit in the /initfs_flasher folder before flashing? Lines I can paste into bootmenu.conf?

Quote:

Originally Posted by fanoush (Post 216330)
1 can be solved by creating it by hand (in initfs_flasher/initfs/dev) from another shell while initfs_flasher is waiting for dropbear/bootmenu.conf answer

I don't have the initfs/dev file in my initfs_flasher folder.

Quote:

Originally Posted by fanoush (Post 216330)
2 can be solved by hacking end of bootmenu.sh, there is case for special ids so you may need to add similar one to the end after line that sets usb mode to host. Simple sleep should be enough.

A specific example would be excellent and most appreciated here!

nhanquy 2008-08-22 23:06

Re: How to boot from USB HD?
 
Quote:

Originally Posted by qole (Post 216480)
[
I don't have the initfs/dev file in my initfs_flasher folder.

look under /mnt

qole 2008-08-22 23:26

Re: How to boot from USB HD?
 
Quote:

Originally Posted by qole (Post 216480)
I don't have the initfs/dev file in my initfs_flasher folder.

Quote:

Originally Posted by nhanquy (Post 216589)
look under /mnt

I don't have an initfs_flasher folder under /mnt either. I have an initfs folder, but fanoush wrote initfs_flasher. :confused:

Can I copy the file from /mnt/initfs/dev and drop it into the initfs_flasher folder somewhere and get it to copy over when I flash the initfs?

EDIT: AAHHH I think I get it. When the initfs_flasher process gets to the part where it is waiting for an answer from the user about dropbear, I open a second terminal window and "touch .../initfs_flasher/dev/sda2" ? Or maybe "cp .../initfs_flasher/dev/sda1 .../initfs_flasher/dev/sda2"? Then carry on with the install in the first window. Theoretically, this file will get copied over to the initfs.


All times are GMT. The time now is 02:56.

vBulletin® Version 3.8.8