7 for _PARAMETER in ${LIVE_BOOT_CMDLINE}
9 case "${_PARAMETER}" in
10 live-boot.read-only=*|read-only=*)
12 LIVE_READ_ONLY_DEVICES="${_PARAMETER#*read-only=}"
15 live-boot.read-only|read-only)
21 case "${LIVE_READ_ONLY}" in
30 # Marking some block devices as read-only to ensure that nothing
31 # gets written as linux still writes to 'only' read-only mounted filesystems.
32 LIVE_READ_ONLY_DEVICES="${LIVE_READ_ONLY_DEVICES:-/dev/sd* /dev/vd*}"
34 for _DEVICE in $(echo ${LIVE_READ_ONLY_DEVICES} | sed -e 's|,| |g')
36 if [ ! -b "${_DEVICE}" ]
41 echo -n "live-boot: Setting ${_DEVICE} read-only..." > /dev/console
43 blockdev --setro ${_DEVICE}
48 echo " done, use 'blockdev --setrw ${_DEVICE}' to set read-write." > /dev/console
52 echo " failed." > /dev/console
57 if grep -qw persistence /proc/cmdline
59 printf " * Persistence mode enabled, searching for persistency related devices to unlock\n" >/dev/console
61 for label in custom-ov home-rw home-sn live-rw live-sn persistence
63 if blkid -t LABEL="$label" | grep -q '.'
65 device=$(blkid -t LABEL="$label" | awk -F: '{print $1}')
66 printf " - Setting device %-9s with label '%s' to write mode for persistence mode: " "$device" "$label" >/dev/console
67 blockdev --setrw $device && printf "done\n" >/dev/console || printf "failed\n" >/dev/console