Archiv für den Monat: November 2009

Preseeding Ubuntu Karmic

(English article below) Dieser Artikel ist eine Dokumentation von vielen schweißtreibenden Besuchen im Netz. Leider gibt es für Ubuntu keine so schön zusammenhängende Doku wie für Debian – liegt aber auch daran, dass man mit Ubiquity noch viel mehr schönes Zeug anstellen kann wie mit dem Debian-Installer. Um es einem noch breiteren Publikum zugänglich zu machen, ist dieses Posting ausnahmsweise auf Englisch.

So you want to preseed Ubuntu? Fine. You’ve probably read this article. Maybe you’ve seen the scripts, too. However, there are still some gaps wide enough to stumble into. Here’s a quick overview over how to create an unattended install CD. If you want to add customized packages, you’re a bit more adventurous than I was – but this might give you a head start, anyway.

Getting the files out of the ISO

Here’s your first stop. Go grab everything that’s on the original CD image (no need to burn it, the file itself is just fine if you do this):

mkdir loopdir
mount -o loop ubuntu_whatever.iso loopdir
# you might need a "modprobe loop" first

Now, grab everything inside and copy it to a place where you can modify it:

mkdir cd
cp -a loopdir/{.disk,*} cd/

(Others might find a…

rsync -a -H loopdir/ cd

…more elegant. Whatever you do, don’t miss the “.disk” directory – otherwise, you’ll end up with annoying errors when booting from the final CD – which say that it cannot find a live file system).

The preseed configuration file

Now, you’re here. That’s a lot of nice things you can configure there – but the main thing missing in the 8.xx docs is the part about Ubiquity. Here’s an excerpt from my preseed.cfg (you might use that as a quick start – but note that I’ve preseeded a German installation):

# make sure we get over page 6 of the installation questions:
ubiquity        ubiquity/summary        note
# disable this for one single click before reboot:
ubiquity        ubiquity/reboot boolean true
# the rest should be quite self-explanatory:
ubiquity        languagechooser/language-name   select  German
ubiquity        countrychooser/shortlist        select  DE
ubiquity        countrychooser/countryname      select  Germany
ubiquity        countrychooser/country-name      string Germany
debconf         debconf/language        string  de
ubiquity        console-keymaps-at/keymap       select  de
ubiquity        tzconfig/gmt    boolean false
ubiquity        time/zone       select  Europe/Berlin
ubiquity        debian-installer/country        string DE
ubiquity        debian-installer/language       string de
ubiquity        debian-installer/locale select  de_DE.UTF-8
console-setup   console-setup/layoutcode        select  de
console-setup   console-setup/modelcode select  pc105
console-setup   console-setup/layout    select  Germany
console-setup   console-setup/variant   select  Germany

ubyquity        localechooser/supported-locales multiselect\
de_DE.UTF-8 en_US.UTF-8
# this is what the "late_command" in d-i does. I prefer a trick like
# this to do some setup work on the freshly installed machine -
# this script gets pulled from 192.168.1.1 via http and should
# disable itself after execution. Comment this away if you don't
# want it!
ubiquity        ubiquity/success_command        string  wget \ http://192.168.1.1/ubuntu_deploy -O /target/etc/init.d/S99deploy; ln -s\ /etc/init.d/S99deploy /target/etc/rc2.d/S99deploy; chmod ugo+x /target/etc/init.d/S99deploy

Modify boot command line

I prefer the elegant way: I modify menu.cfg in the isolinux dir. Add these lines to the position you like (add it to text.cfg if you want to have it in between the rest of the options):

label unattended
        menu label Unattended auto install
        kernel /casper/vmlinuz
        append file=/cdrom/preseed/my.seed boot=casper initrd=/casper/initrd.lz debian-installer/locale=de_DE \
automatic-ubiquity noprompt quiet splash --

Modify the locale and name of the preseeding file. Make sure you boot into “automatic-ubiquity”. Use noprompt if you want to use ubiquity’s reboot-option in the preseed file.

