Bug 524524 - livecd-iso-to-disk of boot.iso should write install.img to usb
Summary: livecd-iso-to-disk of boot.iso should write install.img to usb
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: livecd-tools
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-21 04:19 UTC by Jens Petersen
Modified: 2009-10-16 16:41 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-09-22 13:54:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jens Petersen 2009-09-21 04:19:34 UTC
Description of problem:
If I want to do a normal Fedora install booting from usb,
boot.iso now seems to assume harddisk install rather
than showing the install type menu as usual.

How reproducible:
every time

Steps to Reproduce:
1. livecd-iso-to-disk rawhide/boot.iso /dev/sdX1 # my usb stick
2. boot usb in qemu say
  
Actual results:
Get to menu to select drive to install from first

Expected results:
Install-type menu (local/nfs/url choice)

Additional info:
Selecting "Back" shows the menu.

Comment 1 Jerry Vonau 2009-09-21 11:09:16 UTC
That screen is not really for an install type, that is meant to pass where the location of anaconda's install.img is. 
mount the boot.iso loopback 
mount the usb drive,  
create a directory /images on the usbkey
copy the /images/install.img from the boot.iso to <usb>/images.
edit the usb's bootloader config file and edit the bit stage2=hd:LABEL=Fedora to be stage2=hd:LABEL=Fedora:/images/install.img
boot the key

You now should not be prompted for the location, and the built-in default http repos should be used. 

Have you tried to dd the boot.iso right to the usbkey? I need to edit the bootloader's config file and edit the stage2= line or I get prompted for the location as above. Should I file that as a different bug?

Comment 2 Chris Lumens 2009-09-21 14:13:25 UTC
Comment #1 has the basic idea.  You can also add the repo= parameter to the cmdline to specify exactly where you want to install from.

Comment 3 Jerry Vonau 2009-09-21 14:41:51 UTC
Have you tried to dd the boot.iso right to the usbkey? I need to edit the
bootloader's config file and edit the stage2= line or I get prompted for the
location as above. Should I file that as a different bug?

Comment 4 Jeremy Katz 2009-09-22 13:54:17 UTC
livecd-iso-to-disk is *not* at all intended for use with boot.iso and is never going to be.  The fact that people continue to abuse it for that purpose and write blog posts to that effect notwithstanding. :-)

(In reply to comment #3)
> Have you tried to dd the boot.iso right to the usbkey? I need to edit the
> bootloader's config file and edit the stage2= line or I get prompted for the
> location as above. Should I file that as a different bug?  

Yeah, that should be a different bug -- I had at one point fixed that to work, but msivak made some more changes to the auto-method/stage2 finding which could have broken this case.

Comment 5 Jens Petersen 2009-09-22 23:43:20 UTC
(In reply to comment #4)
> livecd-iso-to-disk is *not* at all intended for use with boot.iso and is never
> going to be.  The fact that people continue to abuse it for that purpose and
> write blog posts to that effect notwithstanding. :-)

Ok I will try with unetbootin... I really think we should provide
a way to allow installs/upgrades via usb in this day and age though.

Comment 6 Jeremy Katz 2009-09-23 00:46:52 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > livecd-iso-to-disk is *not* at all intended for use with boot.iso and is never
> > going to be.  The fact that people continue to abuse it for that purpose and
> > write blog posts to that effect notwithstanding. :-)
> 
> Ok I will try with unetbootin... I really think we should provide
> a way to allow installs/upgrades via usb in this day and age though.  

As Jerry pointed out (and should be in the release notes), you should be able to just dd the boot.iso onto a usb stick with Fedora 12.  Apparently there might be a different problem that's creeped in there since I stopped looking at it, though

Comment 7 Jerry Vonau 2009-09-23 01:19:59 UTC
Would there be any harm in just adding the rest of the path for install.img to the boot prompt line ie: stage2=hd:LABEL=Fedora:/images/install.img in the stock boot.iso? The path to install.img is going to be the same, then you don't have to edit the bootloader's config file after dd'ing the image. At least you don't have to fiddle around in loader to make any changes, unless something break with that change. ;-)

Comment 8 Jeremy Katz 2009-09-23 01:35:05 UTC
(In reply to comment #7)
> Would there be any harm in just adding the rest of the path for install.img to
> the boot prompt line ie: stage2=hd:LABEL=Fedora:/images/install.img in the
> stock boot.iso? The path to install.img is going to be the same, then you don't
> have to edit the bootloader's config file after dd'ing the image. At least you
> don't have to fiddle around in loader to make any changes, unless something
> break with that change. ;-)  

There shouldn't be a need to have the full path -- the loader should be finding it automatically like it does with CDs.  The fact that it doesn't says that the detection code got broken and another bug will need to be filed for that.  There are some changes in that code in the past couple of weeks and it's notoriously hairy :-/

