summaryrefslogtreecommitdiffstats
path: root/main/mkinitfs
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-09-23 11:30:26 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-09-23 11:30:26 +0000
commitb6a253b9e2c2dd7021fd1812fa81d0b49fae9056 (patch)
treee65eb71bafb19362b02f79d430707f6e05cfb8f1 /main/mkinitfs
parent780930c5ff7ae95c7025772f69028a687a6a51e0 (diff)
downloadaports-b6a253b9e2c2dd7021fd1812fa81d0b49fae9056.tar.bz2
aports-b6a253b9e2c2dd7021fd1812fa81d0b49fae9056.tar.xz
main/mkinitfs: use trigger to create kernel links
Diffstat (limited to 'main/mkinitfs')
-rw-r--r--main/mkinitfs/APKBUILD3
-rw-r--r--main/mkinitfs/mkinitfs.trigger27
2 files changed, 27 insertions, 3 deletions
diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD
index c7823c5f1..3666e533b 100644
--- a/main/mkinitfs/APKBUILD
+++ b/main/mkinitfs/APKBUILD
@@ -1,10 +1,11 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mkinitfs
pkgver=2.0_rc5
-pkgrel=0
+pkgrel=1
pkgdesc="Tool to generate initramfs images for Alpine"
url=http://git.alpinelinux.org/cgit/mkinitfs
depends="busybox"
+triggers="$pkgname.trigger:/usr/share/kernel/*"
source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2
"
license="GPL-2"
diff --git a/main/mkinitfs/mkinitfs.trigger b/main/mkinitfs/mkinitfs.trigger
index be15f52f0..4117524c2 100644
--- a/main/mkinitfs/mkinitfs.trigger
+++ b/main/mkinitfs/mkinitfs.trigger
@@ -2,7 +2,30 @@
for i in "$@"; do
# get last element in path
- kver=${i##*/}
- mkinitfs $kver
+ flavor=${i##*/}
+ 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>
+ 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
+ ln -sf /boot/vmlinuz-$flavor /$flavor
+ ln -sf /boot/initramfs-$flavor /$flavor.gz
+
+ # Update the /boot/extlinux.conf to point to correct kernel
+ f=/boot/extlinux.conf
+ if [ -f $f ] && grep -q -- "kernel /$flavor" $f; then
+ sed -i -e "s:kernel /$flavor:kernel /boot/vmlinuz-$flavor:" \
+ -e "s:initrd=/$flavor.gz:initrd=/boot/initramfs-$flavor:" \
+ -e "s:initrd /$flavor.gz:initrd /boot/initramfs-$flavor:" \
+ $f
+ fi
done