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

Re: Debian Installer preseed - Feedback on real-use case

On Mon, 2 Jan 2012 22:53:49 +0200, Alexey Eromenko <al4321@gmail.com> wrote:
> Hi,
> I developed Debian-preseed scripts to install Debian 6 on VirtualBox. link:
> https://forums.virtualbox.org/viewtopic.php?f=10&t=46798
> Good news: Debian preseed is found to be powerful & capable of
> handling this task.
> Thanks to my work, today you can install Debian6-on-Debian6 (inside
> VirtualBox) in 10 minutes, 42 seconds (including KDE). Automatically
> !..and drink coffee.
> Bad news: It is much more complex than necessary. I had to jump though
> hoops to make Debian work.

Perhaps you'd like to go into detail about the hoops, as it's possible
that the real issue is with lacking documentation -- it's possible to do
pretty much anything in d-i.

> There are many under-water stones that exist for such complex
> scenarios:

That is certainly true -- For instance, we have an unfortunate tendency
to break old preseed scripts by changing the names of the preseed
variables in later releases, but the alternative would be to restrict
developers too much when they wish to add new features.

> ===========================================
> 1. GTK-based frontend doesn't work with preseed.
> ===========================================
> My isolinux.cfg:
> default debian
> prompt 0
> timeout 1
> label debian
>   kernel /install.$arch/vmlinuz
>   append initrd=/install.$arch/initrd.gz debian-installer/locale=en_US
> console-setup/layoutcode=us netcfg/choose_interface=auto
> priority=critical preseed/file=/floppy/preseed.cfg --
>   #append video=vesa:ywrap,mtrr vga=788
> initrd=/install.$arch/gtk/initrd.gz debian-installer/locale=en_US
> console-setup/layoutcode=us netcfg/choose_interface=auto
> priority=critical preseed/file=/floppy/preseed.cfg --
> When I activated the GTK-based debian installer "gtk/initrd.gz", the
> GUI booted up, but it started to ask unnecessary questions about
> keyboard layout, and more... (it should not, as I provided them in the
> command line)
> Expected Result:
> GTK-based d-i should not ask any more questions than ncurses-based d-i
> does.

Hmm, you seem not to be specifying auto=true (or it's long version:
auto-install/enabled=true) -- that allows the keyboard and locale
questions to be delayed, such that they can be preseeded by file, rather
than on the kernel command line.

BTW, you should also be able to use the short form for the locale as
well (locale=en_US) but I'd normally use auto mode, and then preseed it
in the preseed file.  See:


> ===========================================
> 2. Debian does not loads "preseed.cfg" automatically.
> ===========================================
> Positive Example: Windows XP -- once you boot the OS from CD, it check
> floppy disk for "winnt.sif", and if present, it installs automatically
> according to this unattended script; else manual installer starts.
> Real-world result:
> I had to create re-master custom Debian DVD on-the-fly (using scripting).
> It includes only 4 files:
> linux
> isolinux.bin
> isolinux.cfg
> initrd
> This problem is shared with Red Hat and SUSE distros.
> Expected Result:
> Bootloader (ISOLINUX?) should check for presence of "preseed.cfg" in
> floppy/USB disk/CDROM, and if present, start kernel + this script
> automatically.
> I'm not sure if it is possible to fix.
> in Windows case, the bootloader (Win NT LDR) loads NT kernel, which
> does this check on boot.
> Any ideas ?
> ===========================================
> 3. Debian fails to load "preseed.cfg" from 2nd CDROM
> ===========================================
> In my isolinux.cfg, I tried:
> preseed/file=/cdrom/preseed.cfg
> preseed/file=/cdrom0/preseed.cfg
> preseed/file=/cdrom1/preseed.cfg
> ...
> no go. It can't read.
> Works this way: (from floppy)
> preseed/file=/floppy/preseed.cfg

Odd.  I was under the impression that we were mounting the floppy on
/media/floppy but I see that seems to have changed since I last looked.

Of course, that change looks like it's broken fetch-url's ability to
deal with URLs like floppy://preseed.cfg, which is what I was about to
suggest as an alternative, but I wasn't really holding out much hope
that it would help -- I suppose the fact that this bug has gone
unnoticed indicates something about how often people use floppies these
days ;-)

> Real-world result:
> I had to create virtual floppy image with "preseed.cfg".
> Red Hat and SUSE do not suffer from this issue.
> Expected Result:
> preseed/file=/cdromX/preseed.cfg
> Users should be able to load preseed.cfg from 1st or 2nd CD-ROM.

And we're mounting CDs as /cdrom* now are we?  (rather than /media/cdrom
or some such?) -- I'm afraid I pretty much always use http preseeding,
so I've obviously lost touch.

> ===========================================
> 4. Debian preseed/late_command is a nightmare
> ===========================================
> late_command doesn't support new lines, which makes writing built-in
> embedded scripts difficult.
> preseed.cfg -- look for late_command scripting:
> http://pastebin.com/aDMgyag1
> Look equivalent script in Red Hat kickstart:
> http://pastebin.com/jEvJkfCL
> Red Hat kickstart way:
> cat > /tmp/mywork.sh <<EOF
> echo "Hello World !"
> echo "Hello World Again !"
> echo "Hello World Yet Again !"
> Debian preseed way:
> d-i preseed/late_command string \
> echo 'echo "Hello World !"' > /tmp/mywork.sh
> echo 'echo "Hello World Again !"' >> /tmp/mywork.sh
> echo 'echo "Hello World Yet Again !"' >> /tmp/mywork.sh
> Debian's preseed/late_command is basically unreadable.

If you're doing more that a command or two, you're almost always better
off using preseed/run and/or pulling in a separate script and then
running it -- both techniques can be seen here:


which I much prefer to the kickstart technique, but if you like
kickstart, I believe we still have Colin Watson's kickseed udeb, which I
also believe allows one to use kickstart files for preseeding debian --
no idea how (or how well) it works though.

> Real-world result:
> Debian scripts take longer to write, and are difficult to maintain /
> read / update.
> Expected Result:
> Please provide a better embedded scripting options inside d-i.

See above -- for the hands.com reference, you can get more info by
looking at http://hands.com/d-i/ -- I've not spent a lot of time on all
the classes of late, so it's possible that some of them need a bit of
work to bring them up to date with squeeze, but the main structure
should be fine (check the dates on files).  That should give you a
worked example of how one can do rather complicated things in d-i
without getting too stressed.  (If you have a play, and notice things
that need to be fixed for squeeze, please mention them).

BTW if the hands.com/d-i/ stuff fits in with what you're trying to do,
I'm happy to accept contributions, which could for instance include any
classes needed to support VirtualBox, say.

Cheers, Phil.
|)|  Philip Hands [+44 (0)20 8530 9560]    http://www.hands.com/
|-|  HANDS.COM Ltd.                    http://www.uk.debian.org/
|(|  10 Onslow Gardens, South Woodford, London  E18 1NE  ENGLAND

Attachment: pgpTD73WbODXU.pgp
Description: PGP signature

Reply to: