# md.bootcd2disk.conf.src - source for md.bootcd2disk.conf
### conf.src conf.start
# vim: set filetype=sh :
#        file: md.bootcd2disk.conf
#   copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2001-2020)
#     license: GNU General Public License, version 3
# description: md.bootcd2disk.conf - example config for bootcd2disk with
#              MD devices aka Linux Software RAID
#
# Example for 3 disks, md and bios boot:
#
# +------------DISK0------------+ +------------DISK1------------+ ... --------+
# DISK0P1 DISK0P2 DISK0P3 DISK0P4 DISK1P1 DISK1P2 DISK1P3 DISK1P4 ...   DISK2P4
# |       |       |       |                               |             |
# |       |       |       |                               |             |
# |       |       |       +--raid5------------------------+------ ... --+
# GPTBIOS |       EFI                raid5p1  raid5p2
# -       ext4    fat                swap     ext4
# -       /boot   /boot/efi          -        /
#
# !!! /boot may be on raid5, but it does not always work !!!
#
### conf.src bootcd_mount()
bootcd_mount()
{
  bootcd_global DISK0P2 DISK0P3
  mount /dev/md/raid5p2 $1
  mkdir -p $1/boot
  mount $DISK0P2 $1/boot
  mkdir -p $1/boot/efi
  mount $DISK0P3 $1/boot/efi
}
### conf.src bootcd_umount()
bootcd_umount()
{
  umount $1/boot/efi
  umount $1/boot
  umount $1
}
### conf.src DISK#
DISK0="auto"
DISK1="auto"
DISK2="auto"
DISK3="/dev/md/raid5"
### conf.src EFIBOOT
EFIBOOT="bios+efi"
### conf.src EXT4FS
EXT4FS="\
DISK0P2
/dev/md/raid5p2"
### conf.src FSTAB
FSTAB="\
DISK0P2      /boot     ext4 defaults,errors=remount-ro 0 1
DISK0P3      /boot/efi vfat defaults,errors=remount-ro 0 1
/dev/md/raid5p2 /      ext4 defaults,errors=remount-ro 0 1
/dev/md/raid5p1 none   swap sw 0 0"
### conf.src MD
MD="raid5 5 DISK0P4 DISK1P4 DISK2P4"
### conf.src ORDER
ORDER="parti md parti"
### conf.src SFDISK#
# P1 = GPTBIOS = 100 MB
# P2 = /boot = 200 MB
# P3 = /boot/efi = 100 MB
# P4 = raid
SFDISK0="label: gpt
unit: sectors
,$(expr 100 \* 2048),21686148-6449-6E6F-744E-656564454649
,$(expr 200 \* 2048),L
,$(expr 100 \* 2048),L
,+,R;"
SFDISK1="$SFDISK0"
SFDISK2="$SFDISK0"
# P1 = SWAP = 100 MB
# P2 = / = all unused
SFDISK3="label: gpt
unit: sectors
,$(expr 100 \* 2048),S
,+,L;"
### conf.src SWAP
SWAP="/dev/md/raid5p1"
### conf.src VFAT
VFAT="DISK0P3"
### conf.src conf.end
