Commits (1)
  • kevcrumb's avatar
    Split Linux - prefer devices labelled "split" · c72751d7
    kevcrumb authored
    Only crypto_LUKS-devices where the label starts with "split" are now
    offered for decryption at boot. If no label matches that rule, the
    selection will revert to include any crypto_LUKS-device found.
    
    Accordingly, the "format_for_splitlinux"-script now initializes newly
    created devices with this label.
    
    Multi-device detection is now enabled. Encrypted RAID devices will be
    found and treated like any other block device.
    c72751d7
......@@ -35,9 +35,26 @@ retries=0
while [ $choice -lt 0 -o $choice -gt $total ] ; do
sleep 1s
crypto_devices=`lsblk --noheadings --list --paths --output FSTYPE,NAME,SIZE,UUID | sed --silent 's#^crypto_LUKS \+##p'`
# `wc` is not available, hence this awk command will count the lines.
total=`echo -n "$crypto_devices" | awk 'END {print NR}'`
if [ $total -ge 2 ] ; then
split_labelled_crypto_devices=''
while read c ; do
device=`echo "$c" | awk '{ print $1 }'`
cryptsetup luksDump "$device" | awk '/^Label:/ {print $2}' | grep '^split' >/dev/null &&
split_labelled_crypto_devices=`printf "${split_labelled_crypto_devices}\n$c\n" | grep -v '^$'`
done <<EOF
$crypto_devices
EOF
[ "$split_labelled_crypto_devices" ] &&
crypto_devices="$split_labelled_crypto_devices"
fi
total=`echo -n "$crypto_devices" | awk 'END {print NR}'`
if [ $total -ge 2 ] ; then
echo ' Multiple crypto_LUKS devices found.'
echo ' Please select the one containing the Split horde (or skip by pressing 0).'
......@@ -71,7 +88,7 @@ while [ $choice -lt 0 -o $choice -gt $total ] ; do
esac
retries=`expr $retries + 1`
else
echo ' Only one crypto_LUKS device found. Using it.'
echo ' Exactly one matching crypto_LUKS device found. Using it.'
choice=$total
fi
fi
......
......@@ -29,7 +29,7 @@ if [ cpuid -l ]; then
set gfxpayload="keep"
linux (${voidlive})/boot/vmlinuz \
root=live:CDLABEL=VOID_LIVE ro init=/sbin/init \
rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 gpt add_efi_memmap \
rd.auto=1 rd.luks=0 rd.dm=0 loglevel=4 gpt add_efi_memmap \
vconsole.unicode=1 vconsole.keymap=@@KEYMAP@@ \
locale.LANG=@@LOCALE@@ @@BOOT_CMDLINE@@
initrd (${voidlive})/boot/initrd
......@@ -38,7 +38,7 @@ if [ cpuid -l ]; then
set gfxpayload="keep"
linux (${voidlive})/boot/vmlinuz \
root=live:CDLABEL=VOID_LIVE ro init=/sbin/init \
rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 gpt add_efi_memmap \
rd.auto=1 rd.luks=0 rd.dm=0 loglevel=4 gpt add_efi_memmap \
vconsole.unicode=1 vconsole.keymap=@@KEYMAP@@ \
locale.LANG=@@LOCALE@@ @@BOOT_CMDLINE@@ rd.live.ram
initrd (${voidlive})/boot/initrd
......
......@@ -23,11 +23,11 @@ MENU COLOR sel * #ffffffff #FF5255FF *
LABEL linux
MENU LABEL @@BOOT_TITLE@@ @@KERNVER@@ @@ARCH@@
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd root=live:CDLABEL=VOID_LIVE init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=@@KEYMAP@@ locale.LANG=@@LOCALE@@ @@BOOT_CMDLINE@@
APPEND initrd=/boot/initrd root=live:CDLABEL=VOID_LIVE init=/sbin/init ro rd.auto=1 rd.luks=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=@@KEYMAP@@ locale.LANG=@@LOCALE@@ @@BOOT_CMDLINE@@
LABEL linuxram
MENU LABEL @@BOOT_TITLE@@ @@KERNVER@@ @@ARCH@@ (RAM)
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd root=live:CDLABEL=VOID_LIVE init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=@@KEYMAP@@ locale.LANG=@@LOCALE@@ @@BOOT_CMDLINE@@ rd.live.ram
APPEND initrd=/boot/initrd root=live:CDLABEL=VOID_LIVE init=/sbin/init ro rd.auto=1 rd.luks=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=@@KEYMAP@@ locale.LANG=@@LOCALE@@ @@BOOT_CMDLINE@@ rd.live.ram
LABEL c
MENU LABEL Boot first HD found by BIOS
COM32 chain.c32
......