summaryrefslogtreecommitdiffstats
path: root/liveinit
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2016-02-17 13:04:46 +0100
committer Eric Hameleers <alien@slackware.com>2016-02-17 13:04:46 +0100
commit914f14494c50721868e02889e332b5c6a6e9e4ba (patch)
treedb5bfeb5491a8ed5deb47d485785db0a6d2a3ed1 /liveinit
parentcf5734babeb10618f793e1414d08ddeab73df897 (diff)
downloadliveslak-914f14494c50721868e02889e332b5c6a6e9e4ba.tar.gz
liveslak-914f14494c50721868e02889e332b5c6a6e9e4ba.tar.xz
New boot parameter "localhd" to initialize RAID/LVM on local harddisks.
Diffstat (limited to 'liveinit')
-rwxr-xr-xliveinit46
1 files changed, 31 insertions, 15 deletions
diff --git a/liveinit b/liveinit
index 9ec6fef..d8c5945 100755
--- a/liveinit
+++ b/liveinit
@@ -53,6 +53,9 @@ DEBUG=0
# Masochists can copy the live environment into RAM:
TORAM=0
+# By default we do not touch local hard disks (raid, lvm, btrfs):
+LOCALHD=0
+
# Perhaps we need to blacklist some kernel module(s):
BLACKLIST=""
@@ -113,6 +116,9 @@ for ARG in $(cat /proc/cmdline); do
locale=*)
LOCALE=$(echo $ARG | cut -f2 -d=)
;;
+ localhd=*)
+ LOCALHD=1
+ ;;
luksvol=*)
# Format: luksvol=file1[:/mountpoint1][,file1[:/mountpoint2],...]
LUKSVOL=$(echo $ARG | cut -f2 -d=)
@@ -203,22 +209,32 @@ if [ -n "$KEYMAP" ]; then
fi
if [ "$RESCUE" = "" ]; then
- # Initialize RAID:
- if [ -x /sbin/mdadm ]; then
- # If /etc/mdadm.conf is present, udev should DTRT on its own;
- # If not, we'll make one and go from there:
- if [ ! -r /etc/mdadm.conf ]; then
- /sbin/mdadm -E -s >/etc/mdadm.conf
- /sbin/mdadm -S -s
- /sbin/mdadm -A -s
- # This seems to make the kernel see partitions more reliably:
- fdisk -l /dev/md* 1> /dev/null 2> /dev/null
+ if [ $LOCALHD -eq 1 ]; then
+ # We will initialize RAID/LVM/BTRFS on local harddisks:
+ # Initialize RAID:
+ if [ -x /sbin/mdadm ]; then
+ # If /etc/mdadm.conf is present, udev should DTRT on its own;
+ # If not, we'll make one and go from there:
+ if [ ! -r /etc/mdadm.conf ]; then
+ /sbin/mdadm -E -s >/etc/mdadm.conf
+ /sbin/mdadm -S -s
+ /sbin/mdadm -A -s
+ # This seems to make the kernel see partitions more reliably:
+ fdisk -l /dev/md* 1> /dev/null 2> /dev/null
+ fi
fi
- fi
- # Scan for btrfs multi-device filesystems:
- if [ -x /sbin/btrfs ]; then
- /sbin/btrfs device scan
+ # Initialize LVM:
+ if [ -x /sbin/vgchange ]; then
+ mkdir -p /var/lock/lvm # this avoids useless warnings
+ /sbin/vgchange -ay --ignorelockingfailure 2>/dev/null
+ /sbin/udevadm settle --timeout=10
+ fi
+
+ # Scan for btrfs multi-device filesystems:
+ if [ -x /sbin/btrfs ]; then
+ /sbin/btrfs device scan
+ fi
fi
# --------------------------------------------------------------------- #
@@ -680,7 +696,7 @@ EOPW
# Switch to real root partition:
/sbin/udevadm settle --timeout=10
echo 0x0100 > /proc/sys/kernel/real-root-dev
-
+
if [ ! -r /mnt/overlay/${INIT} ]; then
echo "ERROR: No ${INIT} found on rootdev (or not mounted). Trouble ahead."
echo " You can try to fix it. Type 'exit' when things are done."