diff --git a/.gitignore b/.gitignore index 88b3553..2febe97 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/pkg/de-p1st-grub/PKGBUILD b/pkg/de-p1st-grub/PKGBUILD index 0e8cae7..246651c 100644 --- a/pkg/de-p1st-grub/PKGBUILD +++ b/pkg/de-p1st-grub/PKGBUILD @@ -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 } diff --git a/pkg/de-p1st-installer/PKGBUILD b/pkg/de-p1st-installer/PKGBUILD index 1075667..ffec926 100644 --- a/pkg/de-p1st-installer/PKGBUILD +++ b/pkg/de-p1st-installer/PKGBUILD @@ -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') diff --git a/pkg/de-p1st-installer/de-p1st-installer.sh b/pkg/de-p1st-installer/de-p1st-installer.sh index a60b7c7..90cc829 100755 --- a/pkg/de-p1st-installer/de-p1st-installer.sh +++ b/pkg/de-p1st-installer/de-p1st-installer.sh @@ -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() {