summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-12-16 20:13:32 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-12-23 14:58:04 +0000
commit35c2ef29bae7dcf4131c56d9334e1f5ca2e5f9e5 (patch)
treebf1522fc7e43f7e2e39554eda6a785b3f118cde0
parent5c45ab7fca6f8cc38eec8e7de4cb9d072c9430ad (diff)
downloadaports-35c2ef29bae7dcf4131c56d9334e1f5ca2e5f9e5.tar.bz2
aports-35c2ef29bae7dcf4131c56d9334e1f5ca2e5f9e5.tar.xz
main/mkinitfs: cleanup links and initramfs on uninstall
(cherry picked from commit b6c5224513cf1eeabfbb30bafa4d098794b902fb)
-rw-r--r--main/mkinitfs/APKBUILD2
-rw-r--r--main/mkinitfs/mkinitfs.trigger17
2 files changed, 14 insertions, 5 deletions
diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD
index 8f2789fb..c3f3e767 100644
--- a/main/mkinitfs/APKBUILD
+++ b/main/mkinitfs/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mkinitfs
pkgver=2.0_rc6
-pkgrel=1
+pkgrel=2
pkgdesc="Tool to generate initramfs images for Alpine"
url=http://git.alpinelinux.org/cgit/mkinitfs
depends="busybox apk-tools>=2.0_rc7"
diff --git a/main/mkinitfs/mkinitfs.trigger b/main/mkinitfs/mkinitfs.trigger
index c181233e..f21a157e 100644
--- a/main/mkinitfs/mkinitfs.trigger
+++ b/main/mkinitfs/mkinitfs.trigger
@@ -3,16 +3,19 @@
for i in "$@"; do
# get last element in path
flavor=${i##*/}
+ if ! [ -f "$i"/kernel.release ]; then
+ # kernel was uninstalled
+ rm -f $( readlink -f /boot/initramfs-$flavor ) \
+ /boot/initramfs-$flavor /boot/vmlinuz-$flavor \
+ /boot/$flavor /boot/$flavor.gz /$flavor /$flavor.gz
+ continue
+ fi
abi_release=$(cat "$i"/kernel.release)
initfs=initramfs-$abi_release
mkinitfs -o /boot/$initfs $abi_release
ln -sf $initfs /boot/initramfs-$flavor
ln -sf vmlinuz-$abi_release /boot/vmlinuz-$flavor
- # extlinux will use path relative partition, so if /boot is on a
- # separate partition we want /boot/<kernel> resolve to /<kernel>
- [ -e /boot/boot ] || ln -sf / /boot/boot
-
#this is for compat. to be removed eventually...
ln -sf vmlinuz-$flavor /boot/$flavor
ln -sf initramfs-$flavor /boot/$flavor.gz
@@ -29,3 +32,9 @@ for i in "$@"; do
fi
done
+# extlinux will use path relative partition, so if /boot is on a
+# separate partition we want /boot/<kernel> resolve to /<kernel>
+if ! [ -e /boot/boot ]; then
+ ln -sf / /boot/boot
+fi
+