temporary directory /etc/hotplug "fixed"
reboot and shutdown via "at" remove some packages for development systems set default runlevel to 3 export some environment settings (LANG and TERM) for "chroot" is_init_running migrated to "at"
This commit is contained in:
parent
f49d0d7cf5
commit
c54e5975a6
|
@ -180,9 +180,9 @@ function is_crypto_mounted()
|
|||
|
||||
function is_init_running()
|
||||
{
|
||||
ps -e | grep -q -E "$MKFS_DATA|$WIPE"
|
||||
#ps -e | grep -q -E "$MKFS_DATA|$WIPE"
|
||||
# this line is good for the "at" stuff - see cryptobox.pl
|
||||
[ -n "`at -l`" ]
|
||||
[ -n "$(at -l)" ]
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,13 @@ mount -n --bind "$TMP_DIR" "$MNT_DST"
|
|||
|
||||
[ ! -e /proc/mounts ] && mount -n -t proc proc /proc
|
||||
|
||||
# default language setting - prevents dpkg error messages
|
||||
export LANG=C
|
||||
|
||||
# set default terminal (good if you are running in a screen session)
|
||||
export TERM=linux
|
||||
|
||||
# execute parameters as commandline
|
||||
if [ $# -gt 0 ]
|
||||
then "$@"
|
||||
else bash
|
||||
|
|
|
@ -14,12 +14,16 @@ set -eu
|
|||
RUNTIMEDIR=/opt/dfsruntime/runtimerd
|
||||
TUNDEV=$RUNTIMEDIR/dev/net/tun
|
||||
|
||||
SECURITY_REMOVE_PACKAGES="ssh strace telnet unzip tar zip wget ppp pppconfig nvi nano gzip curl bzip2 aptitude tasksel pppoe pppoeconf elinks"
|
||||
SECURITY_REMOVE_PACKAGES="ssh strace unzip tar zip wget nvi nano gzip curl bzip2 aptitude tasksel elinks"
|
||||
DEVEL_REMOVE_PACKAGES="exim4-daemon-light exim4-config exim4-base netkit-inetd telnet ppp pppconfig pppoe pppoeconf"
|
||||
|
||||
|
||||
function configure_normal()
|
||||
# the usual stuff - not optimized for security
|
||||
{
|
||||
# set default runlevel to 3
|
||||
sed -i 's/^id:2:initdefault/id:3:initdefault/' /etc/inittab
|
||||
|
||||
######### devices ##########
|
||||
# create tun device for running under qemu
|
||||
if [ ! -e "$TUNDEV" ]
|
||||
|
@ -45,6 +49,10 @@ function configure_normal()
|
|||
# allow nput of password
|
||||
sed -i 's/^PasswordAuthentication.*$/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
||||
fi
|
||||
|
||||
# remove unnecessary packages - return true, if no packages were
|
||||
# removed
|
||||
dpkg --force-all -P $DEVEL_REMOVE_PACKAGES 2>&1 | grep -v "which isn't installed." || true
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -195,14 +195,14 @@ sub box_init
|
|||
sub system_poweroff()
|
||||
{
|
||||
&umount_vol();
|
||||
system("{sleep 5; /sbin/poweroff; } </dev/null &>/dev/null &");
|
||||
system("echo /sbin/poweroff | at now + 1 minutes >>$LOG_FILE 2>&1");
|
||||
}
|
||||
|
||||
|
||||
sub system_reboot()
|
||||
{
|
||||
&umount_vol();
|
||||
system("{sleep 5; /sbin/reboot; } </dev/null &>/dev/null &");
|
||||
system("echo /sbin/reboot | at now + 1 minutes >>$LOG_FILE 2>&1");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ ramdisk_files = /etc/resolv.conf
|
|||
/etc/network
|
||||
/var/lib/misc
|
||||
/var/lib/urandom
|
||||
/etc/hotpug
|
||||
/etc/hotplug
|
||||
/var/spool/cron
|
||||
|
||||
# Directories to create on live fs
|
||||
|
|
Loading…
Reference in New Issue