3 . "$SETUP_DATA_DIR/common-data"
4 . "$SETUP_DATA_DIR/common-functions"
5 . "$SETUP_DATA_DIR/common-config"
7 SETUP_HARDENING="$CHROOT_PROFILE_DIR/schsh-hardening"
9 # Mount filesystems from fstab for all chroot types
10 if [ "$STAGE" = "setup-start" ] || [ "$STAGE" = "setup-recover" ]; then
11 if [ "$CHROOT_PROFILE" = "schsh" ]; then
12 if [ -f "$SETUP_HARDENING" ]; then
13 while read REMOUNT; do
14 if echo "$REMOUNT" | egrep -q '^(#|$)' ; then
17 REMOUNT=$(echo "$REMOUNT" | tr ' ' '\t' | tr -s '\t') # replace spaces by tabs, and squeeze tabs together
18 MOUNTPOINT=${CHROOT_PATH}/$(echo "$REMOUNT" | cut -f 1)
19 MOUNTPOINT=$(readlink -m "$MOUNTPOINT") # canonicalize the path
20 MOUNTOPT=$(echo "$REMOUNT" | cut -f 2)
21 if cat /proc/mounts | grep " $MOUNTPOINT " > /dev/null; then # somehow "mountpoint" does not detect bind points...
22 info "Re-mounting $MOUNTPOINT with $MOUNTOPT"
23 mount -o remount,"$MOUNTOPT" "$MOUNTPOINT"
25 info "No such mountpoint: $MOUNTPOINT"
28 done < "$SETUP_HARDENING"
30 fatal "schsh-hardening file '$SETUP_HARDENING' does not exist"
33 info "Not a schsh chroot, not doing anything"