[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

using isohybrid for usb bootable isos



I've done some investigation of using isohybrid on an iso image (d-i
alpha1 i386 netinst) to allow it to be booted from USB stick. Basically,
postprocess the image with isohybrid, and write it direct to the usb
stick. On the single machine I tried it on, that booted ok without any
tweaking of isohybrid options.

So I think this would be a useful thing for debian-cd to do.
I assume it would probably conflict with eg, the boot sector magic
used for multiarch isos. If it were only done for i386/amd64 isos,
that would be enough to allow bypassing the complicated process to use
the d-i hd-media images on usb sticks. Does that make sense from a
debian-cd point of view?

From the d-i side, cdrom-detect needs to be able to mount the iso when
booted from usb stick. There is a cdrom-detect/try-usb that already
enables that, but it's not on by default. So far, only live-installer
has needed it. It should be very safe to move into the default codepath.

The second problem is that apt will try, and fail, to mount the CD
itself. apt-setup removed the apt.conf.d/00NoMountCDROM file. Basically,
it would need to somehow detect that the CD is on a USB stick, and avoid
doing that. It currently looks for /hd-media/ existing, which I made as
a workaround. Just checking that the cdrom is mounted from /dev/sd?1 might
do, or cdrom-detect could set a flag when it found it on a usb device
partition.

After working around those 2 problems, d-i successfully installed!
But, another issue is that the user needs to be able to drop firmware onto
the stick so that d-i can find it. Since isohybrid creates a partition
table, after writing the iso to the stick, the user can replug it and
see a first partition that is the iso image (so read-only). To add
firmware, they would have to add a second partition, which is harder
than the current process for usb sticks.

So ideally, debian-cd would add a small second partition to the iso file's
partition table, and tack on a FAT filesystem. This could probably be done
by running fdisk on the iso file after isohybrid.

d-i could also run isohybrid when generating the mini.iso and eliminate
the need for very complex manual setup of a "netboot" usb stick.
Firmware loading problems also apply there.

BTW, I don't think the hd-media images should be removed, they do allow
for use cases beyond simply installing from a USB stick.

----- Forwarded message from Tanguy Ortolo <tanguy+debian@ortolo.eu> -----

Date: Thu, 9 Sep 2010 12:43:53 +0200
From: Tanguy Ortolo <tanguy+debian@ortolo.eu>
To: debian-boot@lists.debian.org
Subject: Complicated installation from USB
Reply-To: debian-boot@lists.debian.org,
	Tanguy Ortolo <tanguy+debian@ortolo.eu>
User-Agent: Mutt/1.5.18 (2008-05-17)

Hello,

Debian has been installable from USB (or from any non-optical non-floppy
mass storage device, to be exact, but I shall use the term “USB stick” for
convenience) since some time.


Preparing installation optical disks or floppies is, or used to be easy,
and involves two operations, depending on the case:
    
    wget cd.iso
    wodim dev=/dev/cdrom cd.iso
    
    wget floppy.img
    dd if=floppy.img of=/dev/floppy


However, preparing an USB stick is not really easy:
    wget hd-media.img
    wget cd.iso
    dd if=hd-media.img of=/dev/stick
    mount /dev/stick /mnt
    cp cd.iso /mnt
    umount /mnt


The installation manual explains that in a non-straightforward way,
describing two methods, and giving only hints to find where to download
the two needed images. In addition, this procedure depends on *nix
tools, and is thus inapplicable for many user that start installing
Debian from a foreign system, which is a common case. Because of this
complication, I see many beginners failing at preparing USB images, if
not failing to install Debian at all because they do not have an optical
drive.

Could we consider providing ready-to-use hd-media images? Something that
would only need to be downloaded an written to a USB stick, as we do for
optical media? I see two ways to implement that:
* doing the copy of the CD image on the hd-media filesystem before
  making it available as an image;
* using the recent hybrid boot feature of SYSLINUX, that allow to build
  single images that are bootable either as El Torito optical media
  or as MBR on-optical media, if applicable to the Debian installer.

If there are specific reasons not to provide ready-to-use, but only
pieces of hd-media images, as we currently do, these reasons might be
worth being documented in the installation manual with a note such as:
“Note: this procedure is not as easy as the CD one, because [blah].”
That would avoid further messages such as this very one. :-)

Cheers, and thanks for the great piece of software that the Debian
installed is, by the way, to support so many architectures and media
types. :-)

-- 
 ,--.
: /` )   Tanguy Ortolo
| `-'    Debian maintainer
 \_



----- End forwarded message -----
-- 
see shy jo

Attachment: signature.asc
Description: Digital signature


Reply to: