mirror of
https://codeberg.org/privacy1st/arch
synced 2024-12-23 01:16:04 +01:00
installer: create holoscript with disk uuid instead if directly modifying /etc/default/grub
This commit is contained in:
parent
fed9294e2d
commit
eeb3061eb1
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,7 +6,6 @@
|
||||
/pkg/*/*-any.pkg.tar.zst
|
||||
/pkg/*/*-package.log
|
||||
/pkg/*/*-x86_64-build.log
|
||||
/pkg/de-p1st-gnupg/duraconf/
|
||||
|
||||
/build-iso/out/
|
||||
/build-pkg/out/
|
||||
|
@ -2,7 +2,7 @@
|
||||
_pkgname=grub
|
||||
_reponame=arch
|
||||
pkgname="de-p1st-$_pkgname"
|
||||
pkgver=0.0.4
|
||||
pkgver=0.0.5
|
||||
pkgrel=1
|
||||
pkgdesc="grub with configuration"
|
||||
arch=('any')
|
||||
@ -20,5 +20,5 @@ package() {
|
||||
|
||||
install -Dm0755 -o0 40_efi_setup "$pkgdir"/etc/grub.d/40_efi_setup
|
||||
|
||||
install -Dm0544 grub.holoscript "$pkgdir"/usr/share/holo/files/"$pkgname"/etc/default/grub.holoscript
|
||||
install -Dm0544 grub.holoscript "$pkgdir"/usr/share/holo/files/10-"$pkgname"/etc/default/grub.holoscript
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
_pkgname=installer
|
||||
_reponame=arch
|
||||
pkgname="de-p1st-$_pkgname"
|
||||
pkgver=0.1.12
|
||||
pkgver=0.1.13
|
||||
pkgrel=1
|
||||
pkgdesc="Bash script to install Arch Linux"
|
||||
arch=('any')
|
||||
|
@ -312,9 +312,24 @@ function bootloader() {
|
||||
esac
|
||||
|
||||
echo "Generating /boot/grub/grub.cfg ..."
|
||||
sudo sed -i "s|^GRUB_CMDLINE_LINUX=.*\$|GRUB_CMDLINE_LINUX=\"cryptdevice=/dev/disk/by-uuid/${LUKS_PART_UUID}:crypt\"|" \
|
||||
/mnt/etc/default/grub || return $?
|
||||
sudo arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg || return $?
|
||||
{
|
||||
# /etc/default/grub is managed by Holo. Therefore we should not manually modify it.
|
||||
# Instead, we create a holosript which writes $LUKS_PART_UUID into GRUB_CMDLINE_LINUX of /etc/default/grub
|
||||
{
|
||||
# Use filename .../20- for the holoscript so that it gets executed after the one from de-p1st-grub
|
||||
local holoScriptDir=/mnt/usr/share/holo/files/20-de-p1st-installer/etc/default/
|
||||
# The holoscript shall contain one 'sed "..."' command
|
||||
sudo mkdir -p "${holoScriptDir}" || return $?
|
||||
sudo echo '#!/bin/sh
|
||||
sed "s|^GRUB_CMDLINE_LINUX=.*\$|GRUB_CMDLINE_LINUX=\"cryptdevice=/dev/disk/by-uuid/'"${LUKS_PART_UUID}"':crypt\"|"' \
|
||||
| sudo tee "${holoScriptDir}"/grub.holoscript || return $?
|
||||
sudo chmod 0544 "${holoScriptDir}"/grub.holoscript || return $?
|
||||
}
|
||||
# Then we apply the holoscript
|
||||
sudo arch-chroot /mnt holo apply -f file:/etc/default/grub || return $?
|
||||
# And finally run grub-mkconfig
|
||||
sudo arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg || return $?
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
Loading…
Reference in New Issue
Block a user