cleanup created ssh keys upon finish

This commit is contained in:
parazyd 2016-06-08 17:07:07 +02:00
parent 3017288424
commit 9ea7593400
No known key found for this signature in database
GPG Key ID: F0CB28FCF78637DE
4 changed files with 17 additions and 17 deletions

2
config Executable file → Normal file
View File

@ -38,7 +38,6 @@ mirror="http://packages.devuan.org/merged"
# mirror repo section
section="main"
# core packages for the system
core_packages=(devuan-keyring debian-keyring)
core_packages+=(git-core binutils ca-certificates curl)
@ -54,7 +53,6 @@ system_packages=(sysvinit ssh)
workdir="$H/workdir"
strapdir="${workdir}/strapdir"
# declare zuper globals
vars+=(os release version mirror section)
vars+=(workdir strapdir)

0
libdevuansdk Executable file → Normal file
View File

4
zlibs/debootstrap Executable file → Normal file
View File

@ -69,6 +69,7 @@ bootstrap() {
mountdevproc ${strapdir}
escalate "root" "chroot ${strapdir} /thirdstage.sh"
escalate "root" "chroot ${strapdir} /cleanup.sh"
umountdevproc ${strapdir}
@ -84,6 +85,8 @@ config_cleanup() {
rm -f /debconf.set
rm -f /thirdstage.sh
rm -f /etc/ssh/*key
rm -f /etc/ssh/*.pub
EOF
}
@ -142,7 +145,6 @@ tar_bootstrap() {
popd
fi
ls -lh $bootstrap_tgz
}
tar_unpack() {

20
zlibs/helpers Executable file → Normal file
View File

@ -39,22 +39,22 @@ escalate() {
mountdevproc() {
fn mountdevproc $@
strapdir="$1"
req=(strapdir)
local mntdir="$1"
req=(mntdir)
ckreq || return 1
escalate "root" "mount -t proc proc ${strapdir}/proc" && act "mounted /proc"
escalate "root" "mount -o bind /dev ${strapdir}/dev" && act "mounted /dev"
escalate "root" "mount -o bind /dev/pts ${strapdir}/dev/pts" && act "mounted /dev/pts"
escalate "root" "mount -t proc proc ${mntdir}/proc" && act "mounted /proc"
escalate "root" "mount -o bind /dev ${mntdir}/dev" && act "mounted /dev"
escalate "root" "mount -o bind /dev/pts ${mntdir}/dev/pts" && act "mounted /dev/pts"
}
umountdevproc() {
fn umountdevproc $@
strapdir="$1"
req=(strapdir)
local mntdir="$1"
req=(mntdir)
ckreq || return 1
escalate "root" "umount ${strapdir}/dev/pts" && act "unmounted /dev/pts" && sleep 2
escalate "root" "umount ${strapdir}/dev" && act "unmounted /dev" && sleep 2
escalate "root" "umount ${strapdir}/proc" && act "unmounted /proc" && sleep 2
escalate "root" "umount ${mntdir}/dev/pts" && act "unmounted /dev/pts" && sleep 2
escalate "root" "umount ${mntdir}/dev" && act "unmounted /dev" && sleep 2
escalate "root" "umount ${mntdir}/proc" && act "unmounted /proc" && sleep 2
}