-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare.sh
More file actions
executable file
·36 lines (22 loc) · 867 Bytes
/
prepare.sh
File metadata and controls
executable file
·36 lines (22 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -ex
. ./config.sh
. ./${RAID_EXPLORATION}/common.sh
sed -i 's/ main/ main contrib/g' /etc/apt/sources.list
[[ -z "${DEBIAN_BACKPORTS}" ]] || cat <<EOF > /etc/apt/sources.list.d/backports.list
deb http://deb.debian.org/debian/ ${DEBIAN_RELEASE}-backports main contrib
EOF
apt update && apt install -y "${EXTRA_PACKAGES[@]}"
apt install -y mdadm
echo "AUTO -all" >> /etc/mdadm/mdadm.conf
grep "^md" /proc/mdstat | awk '{ print $1 }' | while read md; do
mdadm --stop /dev/$md
done
./partition.sh
if [[ "$BOOT_MODE" = "efi" ]]; then
mdadm --zero-superblock --metadata=1.0 "${EFI_DEVICES[@]}" || true
mdadm --create --metadata=1.0 --name=efi /dev/md/efi --level=1 --raid-devices=4 --bitmap=internal "${EFI_DEVICES[@]}"
wipefs -a /dev/md/efi
mkfs.msdos -F 32 -s 1 -n EFI /dev/md/efi
fi
apt install -y "${RAID_PACKAGES[@]}"