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/* /dev/*/*}"
34 for _DEVICE in $(echo ${LIVE_READ_ONLY_DEVICES} | sed -e 's|,| |g')
36 # ignore symlinks like /dev/cdrom, /dev/block/* which point to actual devices
37 if [ -L "${_DEVICE}" ]
42 # only consider actual block devices
43 if [ ! -b "${_DEVICE}" ]
48 if ! blockdev --getsz "${_DEVICE}" >/dev/null 2>&1
50 printf " * live-boot: Ignoring '%-10s' (not present?)\n" "${_DEVICE}" > /dev/console
54 printf " * live-boot: Setting %-10s read-only..." "${_DEVICE}" > /dev/console
56 blockdev --setro "${_DEVICE}"
61 printf " done, use 'blockdev --setrw %-10s' to set read-write.\n" "${_DEVICE}" > /dev/console
65 printf " failed.\n" > /dev/console
70 if grep -qw persistence /proc/cmdline
72 printf " * Persistence mode enabled, searching for persistency related devices to unlock\n" >/dev/console
74 for label in custom-ov home-rw home-sn live-rw live-sn persistence
76 if blkid -t LABEL="$label" | grep -q '.'
78 device=$(blkid -t LABEL="$label" | awk -F: '{print $1}')
79 printf " - Setting device %-9s with label '%s' to write mode for persistence mode: " "$device" "$label" >/dev/console
80 blockdev --setrw $device && printf "done\n" >/dev/console || printf "failed\n" >/dev/console