|
|
@@ -51,7 +51,7 @@ start_container() { |
|
|
|
--directory $(realpath $FS) \ |
|
|
|
--machine $MACH |
|
|
|
echo "Waiting..." |
|
|
|
while ! machinectl status $MACH >/dev/null 2>&1 ; do |
|
|
|
while ! env SYSTEMD_LOG_LEVEL=0 machinectl shell $MACH /bin/true ; do |
|
|
|
sleep 0.1 |
|
|
|
done |
|
|
|
} |
|
|
@@ -94,8 +94,6 @@ run "echo 'nameserver 8.8.8.8' > /run/resolvconf/resolv.conf" |
|
|
|
#run "dpkg-divert --local --rename --add /usr/sbin/update-grub" |
|
|
|
#run "ln -sf /bin/true /usr/sbin/update-grub" |
|
|
|
|
|
|
|
run "ping -c 5 google.com" |
|
|
|
|
|
|
|
set +e |
|
|
|
if [ -z "$1" ] ; then |
|
|
|
run "exec bash" |
|
|
@@ -105,14 +103,22 @@ fi |
|
|
|
|
|
|
|
echo "Cleaning up..." |
|
|
|
|
|
|
|
# Manually clean up some unnecessary things that show up after booting |
|
|
|
# an image and installing packages. This doesn't get everything, but |
|
|
|
# what's left should be fine. |
|
|
|
run "apt-get clean" |
|
|
|
run "rm -f /core /boot/grub/grubenv" |
|
|
|
run "rm -f /var/lib/systemd/random-seed" |
|
|
|
run "rm -f /var/lib/ubuntu-drivers-common/last_gfx_boot" |
|
|
|
run "rm -f /var/lib/NetworkManager/*" |
|
|
|
run "rm -f /root/.bash_history" |
|
|
|
|
|
|
|
#run "rm /sbin/initctl" |
|
|
|
#run "dpkg-divert --rename --remove /sbin/initctl" |
|
|
|
#run "rm /usr/sbin/update-grub" |
|
|
|
#run "dpkg-divert --rename --remove /usr/sbin/update-grub" |
|
|
|
#run "rm /var/lib/dbus/machine-id" |
|
|
|
#run "> /etc/resolv.conf" |
|
|
|
run "rm -f /root/.bash_history" |
|
|
|
|
|
|
|
kill_container |
|
|
|
|
|
|
|