From 0b5e9fe47bb73fcaaa6193b8060e26bacbef5517 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Fri, 2 May 2025 21:40:58 +0300 Subject: [PATCH] Add BPM hook for generating grub config automatically and cleaned up source.sh script --- pkg.info | 2 +- source-files/20-grub.bpmhook | 5 +++++ source.sh | 23 +++++++++++++---------- 3 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 source-files/20-grub.bpmhook diff --git a/pkg.info b/pkg.info index 67cbec2..d2f31cc 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,7 @@ name: grub description: The GRand Unified Bootloader version: 2.12 -revision: 2 +revision: 3 url: https://www.gnu.org/software/grub/ license: GPL3-or-later architecture: any diff --git a/source-files/20-grub.bpmhook b/source-files/20-grub.bpmhook new file mode 100644 index 0000000..427f1a7 --- /dev/null +++ b/source-files/20-grub.bpmhook @@ -0,0 +1,5 @@ +trigger_operations: ["install", "upgrade", "remove"] +target_type: "path" +targets: ["boot/vmlinu*"] +depends: ["grub"] +run: "grub-mkconfig -o /boot/grub/grub.cfg" diff --git a/source.sh b/source.sh index 0b37dc0..e595a05 100644 --- a/source.sh +++ b/source.sh @@ -34,18 +34,21 @@ build() { make } -# The check function is executed in the source directory -# This function is used to run tests to verify the package has been compiled correctly -check() { - make check -} - # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { make DESTDIR="$BPM_OUTPUT" install - mkdir -p "$BPM_OUTPUT"/usr/share/bash-completion/completions/ - mv -v "$BPM_OUTPUT"/etc/bash_completion.d/grub "$BPM_OUTPUT"/usr/share/bash-completion/completions - mkdir -p "$BPM_OUTPUT"/etc/default/ - cp ../grub.default "$BPM_OUTPUT"/etc/default/grub + + # Install bash completions + install -dm755 "$BPM_OUTPUT"/usr/share/bash-completion/completions/ + mv "$BPM_OUTPUT"/etc/bash_completion.d/grub "$BPM_OUTPUT"/usr/share/bash-completion/completions + + # Install grub default file + install -Dm644 "$BPM_WORKDIR"/grub.default "$BPM_OUTPUT"/etc/default/grub + + # Install BPM hook + install -Dm644 "$BPM_WORKDIR"/20-grub.bpmhook "$BPM_OUTPUT"/var/lib/bpm/hooks/20-grub.bpmhook + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/grub/COPYING }