Hacking the Debian installer
From Smop.co.uk
Currently I do some rather nasty unpleasantness using the early and late preseed scripts. In particular:
- early script hijacks partman to run partition.sh (I want LVM on S/W RAID)
- partition.sh should be simple, but due to various timing issues
and the desire to make it flexible, it isn't
- late script then tidies up some stuff from partition.sh (namely installing grub on S/W RAID)
- late script then loads up puppet etc
I'd like to improve d-i so that I can achieve this more neatly and allow others to benefit. There is a stack of stuff out there for the installer, but currently it's still a fairly blackbox in many ways.
Last time I tried d-i wouldn't build and you couldn't easily extend it as everything was GPG signed.
Todo
This will be large :-(
- document (or preferably link to) details of how this all works - and how to hack on it
- start using auto mode (didn't work on images I used
- should allow us to stop prompting for so much stuff
- add nice partition hijack
- probably also means working out what partman/debconf stuff I need to do (e.g. for grub)
- add LVM on SW-RAID support
- get network-console working
- replace kernel (and udebs) with newer version
- rip boot device (and IPs?) from PXEboot (IPAPPEND=3)
- allow DHCP to be retried (if portfast isn't enabled, it can timeout - even a long timeout doesn't seem to help)
Build
- tried using the build instructions below (they are both similar).
- set installer/build/sources.list.udeb.local to:
- deb http://debs.example.com/repo stable main/debian-installer
- this then tried to fetch the udebs from there...(which we aren't quite ready for!)
- deb http://ftp.debian.org/debian unstable main/debian-installer
- fakeroot make build_netboot
- this pulled down kernel 2.6.22-3-amd64
- this is set in config/amd64.cfg
- and is pulled from the URL above and installer/build/localudebs/ directory
- this pulled down kernel 2.6.22-3-amd64
- network-console instructions are correct
- dunno what the #include in pkg-lists/netboot/amd64.cfg does vs pkg-lists/netboot/network-console/common
- Hmm - util/get-packages udeb ... (e.g. di-utils) fails due to libc6 deps
- but _why_? the libc6 used in the initrd shouldn't matter surely?
- apt.udeb/state/status has currently installed libc6, libgcc1, libnewt0.52 status
- aha - get-packages primes these (in fact, it constantly reprimes them)
- bad diff ATM, but this stops it (need to edit status file manually):
--- get-packages.orig 2007-12-11 19:27:08.000000000 +0000
+++ get-packages 2007-12-11 23:21:06.000000000 +0000
@@ -88,10 +88,8 @@
# Prepare APTDIR
mkdir -p $APTDIR/state/lists/partial
mkdir -p $APTDIR/cache/archives/partial
-echo -n > $APTDIR/state/status
-if [ "$TYPE" = "deb" ]; then
- APT_GET="$APT_GET -o Dir::State::Status=`pwd`/$APTDIR/state/status"
-else
+#echo -n > $APTDIR/state/status
+if [ "$TYPE" != "deb" ] && [ ! -e $APTDIR/state/status ]; then
# Prime status file with a few system libraries that don't
# currently have udebs, or which udebs still depend on for various
# reasons.
@@ -104,8 +102,8 @@
echo >> $APTDIR/state/status
fi
done
- APT_GET="$APT_GET -o Dir::State::Status=`pwd`/$APTDIR/state/status"
fi
+APT_GET="$APT_GET -o Dir::State::Status=`pwd`/$APTDIR/state/status"
# Update package lists and autoclean cache.
if [ "$ONLINE" = "y" ]; then
It wouldn't half be nice if we didn't require the _whole_ source deps (i.e. TeX) for building netboot images... (comment out dpkg-checkbuilddebs from Makefile).
Getting stuck with failed to chroot to `./tmp/netboot/tree': Operation not permitted Tried removing the tmp tree and rerunning (fakeroot make netboot) as per this note but no joy. This occurs in the dpkg at approx line 293 in Makefile for libslang2 udeb.
