Improving image build process in chroot environment

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I7576e92fc28652e168179dd6dd61e3231c3993ce
This commit is contained in:
Dongjin Kim
2021-03-10 12:23:31 +09:00
parent 93b7acbf40
commit fab7c46ccb
2 changed files with 14 additions and 1 deletions

View File

@@ -15,3 +15,9 @@ Dpkg::Options {
"--force-confnew";
};
__EOF
dbus-uuidgen > /etc/machine-id
ln -fs /etc/machin-id /var/lib/dbus/machine-id
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

View File

@@ -1,9 +1,16 @@
#!/bin/sh
apt autoremove -y
truncate -s 0 /etc/machine-id
rm /sbin/initctl
dpkg-divert --rename --remove /sbin/initctl
apt autoremove -y
apt clean
rm -f /etc/flash-kernel/machine
rm -f /etc/apt/apt.conf.d/99debconf
rm -rf /tmp/*
rm -rf ~/.bash_history
rm -rf /root/default