Update package version to 107 and add cleanup-initramfs script
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Github repository
|
||||
REPO="dracut-ng/dracut-ng"
|
||||
|
||||
# Get tag name using Github Rest API
|
||||
TAG_NAME=$(curl -s -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name')
|
||||
|
||||
# Get version number from tag name
|
||||
VERSION=$(echo "$TAG_NAME" | rev | cut -d'-' -f1 | rev)
|
||||
|
||||
echo "$VERSION"
|
||||
@@ -1,7 +1,6 @@
|
||||
name: dracut
|
||||
description: Event driven initramfs infrastructure
|
||||
version: 106
|
||||
revision: 3
|
||||
version: 107
|
||||
url: https://github.com/dracut-ng/dracut-ng
|
||||
license: GPL2-or-later
|
||||
architecture: any
|
||||
|
||||
@@ -2,4 +2,4 @@ trigger_operations: ["install", "upgrade", "remove"]
|
||||
target_type: "path"
|
||||
targets: ["boot/vmlinu*"]
|
||||
depends: ["dracut"]
|
||||
run: "/usr/bin/generate-initramfs"
|
||||
run: "/usr/sbin/generate-initramfs"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
for file in $(find /boot/ -name 'initramfs-*'); do
|
||||
kver=$(echo "$file" | sed 's/.img//' | cut -d'-' -f'2-')
|
||||
|
||||
# Continue if kernel version is installed
|
||||
[ -d /usr/lib/modules/"$kver" ] && continue
|
||||
|
||||
echo "Removed $file"
|
||||
rm $file
|
||||
done
|
||||
@@ -24,8 +24,8 @@ build() {
|
||||
package() {
|
||||
make DESTDIR="$BPM_OUTPUT" install
|
||||
|
||||
# Install generate-initramfs script
|
||||
install -Dm755 "$BPM_WORKDIR"/generate-initramfs "$BPM_OUTPUT"/usr/bin/generate-initramfs
|
||||
# Install generate-initramfs and cleanup-initramfs scripts
|
||||
install -Dm755 "$BPM_WORKDIR"/{generate,cleanup}-initramfs -t "$BPM_OUTPUT"/usr/sbin/
|
||||
|
||||
# Install BPM hook
|
||||
install -Dm644 "$BPM_WORKDIR"/10-dracut.bpmhook "$BPM_OUTPUT"/var/lib/bpm/hooks/10-dracut.bpmhook
|
||||
|
||||
Reference in New Issue
Block a user