1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
setup_chkboot() {
echo "probing testing environment"
mountpoint="/boot"
partition="$(findmnt --noheadings --target "${boot}" --output SOURCE)"
disk="$(lsblk --paths -noheadings --output pkname "${partition}")"
echo " mountpoint: ${mountpoint}"
echo " partition: ${partition}"
echo " disk: ${disk}"
echo "adjusting configuration file"
sed -e "s@^\\(BOOTDIR\\)=.*@\\1=${mountpoint}@g" \
-e "s@^\\(BOOTPART\\)=.*@\\1=${partition}@g" \
-e "s@^\\(BOOTDISK\\)=.*@\\1=${disk}@g" \
-i "/etc/default/chkboot"
chkboot -u
echo "ready to test"
}
|