maybe fix mdadm.conf and hostname

master
root 6 years ago
parent f5b6d19ed5
commit c352710da9

@ -1,6 +1,7 @@
#!/bin/bash
set -e
# root 440GiB
# boot 2GiB
# free 5GiB
@ -14,5 +15,6 @@ parted /dev/sdb mkpart primary 440GiB 442GiB
sleep 1
echo 'yes' | mdadm -C /dev/md0 -l1 -n2 /dev/sd[ab]1
echo 'yes' | mdadm -C /dev/md1 -l1 -n2 /dev/sd[ab]2
# $1=hostname
echo 'yes' | mdadm -C /dev/md0 --homehost="$1" -l1 -n2 /dev/sd[ab]1
echo 'yes' | mdadm -C /dev/md1 --homehost="$1" -l1 -n2 /dev/sd[ab]2

@ -18,7 +18,7 @@ apt-get -y install locales
apt-get -y install mdadm cryptsetup btrfs-tools
# replace rescue system hostname with real hostname
mdadm --examine --scan | perl -pe 's/name\=.*?:/name='"$(cat /etc/hostname)"':/' > /etc/mdadm/mdadm.conf
mdadm --examine --scan | perl -pe 's/.*\/dev\/md\/?([0-9]+) .*UUID\=(.+?) .*/ARRAY \/dev\/md$1 UUID=$2/' > /etc/mdadm/mdadm.conf
# after cryptsetup, mdadm, ... because of update-initramfs
apt-get -y install linux-image-amd64

@ -6,7 +6,7 @@ apt-get -y install mdadm btrfs-tools
# returns /dev/md0 as root device
# returns /dev/md1 as boot device
"./hardware/${1}/parted.sh"
"./hardware/${1}/parted.sh" "$2"
# encrypt and unlock root device
echo 'Enter luks password: '

Loading…
Cancel
Save