Add BPM hook for generating grub config automatically and cleaned up source.sh script
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user