5 ROOTMOUNTPT=/media/realroot
6 REALUMOUNT=/bin/umount.busybox
8 INCDIRS="^/media/\|^/mnt/"
13 ONESHIFTARGS='adflnrv'
24 # Retrieves arguments/mount-point
26 if [ -z "$SKIP" ]; then
27 if echo $var | grep -q "^-.*"; then
28 if echo $var | grep -q "[$TWOSHIFTARGS]"; then
31 if echo $var | grep -q "^-[^- ]*a"; then
36 if [ -z "$MOUNT_POINT" ]; then
39 # This really shouldn't happen when unmounting
40 DEV_PATH="$MOUNT_POINT"
50 # Parse fstab if -a is used
51 if ! [ -z "$DO_FSTAB" ]; then
52 # FIXME: This doesn't handle -t or -O
53 awk '/^[^ #]/ {print $1}' /etc/fstab |
60 # Get mount-point for device name, if device name is given
61 if echo "$MOUNT_POINT" | grep -q "^${DEVICE}"; then
62 MOUNT_POINT_TEMP=`echo $MOUNT_POINT | sed -e "s/\//\\\\\\\\\//g"`
63 NEW_MOUNT_POINT=`awk "/$MOUNT_POINT_TEMP/ {print "'$2'"}" /etc/fstab`
64 if ! [ -z "$NEW_MOUNT_POINT" ]; then
65 MOUNT_POINT=$NEW_MOUNT_POINT
69 if ! (echo "$MOUNT_POINT" | grep -q "$INCDIRS"||[ "$MOUNT_POINT" = "/" ]); then
73 # Replace requests to mount '/' (from init scripts and such)
74 # with mount ROOTMOUNTPT (the real-root mount point for the
77 if ([ "$MOUNT_POINT" = "/" ]||[ "$MOUNT_POINT" = "${ROOTMOUNTPT}" ]); then
78 MOUNT_POINT=${ROOTMOUNTPT}
80 PACKAGE_DIR="/packages"
83 # Finally, umount and union-umount
84 unionctl /. --remove `resolvelink $MOUNT_POINT`$PACKAGE_DIR
85 exec ${REALUMOUNT} $ARGS $MOUNT_POINT