Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] usb install

sm-discuss AT

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: flux <flux AT>
  • To: SM-Discuss AT
  • Subject: Re: [SM-Discuss] usb install
  • Date: Tue, 2 Dec 2008 15:51:10 -0500

I would just like to make some general comments that might make things
easier for anyone trying to do something similar. Some of my suggestions
may be a little off though, as I'm not sure I clearly understand what it
is you are trying to do for all of the steps below (there are steps you
took where your description is not clear enough for me to know exactly
what you did or perhaps why you were doing it).

Robert Figura (rfigura AT wrote [08.12.02 14:09]:
> I used unetbootin to do this which saved me finding out about the
> correct grub install procedure yet (see below) but i don't think it did
> more for me.

ruskie has made bootable usb keys using syslinux as a drop-in
replacement for isolinux (which is what the ISO boots with) and as far
as I know he didn't have to do anything else (including not having to
mess with the initrd). You might want to try this next time (if there is
a next time) to see if it makes things easier for you.

> - the kernel didn't have the module ehci-hcd.ko

Just to clarify, the "kernel" doesn't have any modules at all. What you
really mean here is that the initrd didn't have the module in question.

> - note that if you edit or copy stuff the resulting initrd.gz may be
> too large. in that case dd if=/dev/zero bs=1M count=14,
> mke2fs, mount loop, copy, umount, zip and use that file.

If you make an initramfs (the ISO will eventually move to an initramfs
instead of or in addition to the initrd) then this becomes a non-issue
as initramfs is not size-limited (it's not a "filesystem", just a
compressed cpio archive).

> - note that /dev/sdb is the usb key.

This will not always be true (it depends on what devices are connected
to your system and in what order the kernel sees/finds them). The ISO
initrd makes use of udev, so why not use that yourself? If you're going
to customize the initrd, you might as well write a custom udev rule for
your usb hardware so that it's guaranteed to always be recognized as the
same device and mapped to a guaranteed unique /dev node so you always
know what it will be called.

> - now load the module, make some device nodes and mount the cdrom
> - /sbin/modprobe ehci-hcd
> - mknod /dev/hda b 3 0
> - mknod /dev/hda1 b 3 1
> - mknod /dev/hda2 b 3 2
> - mknod /dev/sda b 8 0
> - mknod /dev/sda1 b 8 1
> - note: sda is the usb on the new system, hda the harddisk

None of the mknod commands should have been necessary as udev runs on
the initrd. However, it depends on when/where you did the modprobe, as
udev may have been killed at that point. You could have just modified
the ISO's initrd init script (smgl.init) to do the modprobe before udev
gets killed by it and udev would have automatically set up the device.
Also, hda* should already exist if they are hard drives, as again udev
sets those up for you, assuming you were using the ISO initrd and ran

> - i would have loved to use /sbin/smgl.init but that script insists on
> mounting the cdrom as -t iso9660 which isn't true for my usb

You could have just edited it before umounting and recompressing the
initrd (i.e., while you had it open to add the ehci kernel module on it
you could have just changed a few lines around in the init script).

> - so we're copying stuff manually

Why are you "copying stuff manually"? Why not just let the rest of the
"ISO" load and run things from there? It seems like you're doing the
entire install from inside the initrd (which is not necessarily a bad
idea, I'm just wondering why you chose to do it this way).

> - mount /dev/hda2 /mnt/floppy # this dir already exists. root would
> have been a better name tho
> - cd /mnt/floppy
> - export
> "PATH=/mnt/cdrom/sbin:/mnt/cdrom/usr/sbin:/mnt/cdrom/bin:/mnt/cdrom/usr/bin:$PATH"
> - tar xjvf ../cdrom/system.tar.bz2
> - mount /mnt/floppy -o remount,ro
> - sync
> - <ctrl>-<alt>-<del>
> - note that i had some problems to properly mount / ro so if you can
> use the sys-request key to umount and sync before rebooting
> - after that i could boot from usb into hd (in grub 'c' mode):
> - kernel /boot/linux root=/dev/hda2 ro
> - note that the ran into problems and i had to 'i'gnore
> them

What problems did the run into? I'm curious what these are,
and the Grimoire team may be curious as well (since they manage

> Looks like netconf isn't very useful anymore... wth.

Yes, this happened when we switched over to ifupdown, but I didn't
realize/remember about it and hence hadn't removed it from the test4
ISO. It will be removed for test5 though.

Good work on hacking with a usb key! I'll be ensuring that the usb
modules be added to the initrd for test5, and I think changing the
filesystem type for the boot media to not be forced to iso9660 and
instead autodetected (since it has no problem handling autodetection)
will be better, but I want to look into whether there can be any
problems from this before blindly going ahead with it. I'll probably
have it changed for test5 as well though.

Justin "flux_control" Boffemmyer
Cauldron wizard and general mage
Source Mage GNU/Linux

Attachment: pgp2kfa1vAQdj.pgp
Description: PGP signature

Archive powered by MHonArc 2.6.24.

Top of Page