Update package version to 107 and add cleanup-initramfs script

This commit is contained in:
2025-07-07 21:57:46 +03:00
parent ebb592f61a
commit 3704f302d3
5 changed files with 27 additions and 5 deletions
+12
View File
@@ -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 -2
View File
@@ -1,7 +1,6 @@
name: dracut name: dracut
description: Event driven initramfs infrastructure description: Event driven initramfs infrastructure
version: 106 version: 107
revision: 3
url: https://github.com/dracut-ng/dracut-ng url: https://github.com/dracut-ng/dracut-ng
license: GPL2-or-later license: GPL2-or-later
architecture: any architecture: any
+1 -1
View File
@@ -2,4 +2,4 @@ trigger_operations: ["install", "upgrade", "remove"]
target_type: "path" target_type: "path"
targets: ["boot/vmlinu*"] targets: ["boot/vmlinu*"]
depends: ["dracut"] depends: ["dracut"]
run: "/usr/bin/generate-initramfs" run: "/usr/sbin/generate-initramfs"
+11
View File
@@ -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
+2 -2
View File
@@ -24,8 +24,8 @@ build() {
package() { package() {
make DESTDIR="$BPM_OUTPUT" install make DESTDIR="$BPM_OUTPUT" install
# Install generate-initramfs script # Install generate-initramfs and cleanup-initramfs scripts
install -Dm755 "$BPM_WORKDIR"/generate-initramfs "$BPM_OUTPUT"/usr/bin/generate-initramfs install -Dm755 "$BPM_WORKDIR"/{generate,cleanup}-initramfs -t "$BPM_OUTPUT"/usr/sbin/
# Install BPM hook # Install BPM hook
install -Dm644 "$BPM_WORKDIR"/10-dracut.bpmhook "$BPM_OUTPUT"/var/lib/bpm/hooks/10-dracut.bpmhook install -Dm644 "$BPM_WORKDIR"/10-dracut.bpmhook "$BPM_OUTPUT"/var/lib/bpm/hooks/10-dracut.bpmhook