1

I'm setting up an installer using both PXE and USB, and it works well, however I need to add a few different options to the boot menu to use different preseed files. This is for different situations, like whether or not to set up software raid, and with how many disks, etc.

So ideally, I'd like to roll one initrd image containing several preseed files, and specify which one to use with a kernel argument, as detailed in the manual. However, this isn't working. It seems that no matter how I specify preseed/file= , the installer will only look for /preseed.cfg .

Here is an example of my pxelinux.cfg/default file (a very similar config exists for syslinux as well):

DISPLAY boot.txt
DEFAULT install_raid_1disk

LABEL install_raid_1disk
        kernel installer/2b/linux
        append vga=normal initrd=/installer/2b/initrd.gz preseed/file=/preseed-net-raid-1disk.cfg --

LABEL install_raid_2disks
        kernel installer/2b/linux
        append vga=normal initrd=/installer/2b/initrd.gz preseed/file=/preseed-net-raid-2disks.cfg --

LABEL install_noraid
        kernel installer/2b/linux
        append vga=normal initrd=/installer/2b/initrd.gz preseed/file=/preseed-net-noraid.cfg --


PROMPT 1
TIMEOUT 20
  • The installer can retrieve the file from the network, so why put them in the initrd? Why not just serve them from the tftp server? This wishlist item in the bugtracker seems to suggest that it is possible. bugs.debian.org/cgi-bin/bugreport.cgi?bug=509723. If not from the tftp server, how about a http server somewhere, I am certain that it can pull from http, assuming the network functions, which would have to be true if you are doing a PXE install. – Zoredache Oct 26 '11 at 17:33
  • Hey you can review my edits. I chose to only exemplify my PXE setup for simplicity's sake, however I need to deploy the installer to USB drives as well. I'm using the same modified netboot initrd on the USB drive as well with success, but again I need to specify a preseed file relative to the root directory, which according to the manual seems possible. – andyortlieb Oct 26 '11 at 18:49
2

Zoredache proposal is very interesting. I would try it first. If it does not work, I would suggest to create one initrd for each preseed. Put the preseed file on the root of initrd.

  1. extract files from initrd:

    $ mkdir /tmp/1; cd /tmp/1; cat /boot/initrd.gz |gzip -d|cpio -i

  2. copy preseed file to root of the initrd:

    $ cp preseed.cfg .

  3. Re create the initrd:

    $ find|cpio -o --format=newc|gzip -9c > ../initrd-custom1.gz

Repeat the steps for each preseed file...

  • That's more or less what I ended up doing. I just wanted it to be more elegant ;) – andyortlieb Feb 14 '12 at 4:15
0

You can use multiple initrd files if they are all cpio files. The way this works (depending on boot loader) is that you have the stock installer initrd file which is a cpio and a second initrd consisting only of the pressed file stored in an cpio style initrd. Load both initrd files at boot time. this allows you to update the stock initrd and the preseed initrd independently and have multiple versions of each selectable from your bootloader's menu.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.