+### Begin calculate boot partition space
+# due to raid duplication
+case $raid_level in
+ 1*) boot_space=$(( boot_space / 2 )) ;;
+esac
+if (( boot_space > 60000 )); then
+ # this is larger than needed for several /boot subvols,
+ # becuase I keep a minimal debian install on it for
+ # recovery needs and for doing pxe-kexec.
+ boot_mib=10000
+elif (( boot_space > 30000 )); then
+ boot_mib=$(( 5000 + (boot_space - 30000) / 2 ))
+else
+ # Small vms don't have room for /boot recovery. With 3 kernels
+ # installed, i'm using 132M on t8, so this seems like plenty of
+ # room. note: rhel 8 recomments 1g for /boot.
+ boot_mib=500
+ #
+fi
+case $raid_level in
+ 1*) boot_mib=$(( boot_mib * 2 )) ;;
+esac
+### end calculate boot partition space
+