2022-02-07 05:06:12 +01:00
|
|
|
packages() {
|
|
|
|
if [ "$EFI" == "1" ]; then
|
2022-02-07 19:29:15 +01:00
|
|
|
addpkg grub-x86_64-efi efibootmgr
|
2022-02-07 05:06:12 +01:00
|
|
|
else
|
|
|
|
addpkg grub
|
|
|
|
fi
|
2022-02-07 16:22:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
config() {
|
2022-02-08 18:57:09 +01:00
|
|
|
if [ "${ENC}" == "1" ]; then
|
|
|
|
if ! grep -q "GRUB_ENABLE_CRYPTODISK" /etc/default/grub; then
|
|
|
|
echo "GRUB_ENABLE_CRYPTODISK=y" >> /etc/default/grub
|
|
|
|
fi
|
|
|
|
uuid=$(blkid -o value -s UUID ${TARGET_PHY_ID}-part${TARGET_PART})
|
|
|
|
if ! grep -q rd.luks.uuid /etc/default/grub; then
|
|
|
|
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.luks.uuid=${uuid} /" /etc/default/grub
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if ! grep -q "#GRUB_ENABLE_CRYPTODISK" /etc/default/grub; then
|
|
|
|
echo "#GRUB_ENABLE_CRYPTODISK=y" >> /etc/default/grub
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if ! grep -q rd.lvm.vg /etc/default/grub; then
|
|
|
|
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.lvm.vg=vg_${TARGETNAME_UNDERSCORE} /" /etc/default/grub
|
2022-02-08 18:58:59 +01:00
|
|
|
fi
|
|
|
|
|
2022-02-08 18:57:09 +01:00
|
|
|
if ! grep -q rd.console.keymap /etc/default/grub; then
|
|
|
|
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\" rd.vconsole.keymap=${L2} /" /etc/default/grub
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
uuid=$(blkid -o value -s UUID /dev/mapper/vg_${TARGETNAME_UNDERSCORE}-swap)
|
|
|
|
if [[ "${HIBERNATE}" == "1" ]]; then
|
|
|
|
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"resume=UUID=${uuid} /" /etc/default/grub
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! grep -q "dark-gray/black" /etc/default/grub; then
|
|
|
|
echo "GRUB_COLOR_NORMAL=\"dark-gray/black\"" >> /etc/default/grub
|
|
|
|
echo "GRUB_COLOR_HIGHLIGHT=\"light-green/black\"" >> /etc/default/grub
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2022-02-07 19:10:58 +01:00
|
|
|
if [ "${EFI}" == "1" ]; then
|
2022-02-07 19:13:14 +01:00
|
|
|
grub-install
|
2022-02-07 20:00:29 +01:00
|
|
|
#efibootmgr --create --disk "${TARGET_PHY_ID}-part1" --loader /EFI/void/grubx64.efi --label "Voidlinux" --verbose
|
2022-02-07 16:22:08 +01:00
|
|
|
else
|
2022-02-07 19:10:58 +01:00
|
|
|
grub-install "${TARGET_PHY_ID}"
|
2022-02-08 18:57:09 +01:00
|
|
|
fi
|
2022-02-07 20:00:29 +01:00
|
|
|
lv=$(xbps-query linux|grep pkgver|awk '{print $2}')
|
|
|
|
lv1="${lv//-/}"
|
|
|
|
lv2="${lv1%_*}"
|
|
|
|
xbps-reconfigure -f "${lv2}"
|
2022-02-07 05:06:12 +01:00
|
|
|
}
|