Comment 9 Jerry Vonau 2009-09-23 02:18:40 UTC
FWIW, harddrive installs have needed the full path for a while, from F9 at least, here is the difference:

cdinstall.c
 305     devices = getDevices(DEVICE_CDROM);
 306     if (!devices) {
 307         logMessage(ERROR, "got to setupCdrom without a CD device");
 308         return NULL;
 309     }
 310 
 311     if (asprintf(&stage2loc, "%s/images/install.img", location) == -1) {
 312         logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__);
 313         abort();
 314     }

hdinstall.c
  70     if (asprintf(&dirspec, "/mnt/isodir%.*s",
  71                  (int) (strrchr(dirName, '/') - dirName), dirName) == -1) {
  72         logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__);
  73         abort();
  74     }
  75 
  76     if (asprintf(&path, "/mnt/isodir%s", dirName) == -1) {
  77         logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__);
  78         abort();
  79     }
  80 
  81     if (path) {
  82         logMessage(INFO, "Path to stage2 image is %s", path);
  83 
  84         rc = copyFile(path, "/tmp/install.img");
  85         rc = mountStage2("/tmp/install.img");
  86
  87         free(path);

think the code below has something to do with that.

 304         free(dir);
 305         if (tmpDir && *tmpDir) {
 306             /* Protect from form free. */
 307             dir = strdup(tmpDir);
 308         } else  {
 309             dir = strdup("");
 310         }

 325         /* If the user-provided URL points at a repo instead of a stage2
 326          * image, fix that up now.
 327          */
 328         substr = strstr(dir, ".img");
 329         if (!substr || (substr && *(substr+4) != '\0')) {
 330             if (asprintf(&dir, "%s/images/install.img", dir) == -1) {
 331                 logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__);
 332                 abort();
 333             }
 334         }
 335

Comment 10 Jens Petersen 2009-09-23 07:52:02 UTC
> As Jerry pointed out (and should be in the release notes), you should be able
> to just dd the boot.iso onto a usb stick with Fedora 12.

Ok thanks that is good to know and a good thing.

I still believe we need a shell script or something to handle it:
I haven't had to run dd since writing boot images to floppies in
the "good old days".

(Though better still IMO would be a tool like livecd-iso-to-disk
that would not destroy the fs of the usb.)

Comment 11 Jerry Vonau 2009-09-23 13:09:05 UTC
(In reply to comment #10)
> > As Jerry pointed out (and should be in the release notes), you should be able
> > to just dd the boot.iso onto a usb stick with Fedora 12.
> 
> Ok thanks that is good to know and a good thing.
> 
> I still believe we need a shell script or something to handle it:
> I haven't had to run dd since writing boot images to floppies in
> the "good old days".
> 
> (Though better still IMO would be a tool like livecd-iso-to-disk
> that would not destroy the fs of the usb.)  


Needs a bit of updating with the change in the stage2= line with F12, but have a look at:

http://dev.laptop.org/git/projects/xs-livecd/tree/util/mkusbinstall

Comment 12 Jens Petersen 2009-09-23 23:22:28 UTC
> Needs a bit of updating with the change in the stage2= line with F12, but have
> a look at:
> 
> http://dev.laptop.org/git/projects/xs-livecd/tree/util/mkusbinstall  

Great!  Can we package/include it in fedora?

Comment 13 Jerry Vonau 2009-10-11 23:27:21 UTC
I'll update it for F12 and post a link here.

Comment 14 Jerry Vonau 2009-10-16 16:40:18 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Would there be any harm in just adding the rest of the path for install.img to
> > the boot prompt line ie: stage2=hd:LABEL=Fedora:/images/install.img in the
> > stock boot.iso? The path to install.img is going to be the same, then you don't
> > have to edit the bootloader's config file after dd'ing the image. At least you
> > don't have to fiddle around in loader to make any changes, unless something
> > break with that change. ;-)  
> 
> There shouldn't be a need to have the full path -- the loader should be finding
> it automatically like it does with CDs.  The fact that it doesn't says that the
> detection code got broken and another bug will need to be filed for that. 
> There are some changes in that code in the past couple of weeks and it's
> notoriously hairy :-/  

filed 528809

Comment 15 Jerry Vonau 2009-10-16 16:41:58 UTC
(In reply to comment #12)
> > Needs a bit of updating with the change in the stage2= line with F12, but have
> > a look at:
> > 
> > http://dev.laptop.org/git/projects/xs-livecd/tree/util/mkusbinstall  
> 
> Great!  Can we package/include it in fedora?  

Sure, have at it..

http://members.shaw.ca/jvonau/pub/mkusbinstall-F12


Note You need to log in before you can comment on or make changes to this bug.