summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-08-06 11:17:53 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-08-06 11:17:53 +0000
commit2251f300c3c86a3ef7256ed088ad4c4b1dd388e1 (patch)
treeec596f004da878f2e3012f91abf93a0d1c6943a4
parentf4a76bb2a0c049aba21dace77c561bf7403a18ac (diff)
downloadaports-2251f300c3c86a3ef7256ed088ad4c4b1dd388e1.tar.bz2
aports-2251f300c3c86a3ef7256ed088ad4c4b1dd388e1.tar.xz
main/mkinitfs: backport fixes for new apk-tools behaviour
-rw-r--r--main/mkinitfs/0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch52
-rw-r--r--main/mkinitfs/0002-init-fixes-for-new-apk-behaviour.patch65
-rw-r--r--main/mkinitfs/APKBUILD14
3 files changed, 128 insertions, 3 deletions
diff --git a/main/mkinitfs/0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch b/main/mkinitfs/0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch
new file mode 100644
index 00000000..5b27ef09
--- /dev/null
+++ b/main/mkinitfs/0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch
@@ -0,0 +1,52 @@
+From 745fe99e8be2f889ff79a544dd6a314b69437258 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 6 Aug 2009 09:24:24 +0000
+Subject: [PATCH 1/2] mkinitfs: support for -q. echo to stdout rather than stderr
+
+---
+ mkinitfs.in | 8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/mkinitfs.in b/mkinitfs.in
+index 5b7bfbd..c0746fe 100755
+--- a/mkinitfs.in
++++ b/mkinitfs.in
+@@ -152,6 +152,7 @@ options:
+ -l only list files that would have been used
+ -L list available features
+ -o set another outfile
++ -q Quiet mode
+ -t use tempdir when creating initramfs image
+
+ EOF
+@@ -161,7 +162,7 @@ EOF
+ # main
+
+
+-while getopts "b:c:f:F:hi:kLlo:t:" opt; do
++while getopts "b:c:f:F:hi:kLlo:qt:" opt; do
+ case "$opt" in
+ b) basedir="$OPTARG";;
+ c) config="$OPTARG";;
+@@ -173,6 +174,7 @@ while getopts "b:c:f:F:hi:kLlo:t:" opt; do
+ L) list_features=1;;
+ l) list_sources=1;;
+ o) outfile="$OPTARG";;
++ q) quiet=1;;
+ t) tmpdir="$OPTARG";;
+ *) usage;;
+ esac
+@@ -218,8 +220,8 @@ if [ -z "$keeptmp" ]; then
+ [ -d "$tmpdir" ] && rm -rf "$tmpdir"/*
+ fi
+
+-if [ -z "$list_sources" ]; then
+- echo "==> initramfs: creating $outfile" >&2
++if [ -z "$list_sources" ] && [ -z "$quiet" ]; then
++ echo "==> initramfs: creating $outfile"
+ fi
+ initfs_base || exit 1
+ initfs_kmods || exit 1
+--
+1.6.4
+
diff --git a/main/mkinitfs/0002-init-fixes-for-new-apk-behaviour.patch b/main/mkinitfs/0002-init-fixes-for-new-apk-behaviour.patch
new file mode 100644
index 00000000..422bcd93
--- /dev/null
+++ b/main/mkinitfs/0002-init-fixes-for-new-apk-behaviour.patch
@@ -0,0 +1,65 @@
+From a012d00b55499a918f32a0ca8bd4ae2421178dfd Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 6 Aug 2009 10:52:23 +0000
+Subject: [PATCH 2/2] init: fixes for new apk behaviour
+
+---
+ initramfs-init.in | 28 ++++++++++++++++------------
+ 1 files changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/initramfs-init.in b/initramfs-init.in
+index 0b295f8..0ea081c 100755
+--- a/initramfs-init.in
++++ b/initramfs-init.in
+@@ -6,7 +6,7 @@ SINGLEMODE=no
+ sysroot=/sysroot
+
+ /bin/busybox mkdir -p /usr/bin /usr/sbin /proc /sys /dev $sysroot \
+- /media/cdrom /media/floppy /media/usb
++ /media/cdrom /media/floppy /media/usb /tmp
+ /bin/busybox --install -s
+
+ # basic environment
+@@ -313,10 +313,6 @@ else
+ rc_add savecache shutdown
+ fi
+
+-# copy the apk keys to sysroot
+-mkdir -p "$sysroot"/etc/apk/keys
+-cp -r /etc/apk/keys/* "$sysroot"/etc/apk/keys/ 2>/dev/null
+-
+ # let user override tmpfs size in fstab in apkovl
+ if [ -f $sysroot/etc/fstab ]; then
+ mountopts=$(awk '$2 == "/" && $3 == "tmpfs" { print $4 }' $sysroot/etc/fstab)
+@@ -342,13 +338,21 @@ if [ -n "$new_mnt" ] && [ "$new_mnt" != "$ALPINE_MNT" ]; then
+ ALPINE_MNT="$new_mnt"
+ fi
+
+-# generate apk repositories file
+-mkdir -p /etc/apk
+-repo_opt=
+-for i in $(find $ALPINE_MNT -name 'APK*.gz' -type f -maxdepth 3 \
+- | sed 's:/APK.*\.gz$::'); do
+- repo_opt="$repo_opt --repo $i"
+-done
++# copy keys so apk finds them. apk looks for stuff relative --root
++mkdir -p $sysroot/etc/apk/keys/
++cp -a /etc/apk/keys $sysroot/etc/apk
++
++# generate apk repositories file and --repo opt
++echo "$(find $ALPINE_MNT -name .boot_repository -type f -maxdepth 3 \
++ | sed 's:/.boot_repository$::')" > /tmp/repositories
++
++if [ ! -f $sysroot/etc/apk/repositories ]; then
++ mv /tmp/repositories $sysroot/etc/apk/
++else
++ for i in $(cat /tmp/repositories); do
++ repo_opt="$repo_opt --repo $i"
++ done
++fi
+
+ # install new root
+ ebegin "Installing packages to root filesystem"
+--
+1.6.4
+
diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD
index 8f13f65f..bfc93e3a 100644
--- a/main/mkinitfs/APKBUILD
+++ b/main/mkinitfs/APKBUILD
@@ -1,16 +1,24 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mkinitfs
pkgver=2.0_rc1
-pkgrel=0
+pkgrel=1
pkgdesc="Tool to generate initramfs images for Alpine"
url=http://git.alpinelinux.org/cgit/mkinitfs
depends="busybox"
-source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2"
+source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2
+ 0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch
+ 0002-init-fixes-for-new-apk-behaviour.patch
+ "
license="GPL-2"
build() {
cd "$srcdir"/$pkgname-$pkgver
+ patch -p1 -i ../0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch || return 1
+ patch -p1 -i ../0002-init-fixes-for-new-apk-behaviour.patch || return 1
+
make
make install DESTDIR="$pkgdir" || return 1
}
-md5sums="4c8ae5a6cdeae50ddb36a8e3d3268eb2 mkinitfs-2.0_rc1.tar.bz2"
+md5sums="4c8ae5a6cdeae50ddb36a8e3d3268eb2 mkinitfs-2.0_rc1.tar.bz2
+ccbd60017cd2498f7e14e4b661efffb7 0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch
+eb588902edfef79a8912b5c81dfd6f1e 0002-init-fixes-for-new-apk-behaviour.patch"