Browse Source

Fix some deficiencies in enter.sh

tags/nilmbuntu-5
Jim Paris 5 years ago
parent
commit
eea99fdc1e
2 changed files with 10 additions and 9 deletions
  1. +0
    -5
      cleanup.sh
  2. +10
    -4
      enter.sh

+ 0
- 5
cleanup.sh View File

@@ -3,9 +3,4 @@
# delete all temporary stuff
. config || exit 0

sudo umount ${FS}/dev/pts || true
sudo umount ${FS}/sys/kernel/security || true
sudo umount ${FS}/sys || true
sudo umount ${FS}/proc || true
sudo umount ${MNT} || true
sudo rm --one-file-system -rf ${FS} ${ISO} ${MNT} ${DISK}

+ 10
- 4
enter.sh View File

@@ -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



Loading…
Cancel
Save