Create the ISO

At this point, I don’t go any further. If you want to add packages, do so. But be warned that all the gpg stuff mentioned in the docs apply in that case.

mkisofs -o my_iso_file.iso -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ./cd

Use Virtualbox for extensive testing. Burn at will. And: have fun!So you want to preseed Ubuntu? Fine. You’ve probably read this article. Maybe you’ve seen the scripts, too. However, there are still some gaps wide enough to stumble into. Here’s a quick overview over how to create an unattended install CD. If you want to add customized packages, you’re a bit more adventurous than I was – but this might give you a head start, anyway.

Getting the files out of the ISO

Here’s your first stop. Go grab everything that’s on the original CD image (no need to burn it, the is is just fine if you do this):

mkdir loopdir
mount -o ubuntu_whatever.iso loopdir
# you might need a "modprobe loop" first

Now, grab everything inside and copy it to a place where you can modify it:

mkdir cd
cp -a loopdir/* cd/
cp -a loopdir/.d* cd/

(Others might find a…

rsync -a -H loopdir/ cd

…more elegant. Whatever you do, don’t miss the “.disk” directory – otherwise, you’ll end up with annoying errors when booting from the final CD – which say that it cannot find a live file system).

The preseed configuration file

Now, you’re here. That’s a lot of nice things you can configure there – but the main thing missing in the 8.xx docs is the part about Ubiquity. Here’s an excerpt from my preseed.cfg (you might use that as a quick start – but note that I’ve preseeded a German installation):

# make sure we get over page 6 of the installation questions:
ubiquity        ubiquity/summary        note
# disable this for one single click before reboot:
ubiquity        ubiquity/reboot boolean true
# the rest should be quite self-explanatory:
ubiquity        languagechooser/language-name   select  German
ubiquity        countrychooser/shortlist        select  DE
ubiquity        countrychooser/countryname      select  Germany
ubiquity        countrychooser/country-name      string Germany
debconf         debconf/language        string  de
ubiquity        console-keymaps-at/keymap       select  de
ubiquity        tzconfig/gmt    boolean false
ubiquity        time/zone       select  Europe/Berlin
ubiquity        debian-installer/country        string DE
ubiquity        debian-installer/language       string de
ubiquity        debian-installer/locale select  de_DE.UTF-8
console-setup   console-setup/layoutcode        select  de
console-setup   console-setup/modelcode select  pc105
console-setup   console-setup/layout    select  Germany
console-setup   console-setup/variant   select  Germany

ubyquity        localechooser/supported-locales multiselect\
de_DE.UTF-8 en_US.UTF-8
# this is what the "late_command" in d-i does. I prefer a trick like
# this to do some setup work on the freshly installed machine -
# this script gets pulled from 192.168.1.1 via http and should
# disable itself after execution. Comment this away if you don't
# want it!
ubiquity        ubiquity/success_command        string  wget \ http://192.168.1.1/ubuntu_deploy -O /target/etc/init.d/S99deploy; ln -s\ /etc/init.d/S99deploy /target/etc/rc2.d/S99deploy; chmod ugo+x /target/etc/init.d/S99deploy

Modify boot command line

I prefer the elegant way: I modify menu.cfg in the isolinux dir. Add these lines to the position you like (add it to text.cfg if you want to have it in between the rest of the options):

label unattended
        menu label Unattended auto install
        kernel /casper/vmlinuz
        append file=/cdrom/preseed/my.seed boot=casper initrd=/casper/initrd.lz debian-installer/locale=de_DE \
automatic-ubiquity noprompt quiet splash --

Modify the locale and name of the preseeding file. Make sure you boot into “automatic-ubiquity”. Use noprompt if you want to use ubiquity’s reboot-option in the preseed file.

Create the ISO

At this point, I don’t go any further. If you want to add packages, do so. But be warned that all the gpg stuff mentioned in the docs apply in that case.

mkisofs -o my_iso_file.iso -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ./cd

Use Virtualbox for extensive testing. Burn at will. And: have fun!