+++ /dev/null
-#!/bin/sh
-
-#set -e
-
-# initramfs-tools header
-
-PREREQ="udev"
-
-prereqs()
-{
- echo "${PREREQ}"
-}
-
-case "${1}" in
- prereqs)
- prereqs
- exit 0
- ;;
-esac
-
-# live-boot script
-
-# make sure all harddisk devices are read-only
-# this is important for forensic investigations
-if grep -qe forensic -qe readonly /proc/cmdline
-then
- for device in /dev/hd* /dev/sd* /dev/vd*
- do
- if [ -b "$device" ]
- then
- printf " * Setting device %-9s to read-only mode: " $device >/dev/console
- blockdev --setro $device && printf "done [ execute \"blockdev --setrw %-9s\" to unlock]\n" $device >/dev/console || printf "failed\n" >/dev/console
- fi
- done
-fi
Arguments
+ # make sure all harddisk devices are read-only
+ # this is important for forensic investigations
+ case "${READ_ONLY}" in
+ true)
+ Read_only
+ ;;
+ esac
+
maybe_break live-premount
log_begin_msg "Running /scripts/live-premount"
run_scripts /scripts/live-premount
for ARGUMENT in $(cat /proc/cmdline)
do
case "${ARGUMENT}" in
+ read-only)
+ READ_ONLY="true"
+ ;;
+
skipconfig)
NOACCESSIBILITY="Yes"
NOFASTBOOT="Yes"
--- /dev/null
+#!/bin/sh
+
+#set -e
+
+Read_only ()
+{
+ # Marking the usual block devices for harddisks read-only
+ for _DEVICE in /dev/sd* /dev/vd*
+ do
+ if [ -b "${_DEVICE}" ]
+ then
+ printf "Setting device %-9s to read-only mode:" ${_DEVICE} > /dev/console
+
+ blockdev --setro ${_DEVICE} && printf " done [ execute \"blockdev --setrw %-9s\" to unlock]\n" ${_DEVICE} > /dev/console || printf "failed\n" > /dev/console
+ fi
+ done
+}