Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions initramfs-tools/scripts/local-bottom/fsprotect
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ fi

# Determine tmpfs size or fallback to 512MB
SZ=512M
fsprotect_skip=
for x in `cat /proc/cmdline` ; do
case "$x" in
fsprotect_skip=*)
fsprotect_skip="${x#fsprotect_skip=}"
;;
fsprotect=*)
# According to bug #564141 this is supported
# by dash (tested - works)
Expand Down Expand Up @@ -139,6 +143,16 @@ run_echo "mkdir ${rootmnt}$BASE/tmp"
run_echo "mount -n -o move $BASE/system ${rootmnt}$BASE/system" # Move those dirs inside the new root
run_echo "mount -n -o move $BASE/tmp ${rootmnt}$BASE/tmp"

if ! [ -z "${fsprotect_skip}" ]; then
run_echo "mount -n -o remount,rw ${rootmnt}$BASE/system"
OLDIFS="$IFS"
IFS=,
for x in $fsprotect_skip; do
_log_msg "Excluding ${x} from aufs"
IFS="$OLDIFS" run_echo "mount -n -o bind ${rootmnt}$BASE/system${x} ${rootmnt}${x}"
done
fi

# This one will prevent FSCKs
touch ${rootmnt}/fastboot

Expand Down