Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 153554 - genkernel initrd.scripts doesn't allow for booting from (custom) Live USB
Summary: genkernel initrd.scripts doesn't allow for booting from (custom) Live USB
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2006-10-31 06:44 UTC by Vince C.
Modified: 2006-11-15 10:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Lines to remove from initrd.scripts to allow for booting Live USB (initrd.script.diff,792 bytes, patch)
2006-10-31 06:46 UTC, Vince C.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vince C. 2006-10-31 06:44:19 UTC
I have had to modify file /usr/share/genkernel/generic/initrd.scripts so that I could boot my home-made Live USB key. Line 75 contains code that results in mounting USB devices with mount argument -t iso9660 instead of -t auto. Because variable CDROOT_DEV can't be reasonnably set for Live USB, no attempt can be initially made to mount the detected USB key using -t auto.

I've submitted a patch to show the issue. I've had to comment out the conditional mount to make my Live USB key work. I'm using sys-kernel/genkernel-3.4.1.
Comment 1 Vince C. 2006-10-31 06:46:58 UTC
Created attachment 100881 [details, diff]
Lines to remove from initrd.scripts to allow for booting Live USB

There might be a better way, i.e. define an additional argument, say "usbroot" to distinguish between Live CD and Live USB. The conditional mount would then remain. I'm also working on it as a personal school case ;-) .
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-10-31 07:40:38 UTC
I don't see what are you trying to do here. Why don't you just change if [ -n "${CDROOT_DEV}" ] to if [ -z "${CDROOT_DEV}" ] ?
Comment 3 Vince C. 2006-10-31 07:48:51 UTC
(In reply to comment #2)
> I don't see what are you trying to do here. Why don't you just change if [ -n
> "${CDROOT_DEV}" ] to if [ -z "${CDROOT_DEV}" ] ?
> 

Because if I change these lines that way I expect the inird script not to work the same with an ordinary CD. I wanted permanent changes that do not require to edit the initrd script each time one makes a live CD or USB or whatever. I've seen from the file structure that the script covers many many cases; this is yet another one.

Flipping the condition that way might have some side effects. OTOH introducing support for a new "liveusb" argument that wouldn't interfere with the existing code would be nice to have IMHO. In this case the patch roughly removes the condition since mounting a CDROM with -t auto should always produce the same result as with arguments -t iso9660, is that right?
Comment 4 Vince C. 2006-10-31 07:54:03 UTC
(In reply to comment #2)
> I don't see what are you trying to do here. Why don't you just change if [ -n
> "${CDROOT_DEV}" ] to if [ -z "${CDROOT_DEV}" ] ?
> 

Sorry I didn't catch your comment right... I thought the way the instructions are in the file were the actual intent. Sure, if the condition is reverted to a test with -z instead of -n it makes much more sense. Hence -n is the proper fix. Thanks for your lights.
Comment 5 Vince C. 2006-10-31 07:55:32 UTC
(In reply to comment #4)
> (In reply to comment #2)
> ... Hence -n is the proper fix.

-z not -n... tsss... Shame on me!

Comment 6 Chris Gianelloni (RETIRED) gentoo-dev 2006-11-13 11:56:52 UTC
This will show up as fixed in 3.4.5's release.
Comment 7 Chris Gianelloni (RETIRED) gentoo-dev 2006-11-14 09:50:40 UTC
Fixed in 3.4.5
Comment 8 Vince C. 2006-11-15 10:17:41 UTC
(In reply to comment #7)
> Fixed in 3.4.5
> 

Thanks a lot.