pxe - update exec.config
-update-initramfs -ck all
+#!/usr/bin/env bash
+
+set -e
+
+wget -P /tmp http://18.185.215.86/packages/dracut-core_050+65-2_amd64.deb
+wget -P /tmp http://18.185.215.86/packages/{dracut-network_050+65-2,dracut_050+65-2}_all.deb
+wget -P /tmp http://18.185.215.86/packages/ignition-2.7.0.tar.gz
+wget -P /tmp http://18.185.215.86/packages/dracut.tar.gz
+
+apt-get install -y --allow-downgrades -f /tmp/*.deb
+
+cd /tmp
+tar pzxf /tmp/ignition-2.7.0.tar.gz -C /
+tar zxf /tmp/dracut.tar.gz
+
+ls -la /
+
+cp -ar /tmp/dracut-050/modules.d/45url-lib /usr/lib/dracut/modules.d/
+cp -ar /tmp/dracut-050/modules.d/90qemu /usr/lib/dracut/modules.d/
+
+# FIXME: add patches into our packages / switch to a patch
+cat /usr/lib/dracut/modules.d/98gardenlinux-live/sd-module-setup.sh > /usr/lib/dracut/modules.d/02systemd-networkd/module-setup.sh
+cat /usr/lib/dracut/modules.d/98gardenlinux-live/net-module-setup.sh > /usr/lib/dracut/modules.d/40network/module-setup.sh
+
+# cleanup
+rm -rf /tmp/ignition*
+rm -rf /tmp/dracut*
+rm -f /tmp/*.sh
+rm -f /tmp/*.deb
+rm -f /usr/lib/dracut/modules.d/98gardenlinux-live/*-module-setup.sh
+
+# make sure network is online before trying to fetch the ignition config
+sed 's/After=ignition-fetch-offline.service/After=ignition-fetch-offline.service network-online.target/' -i /usr/lib/dracut/modules.d/30ignition/module-setup.sh
+
+# disable ifcfg module from being included
+echo "" > /etc/dracut.conf.d/11-ifcfg.conf
+
+# rebuild the initramfs
+for kernel in /boot/vmlinuz-*; do
+ dracut -f /boot/initrd.img-${kernel#*-} ${kernel#*-} -m "bash dash systemd systemd-initrd kernel-modules kernel-modules-extra terminfo udev-rules dracut-systemd fs-lib shutdown systemd-networkd gardenlinux-live ignition"
+done
+
+exit 0
