Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Debian Installer NetBoot (PXE) eatmydata Speedup
#!/bin/bash
# Debian Installer NetBoot (PXE) eatmydata Speedup
# See http://people.skolelinux.org/pere/blog/Speeding_up_the_Debian_installer_using_eatmydata_and_dpkg_divert.html
mkdir -p debian_netboot_eatmydata/root
cd debian_netboot_eatmydata
curl -LO http://http.us.debian.org/debian/pool/main/libe/libeatmydata/eatmydata-udeb_105-5_all.udeb
ar xv eatmydata-udeb_105-5_all.udeb
tar xf data.tar.xz -C root
cd root
find . | cpio --create --format='newc' > ../debian_netboot_eatmydata
cd ..
gzip -9 debian_netboot_eatmydata
## From https://wiki.debian.org/DebianInstaller/NetbootFirmware
## "Initramfs is essentially a concatenation of gzipped cpio archives which are
## extracted into a ramdisk and used as an early userspace by the Linux kernel.
## Debian Installer's initrd.gz is in fact a single gzipped cpio archive
## containing all the files the installer needs at boot time. By simply
## appending another gzipped cpio archive - containing the [...] files we are
## missing - we get the show on the road!"
cp debian_netboot_eatmydata.gz /pxe/initrd.gz/directory/
cd /pxe/initrd.gz/directory/
mv initrd.gz initrd.gz.orig
cat initrd.gz.orig debian_netboot_eatmydata.gz > initrd.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment