├── isolinux.cfg ├── netinstall-preseed.cfg └── README.md /isolinux.cfg: -------------------------------------------------------------------------------- 1 | prompt 0 2 | timeout 1 3 | default install 4 | label install 5 | menu label ^Install 6 | menu default 7 | kernel linux 8 | append vga=normal initrd=initrd.gz 9 | 10 | # Some other options that might be useful: 11 | # append vga=normal initrd=initrd.gz console=ttyS1,115200n8 net.ifnames=0 12 | -------------------------------------------------------------------------------- /netinstall-preseed.cfg: -------------------------------------------------------------------------------- 1 | # This preseed should boot the installer far enough to start the network-console 2 | # ("continue installation over SSH") 3 | 4 | d-i debian-installer/locale string en_GB 5 | d-i keyboard-configuration/xkb-keymap select us 6 | d-i keymap select gb 7 | 8 | d-i mirror/country string manual 9 | d-i mirror/http/hostname string ftp.uk.debian.org 10 | d-i mirror/http/directory string /debian 11 | d-i mirror/http/proxy string 12 | d-i anna/choose_modules multiselect network-console 13 | 14 | d-i netcfg/choose_interface select auto 15 | d-i netcfg/get_hostname string my-hostname 16 | d-i netcfg/get_domain string my-domain 17 | 18 | # d-i netcfg/disable_dhcp boolean true 19 | # d-i netcfg/confirm_static boolean true 20 | # d-i netcfg/get_nameservers string 8.8.8.8 8.8.4.4 21 | # d-i netcfg/get_ipaddress string 192.168.122.177 22 | # d-i netcfg/get_netmask string 255.255.255.0 23 | # d-i netcfg/get_gateway string 192.168.122.1 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # initrd embedding, Debian/Ubuntu CD preseeding 2 | 3 | This repository used to contain bash scripts that helped create installer CDs with containing a `preseed.cfg`, or various files. You can still find those on the [bash-scripts](https://github.com/danielrichman/preseed/tree/bash-scripts) branch. They were too restrictive, and a rewrite in Python wasn't worth it. Ultimately, creating these CDs is rare, and doesn't need to be automated. So instead, this repo now contains instructions and a few examples. 4 | 5 | ## 1) Acquire the required components 6 | 7 | You will need 8 | 9 | ```bash 10 | sudo apt-get install debian-installer-8-netboot-amd64 fakeroot xorriso isolinux syslinux-common 11 | ``` 12 | 13 | (the last two only necessary if you want to produce CDs). 14 | 15 | ## 2) Vanilla installer 16 | 17 | ```bash 18 | mkdir installer 19 | cp /usr/lib/debian-installer/images/8/amd64/text/debian-installer/amd64/{linux,initrd.gz} installer/ 20 | ``` 21 | 22 | ## 3) Customise 23 | 24 | The folder `extra` will contain things that will be added to the `initrd`. 25 | 26 | ```bash 27 | mkdir extra 28 | ``` 29 | 30 | For example, a preseed file: 31 | 32 | ```bash 33 | cp /path/to/my/preseed.cfg extra/preseed.cfg 34 | ``` 35 | 36 | Or, if you wanted to use the network-console (continue installation over SSH; see `netinstall-preseed.cfg`), 37 | 38 | ```bash 39 | # add our public key to the installer, so we can log in 40 | mkdir extra/.ssh 41 | cp ~/.ssh/id_rsa.pub extra/.ssh/authorized_keys 42 | # generate the installer's host keys in advance, so that we know what the fingerprints are. 43 | # note that the installer will generate new ones for the final system. 44 | mkdir -p extra/etc/ssh 45 | for type in rsa dsa ecdsa; do 46 | ssh-keygen -q -t $type -f extra/etc/ssh/ssh_host_${type}_key -N '' 47 | ssh-keygen -l -f extra/etc/ssh/ssh_host_${type}_key 48 | done 49 | ``` 50 | 51 | Note: I find it a bit weird that when you log into the network console it 52 | starts a *new* instance of the installer menu rather than just attaching you to 53 | the existing one on the terminal. So you may prefer to, instead of logging in 54 | as the `installer` user (whose shell is /bin/network-console), log in as `root` 55 | and use `screen -aAx`. In particular, this means that if your SSH drops, 56 | you're not hosed/split brain. 57 | 58 | 59 | If your network card requires binary blobs: 60 | 61 | ```bash 62 | apt-get download firmware-bnx2 63 | dpkg-deb --extract firmware-bnx2_*.deb extra/ 64 | ``` 65 | 66 | ## 4) Add `extra` to the initrd 67 | 68 | ```bash 69 | gunzip installer/initrd.gz 70 | (cd extra; find . | fakeroot cpio --quiet -F ../installer/initrd --append -o -H newc) 71 | gzip installer/initrd 72 | ``` 73 | 74 | ## 5) Make a CD 75 | 76 | At this point, if you can direct boot, then `linux` and `initrd.gz` will suffice. Otherwise: 77 | 78 | ```bash 79 | cp /usr/lib/ISOLINUX/{isohdpfx.bin,isolinux.bin} installer/ 80 | cp /usr/lib/syslinux/modules/bios/ldlinux.c32 installer/ 81 | ``` 82 | 83 | Copy `isolinux.cfg` from this repository to `installer/isolinux.cfg`. Note the comment that enables the serial console, if you intend to install via OOB management / a VM / etc. 84 | 85 | ```bash 86 | xorriso -outdev installer.iso \ 87 | -map installer/ / \ 88 | -boot_image isolinux dir=/ \ 89 | -boot_image isolinux system_area=installer/isohdpfx.bin \ 90 | -boot_image isolinux partition_table=on 91 | ``` 92 | --------------------------------------------------------------------------------