aboutsummaryrefslogtreecommitdiff
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)
downloadalpine_aports-2251f300c3c86a3ef7256ed088ad4c4b1dd388e1.tar.bz2
alpine_aports-2251f300c3c86a3ef7256ed088ad4c4b1dd388e1.tar.xz
alpine_aports-2251f300c3c86a3ef7256ed088ad4c4b1dd388e1.zip
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 0000000000..5b27ef09b5
--- /dev/null
+++ b/main/mkinitfs/0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch
@@ -0,0 +1,52 @@
1From 745fe99e8be2f889ff79a544dd6a314b69437258 Mon Sep 17 00:00:00 2001
2From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Thu, 6 Aug 2009 09:24:24 +0000
4Subject: [PATCH 1/2] mkinitfs: support for -q. echo to stdout rather than stderr
5
6---
7 mkinitfs.in | 8 +++++---
8 1 files changed, 5 insertions(+), 3 deletions(-)
9
10diff --git a/mkinitfs.in b/mkinitfs.in
11index 5b7bfbd..c0746fe 100755
12--- a/mkinitfs.in
13+++ b/mkinitfs.in
14@@ -152,6 +152,7 @@ options:
15 -l only list files that would have been used
16 -L list available features
17 -o set another outfile
18+ -q Quiet mode
19 -t use tempdir when creating initramfs image
20
21 EOF
22@@ -161,7 +162,7 @@ EOF
23 # main
24
25
26-while getopts "b:c:f:F:hi:kLlo:t:" opt; do
27+while getopts "b:c:f:F:hi:kLlo:qt:" opt; do
28 case "$opt" in
29 b) basedir="$OPTARG";;
30 c) config="$OPTARG";;
31@@ -173,6 +174,7 @@ while getopts "b:c:f:F:hi:kLlo:t:" opt; do
32 L) list_features=1;;
33 l) list_sources=1;;
34 o) outfile="$OPTARG";;
35+ q) quiet=1;;
36 t) tmpdir="$OPTARG";;
37 *) usage;;
38 esac
39@@ -218,8 +220,8 @@ if [ -z "$keeptmp" ]; then
40 [ -d "$tmpdir" ] && rm -rf "$tmpdir"/*
41 fi
42
43-if [ -z "$list_sources" ]; then
44- echo "==> initramfs: creating $outfile" >&2
45+if [ -z "$list_sources" ] && [ -z "$quiet" ]; then
46+ echo "==> initramfs: creating $outfile"
47 fi
48 initfs_base || exit 1
49 initfs_kmods || exit 1
50--
511.6.4
52
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 0000000000..422bcd9320
--- /dev/null
+++ b/main/mkinitfs/0002-init-fixes-for-new-apk-behaviour.patch
@@ -0,0 +1,65 @@
1From a012d00b55499a918f32a0ca8bd4ae2421178dfd Mon Sep 17 00:00:00 2001
2From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Thu, 6 Aug 2009 10:52:23 +0000
4Subject: [PATCH 2/2] init: fixes for new apk behaviour
5
6---
7 initramfs-init.in | 28 ++++++++++++++++------------
8 1 files changed, 16 insertions(+), 12 deletions(-)
9
10diff --git a/initramfs-init.in b/initramfs-init.in
11index 0b295f8..0ea081c 100755
12--- a/initramfs-init.in
13+++ b/initramfs-init.in
14@@ -6,7 +6,7 @@ SINGLEMODE=no
15 sysroot=/sysroot
16
17 /bin/busybox mkdir -p /usr/bin /usr/sbin /proc /sys /dev $sysroot \
18- /media/cdrom /media/floppy /media/usb
19+ /media/cdrom /media/floppy /media/usb /tmp
20 /bin/busybox --install -s
21
22 # basic environment
23@@ -313,10 +313,6 @@ else
24 rc_add savecache shutdown
25 fi
26
27-# copy the apk keys to sysroot
28-mkdir -p "$sysroot"/etc/apk/keys
29-cp -r /etc/apk/keys/* "$sysroot"/etc/apk/keys/ 2>/dev/null
30-
31 # let user override tmpfs size in fstab in apkovl
32 if [ -f $sysroot/etc/fstab ]; then
33 mountopts=$(awk '$2 == "/" && $3 == "tmpfs" { print $4 }' $sysroot/etc/fstab)
34@@ -342,13 +338,21 @@ if [ -n "$new_mnt" ] && [ "$new_mnt" != "$ALPINE_MNT" ]; then
35 ALPINE_MNT="$new_mnt"
36 fi
37
38-# generate apk repositories file
39-mkdir -p /etc/apk
40-repo_opt=
41-for i in $(find $ALPINE_MNT -name 'APK*.gz' -type f -maxdepth 3 \
42- | sed 's:/APK.*\.gz$::'); do
43- repo_opt="$repo_opt --repo $i"
44-done
45+# copy keys so apk finds them. apk looks for stuff relative --root
46+mkdir -p $sysroot/etc/apk/keys/
47+cp -a /etc/apk/keys $sysroot/etc/apk
48+
49+# generate apk repositories file and --repo opt
50+echo "$(find $ALPINE_MNT -name .boot_repository -type f -maxdepth 3 \
51+ | sed 's:/.boot_repository$::')" > /tmp/repositories
52+
53+if [ ! -f $sysroot/etc/apk/repositories ]; then
54+ mv /tmp/repositories $sysroot/etc/apk/
55+else
56+ for i in $(cat /tmp/repositories); do
57+ repo_opt="$repo_opt --repo $i"
58+ done
59+fi
60
61 # install new root
62 ebegin "Installing packages to root filesystem"
63--
641.6.4
65
diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD
index 8f13f65f9f..bfc93e3ae6 100644
--- a/main/mkinitfs/APKBUILD
+++ b/main/mkinitfs/APKBUILD
@@ -1,16 +1,24 @@
1# Maintainer: Natanael Copa <ncopa@alpinelinux.org> 1# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
2pkgname=mkinitfs 2pkgname=mkinitfs
3pkgver=2.0_rc1 3pkgver=2.0_rc1
4pkgrel=0 4pkgrel=1
5pkgdesc="Tool to generate initramfs images for Alpine" 5pkgdesc="Tool to generate initramfs images for Alpine"
6url=http://git.alpinelinux.org/cgit/mkinitfs 6url=http://git.alpinelinux.org/cgit/mkinitfs
7depends="busybox" 7depends="busybox"
8source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2" 8source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2
9 0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch
10 0002-init-fixes-for-new-apk-behaviour.patch
11 "
9license="GPL-2" 12license="GPL-2"
10 13
11build() { 14build() {
12 cd "$srcdir"/$pkgname-$pkgver 15 cd "$srcdir"/$pkgname-$pkgver
16 patch -p1 -i ../0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch || return 1
17 patch -p1 -i ../0002-init-fixes-for-new-apk-behaviour.patch || return 1
18
13 make 19 make
14 make install DESTDIR="$pkgdir" || return 1 20 make install DESTDIR="$pkgdir" || return 1
15} 21}
16md5sums="4c8ae5a6cdeae50ddb36a8e3d3268eb2 mkinitfs-2.0_rc1.tar.bz2" 22md5sums="4c8ae5a6cdeae50ddb36a8e3d3268eb2 mkinitfs-2.0_rc1.tar.bz2
23ccbd60017cd2498f7e14e4b661efffb7 0001-mkinitfs-support-for-q.-echo-to-stdout-rather-than-s.patch
24eb588902edfef79a8912b5c81dfd6f1e 0002-init-fixes-for-new-apk-behaviour.patch"