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

Re: How to make preseed.cfg available in no-internet install?

On Sat 05 Jul 2014 at 17:56:43 -0400, Kynn Jones wrote:

> On Sat, Jul 5, 2014 at 2:43 PM, Brian <ad44@cityscape.co.uk> wrote:
> > It can be done but not with a netinst image or CD-1. The method is
> > outlined in this thread.
> Thanks!  It looks like something I could at least stick in a script.
> Searching for "initrd cpio preseed.cfg" I found this page, which spells out
> the whole process in detail:
> https://wiki.debian.org/DebianInstaller/Preseed/EditIso

I wasn't intending you alter the initrd, although you can do that if you
want. For a USB stick (no need to be root):

1. Plug in and use the last few lines of dmesg to find the device name.
   Let's say it is /dev/sdc.

2. Make one partition large enough to hold grub's files (~10M) and a
   netinst or CD-1 image with '/sbin/fdisk'. Put a filesystem on it with
   mkfs.vfat from dosfstools.

	/sbin/mkfs.vfat /dev/sdc1

3. Install pmount. Mount this partition:

	pmount sdc1

4. Install grub on the stick:

	grub-install --boot-directory=/media/sdc1/boot /dev/sdc

5. Determine the UUID of /dev/sdc1:

	/sbin/blkid /dev/sdc1

6. Download the hd-media vmlinuz and initrd.gz from


   and copy them to /boot. Copy your preseed file and a netinst or CD-1
   image to /.

7. Write a /boot/grub/grub.cfg like so:

	menuentry "Test preseed file" {
		search --fs-uuid --set=root UUID
		linux /boot/vmlinuz priority=high file=/hd-media/preseed.cfg locale=en_GB.UTF-8 keymap=gb
		initrd /boot/initrd.gz

   You choose "priority", "locale" and "keymap". I'd start with "priority=low".
   Add "shared/ask_device=manual" and "shared/enter_device=/dev/disk/UUID"
   to the linux line after you are confident with what you have above.

initrd.gz contains iso-scan. It searches for a Debian ISO on the stick.
When it finds it the partition the ISO is on is mounted on /hd-media.
preseed.cfg is on the same partition so that relieves you of the necessity
of mounting it by hand.
> > Is "auto=true" an absolute requirement? Why?
> That's "cargo-cult" on my part, I confess.  I don't quite understand why
> it's there, and was not able to find a sufficiently clear explanation of
> what it's supposed to do.  I've basically kept it because it works.  (I
> probably would have already tested whether I need it or not if it weren't
> because debugging the installation process is so slow.)


Delays locale and keymap questions (when locale and keymap are put in
preseed.cfg) until after network configuration takes place. Not needed
because the preseeding takes place from the linux line at the start of
the install.

I'm not too sure there isn't a bug in the Wheezy installer which leads
to "keymap=gb" not being acted on with "auto=true". People with a "us"
keymap may not notice it because d-i defaults to a us keyboard anyway.

I'll leave it to you to handle tranferring the USB stick contents to a
CD. :)

Reply to: