commit 9ea7593400bafc938f7a8318b596402484281954
parent 30172884243c7cc670d245cad6d64bddf674a639
Author: parazyd <parazyd@dyne.org>
Date: Wed, 8 Jun 2016 17:07:07 +0200
cleanup created ssh keys upon finish
Diffstat:
4 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/config b/config
@@ -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)
diff --git a/libdevuansdk b/libdevuansdk
@@ -34,8 +34,8 @@ H=${SDK_HOME:-$HOME/.devuan-sdk}
E=${SDK_CONF:-/etc/devuan-sdk}
[[ -r $R ]] || {
- print "Devuan SDK is not installed in: $R"
- print "export SDK_PREFIX if installed on a different path"
+ print "Devuan SDK is not installed in: $R"
+ print "export SDK_PREFIX if installed on a different path"
}
@@ -43,7 +43,7 @@ E=${SDK_CONF:-/etc/devuan-sdk}
## Load Zuper extensions
# conclude initialization
if [[ -r $R/zuper/zuper ]]; then
- source $R/zuper/zuper
+ source $R/zuper/zuper
else source ./zuper/zuper; fi
DEBUG=${DEBUG:-0}
@@ -61,7 +61,7 @@ source $R/zlibs/sysconf
# conclude initialization
if [[ -r $R/zuper/zuper.init ]]; then
- source $R/zuper/zuper.init
+ source $R/zuper/zuper.init
else source ./zuper/zuper.init; fi
# add all other binaries to the path
diff --git a/zlibs/debootstrap b/zlibs/debootstrap
@@ -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() {
diff --git a/zlibs/helpers b/zlibs/helpers
@@ -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
}