Commit 8e3040ef authored by Natanael Copa's avatar Natanael Copa

main/mkinitfs: backport support for apkovl boot option

parent 0c19a1c4
# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mkinitfs pkgname=mkinitfs
pkgver=2.4.4_git20130502 pkgver=2.4.4_git20130506
_ver=${pkgver%_git*} _ver=${pkgver%_git*}
pkgrel=0 pkgrel=0
pkgdesc="Tool to generate initramfs images for Alpine" pkgdesc="Tool to generate initramfs images for Alpine"
...@@ -46,11 +46,11 @@ package() { ...@@ -46,11 +46,11 @@ package() {
make install DESTDIR="$pkgdir" || return 1 make install DESTDIR="$pkgdir" || return 1
} }
md5sums="5b897ab38204bf62ed8abf63d6b7cafd mkinitfs-2.4.4.tar.bz2 md5sums="5b897ab38204bf62ed8abf63d6b7cafd mkinitfs-2.4.4.tar.bz2
6727bb8b3a5cc0ac415a8fb7ae871e87 git.patch b6f5ce5713d9592f942d9cb0ce3ea18b git.patch
067649665a767ff1a08578e1f4e61524 eglibc.patch" 067649665a767ff1a08578e1f4e61524 eglibc.patch"
sha256sums="454e43149322e9cdfd7ea397480621b42169b5d78dd8eab1be46b96762fc5dc5 mkinitfs-2.4.4.tar.bz2 sha256sums="454e43149322e9cdfd7ea397480621b42169b5d78dd8eab1be46b96762fc5dc5 mkinitfs-2.4.4.tar.bz2
d95bc897f7f850ba2057af5ccaf5814f5ff8d42a2932a3943d390fcfe088bd87 git.patch 6bc549d1ba8b953d5ab871147f83fe8317bfa152e7a95a51fef9d37ebd27c6e8 git.patch
2db513d1a058be0f5794dc74d00418807253d8ac850c9713ea0eeb0be5f3f65a eglibc.patch" 2db513d1a058be0f5794dc74d00418807253d8ac850c9713ea0eeb0be5f3f65a eglibc.patch"
sha512sums="9f0e49b20a592b4315155453e4398abf710c8bae62496d4b8d281e21d13366804084be26f0303d35ef3f0bf295eba76885ca43ff452d4aea1e59f0bdce0de18e mkinitfs-2.4.4.tar.bz2 sha512sums="9f0e49b20a592b4315155453e4398abf710c8bae62496d4b8d281e21d13366804084be26f0303d35ef3f0bf295eba76885ca43ff452d4aea1e59f0bdce0de18e mkinitfs-2.4.4.tar.bz2
4e07de46376df4e1a82e04e2276a389c8dfdb9ad43c58b6c3daf2b199f549996562d41cb5f39e85c2c974200acb851bfedb405e1911fbf55d89ca3ae556286c7 git.patch 6f4e9f1d1070b7b2bb1b18ae1d4eb584c178ba8bf97df63cc731509a6daafc3c41e6bb79bb194ff983e4ed3f8a4e634bd9df8c51e2cfd95f8091dd0d61e4851a git.patch
3498d9930889cd776a34863733d467b50b83679ea7f91d79963c81e4f1dc138f887ef1f2a696da6d836d1f6f862dcfd2c2fb9a55b0e3b2926e9f3fc648bc5a15 eglibc.patch" 3498d9930889cd776a34863733d467b50b83679ea7f91d79963c81e4f1dc138f887ef1f2a696da6d836d1f6f862dcfd2c2fb9a55b0e3b2926e9f3fc648bc5a15 eglibc.patch"
diff --git a/initramfs-init.in b/initramfs-init.in diff --git a/initramfs-init.in b/initramfs-init.in
index 3c05f81..5d07157 100755 index 3c05f81..0050787 100755
--- a/initramfs-init.in --- a/initramfs-init.in
+++ b/initramfs-init.in +++ b/initramfs-init.in
@@ -191,7 +191,7 @@ setup_inittab_console(){ @@ -52,6 +52,11 @@ find_ovl() {
local ovl
local lines
+ if [ -n "$APKOVL" ]; then
+ [ -f "$mnt/$APKOVL" ] && echo "$mnt/$APKOVL"
+ return
+ fi
+
# look for apkovl's on mounted media
ovl=$( ls -1 "$mnt"/*.apkovl.tar.gz* 2>/dev/null ) || return 1
lines=$(echo "$ovl" | wc -l)
@@ -191,7 +196,7 @@ setup_inittab_console(){
esac esac
shift shift
...@@ -11,7 +23,7 @@ index 3c05f81..5d07157 100755 ...@@ -11,7 +23,7 @@ index 3c05f81..5d07157 100755
[ "$tty" = "tty0" ] && continue [ "$tty" = "tty0" ] && continue
# do nothing if inittab already have the tty set up # do nothing if inittab already have the tty set up
@@ -240,6 +240,81 @@ start_lvm() { @@ -240,6 +245,81 @@ start_lvm() {
lvm vgchange --ignorelockingfailure -a y >/dev/null 2>&1 lvm vgchange --ignorelockingfailure -a y >/dev/null 2>&1
} }
...@@ -93,7 +105,7 @@ index 3c05f81..5d07157 100755 ...@@ -93,7 +105,7 @@ index 3c05f81..5d07157 100755
# resolve an uuid or symlink to the real device # resolve an uuid or symlink to the real device
resolve_dev() { resolve_dev() {
case "$1" in case "$1" in
@@ -275,8 +350,12 @@ find_fs_type() { @@ -275,8 +355,12 @@ find_fs_type() {
# find the dirs under ALPINE_MNT that are boot repositories # find the dirs under ALPINE_MNT that are boot repositories
find_boot_repositories() { find_boot_repositories() {
...@@ -108,7 +120,7 @@ index 3c05f81..5d07157 100755 ...@@ -108,7 +120,7 @@ index 3c05f81..5d07157 100755
} }
# gotta start from somewhere :) # gotta start from somewhere :)
@@ -286,8 +365,9 @@ echo "Alpine Init $VERSION" @@ -286,8 +370,9 @@ echo "Alpine Init $VERSION"
# acpi_osi="!Windows 2006" # acpi_osi="!Windows 2006"
eval set -- `cat /proc/cmdline` eval set -- `cat /proc/cmdline`
...@@ -120,7 +132,7 @@ index 3c05f81..5d07157 100755 ...@@ -120,7 +132,7 @@ index 3c05f81..5d07157 100755
for opt; do for opt; do
case "$opt" in case "$opt" in
@@ -340,6 +420,8 @@ ALPINE_DEV_FS=${KOPT_alpine_dev##*:} @@ -340,6 +425,8 @@ ALPINE_DEV_FS=${KOPT_alpine_dev##*:}
if [ "$ALPINE_DEV_FS" = "$ALPINE_DEV" ]; then if [ "$ALPINE_DEV_FS" = "$ALPINE_DEV" ]; then
unset ALPINE_DEV_FS unset ALPINE_DEV_FS
fi fi
...@@ -129,7 +141,7 @@ index 3c05f81..5d07157 100755 ...@@ -129,7 +141,7 @@ index 3c05f81..5d07157 100755
if [ -n "$KOPT_ovl_dev" ] ; then if [ -n "$KOPT_ovl_dev" ] ; then
OVL_DEV=${KOPT_ovl_dev%%:*} OVL_DEV=${KOPT_ovl_dev%%:*}
OVL_DEV_FS=${KOPT_ovl_dev##*:} OVL_DEV_FS=${KOPT_ovl_dev##*:}
@@ -348,13 +430,31 @@ if [ -n "$KOPT_ovl_dev" ] ; then @@ -348,13 +435,44 @@ if [ -n "$KOPT_ovl_dev" ] ; then
fi fi
fi fi
...@@ -137,6 +149,19 @@ index 3c05f81..5d07157 100755 ...@@ -137,6 +149,19 @@ index 3c05f81..5d07157 100755
+case "$KOPT_apkovl" in +case "$KOPT_apkovl" in
+ http://*|https://|ftp://*) + http://*|https://|ftp://*)
+ OVL_DEV="$KOPT_apkovl";; + OVL_DEV="$KOPT_apkovl";;
+ *:*:*) # apkovl=sda1:ext4:/subdir/host.apkovl.tar.gz
+ OVL_DEV="${KOPT_apkovl%%:*}"
+ OVL_DEV_FS="${KOPT_apkovl%:*}"
+ OVL_DEV_FS="${OVL_DEV_FS#*:}"
+ APKOVL="${KOPT_apkovl##*:}"
+ ;;
+ *:*) # apkovl=sda1:/subdir/host.apkovl.tar.gz
+ OVL_DEV=${KOPT_apkovl%%:*}
+ APKOVL=${KOPT_apkovl##*:}
+ ;;
+ *) # apkovl=subdir/host.apkovl.tar.gz
+ APKOVL="${KOPT_apkovl}"
+ ;;
+esac +esac
+ +
case "$ALPINE_DEV" in case "$ALPINE_DEV" in
...@@ -161,7 +186,7 @@ index 3c05f81..5d07157 100755 ...@@ -161,7 +186,7 @@ index 3c05f81..5d07157 100755
[ -z "$ALPINE_MNT" ] && ALPINE_MNT=/media/${ALPINE_DEV##*/} [ -z "$ALPINE_MNT" ] && ALPINE_MNT=/media/${ALPINE_DEV##*/}
# hide kernel messages # hide kernel messages
@@ -428,6 +528,9 @@ if [ -z "${ALPINE_DEV##*usb*}" ]; then @@ -428,6 +546,9 @@ if [ -z "${ALPINE_DEV##*usb*}" ]; then
wait_usb wait_usb
fi fi
...@@ -171,7 +196,7 @@ index 3c05f81..5d07157 100755 ...@@ -171,7 +196,7 @@ index 3c05f81..5d07157 100755
# incase we have alpine_dev on raid device... # incase we have alpine_dev on raid device...
start_raid start_raid
start_cryptsetup start_cryptsetup
@@ -444,6 +547,7 @@ fi @@ -444,6 +565,7 @@ fi
if [ -n "$ALPINE_DEV_FS" ]; then if [ -n "$ALPINE_DEV_FS" ]; then
mount_opts="-t $ALPINE_DEV_FS" mount_opts="-t $ALPINE_DEV_FS"
...@@ -179,7 +204,7 @@ index 3c05f81..5d07157 100755 ...@@ -179,7 +204,7 @@ index 3c05f81..5d07157 100755
fi fi
retry_mount -o ro $mount_opts $ALPINE_DEV $ALPINE_MNT >/dev/null 2>&1 retry_mount -o ro $mount_opts $ALPINE_DEV $ALPINE_MNT >/dev/null 2>&1
@@ -462,19 +566,27 @@ if [ -n "$KOPT_root_size" ]; then @@ -462,19 +584,27 @@ if [ -n "$KOPT_root_size" ]; then
fi fi
mount -t tmpfs $root_opts tmpfs $sysroot mount -t tmpfs $root_opts tmpfs $sysroot
...@@ -220,7 +245,7 @@ index 3c05f81..5d07157 100755 ...@@ -220,7 +245,7 @@ index 3c05f81..5d07157 100755
if ! [ -f "$ovl" ]; then if ! [ -f "$ovl" ]; then
ovl=$(find_ovl $ALPINE_MNT) ovl=$(find_ovl $ALPINE_MNT)
fi fi
@@ -508,7 +620,8 @@ if [ -f "$ovl" ]; then @@ -508,7 +638,8 @@ if [ -f "$ovl" ]; then
-e 's|:/etc/init.d/rcK|:/sbin/rc shutdown|' \ -e 's|:/etc/init.d/rcK|:/sbin/rc shutdown|' \
"$sysroot"/etc/inittab "$sysroot"/etc/inittab
fi fi
...@@ -230,7 +255,7 @@ index 3c05f81..5d07157 100755 ...@@ -230,7 +255,7 @@ index 3c05f81..5d07157 100755
# add some boot services by default # add some boot services by default
rc_add devfs sysinit rc_add devfs sysinit
rc_add dmesg sysinit rc_add dmesg sysinit
@@ -524,6 +637,8 @@ else @@ -524,6 +655,8 @@ else
rc_add mount-ro shutdown rc_add mount-ro shutdown
rc_add killprocs shutdown rc_add killprocs shutdown
rc_add savecache shutdown rc_add savecache shutdown
...@@ -239,7 +264,7 @@ index 3c05f81..5d07157 100755 ...@@ -239,7 +264,7 @@ index 3c05f81..5d07157 100755
fi fi
if [ -f $sysroot/etc/fstab ]; then if [ -f $sysroot/etc/fstab ]; then
@@ -569,7 +684,14 @@ ebegin "Installing packages to root filesystem" @@ -569,7 +702,14 @@ ebegin "Installing packages to root filesystem"
if [ "$KOPT_chart" = yes ]; then if [ "$KOPT_chart" = yes ]; then
pkgs="$pkgs acct" pkgs="$pkgs acct"
fi fi
...@@ -255,7 +280,7 @@ index 3c05f81..5d07157 100755 ...@@ -255,7 +280,7 @@ index 3c05f81..5d07157 100755
if [ -n "$KOPT_quiet" ]; then if [ -n "$KOPT_quiet" ]; then
apkflags="$apkflags --quiet" apkflags="$apkflags --quiet"
fi fi
@@ -580,7 +702,7 @@ if [ "$KOPT_keep_apk_new" != yes ]; then @@ -580,7 +720,7 @@ if [ "$KOPT_keep_apk_new" != yes ]; then
fi fi
if [ -n "$ovlfiles" ]; then if [ -n "$ovlfiles" ]; then
...@@ -264,7 +289,7 @@ index 3c05f81..5d07157 100755 ...@@ -264,7 +289,7 @@ index 3c05f81..5d07157 100755
else else
apk add --root $sysroot $repo_opt $apkflags $pkgs >/dev/null apk add --root $sysroot $repo_opt $apkflags $pkgs >/dev/null
fi fi
@@ -613,11 +735,14 @@ fi @@ -613,11 +753,14 @@ fi
setup_inittab_console $CONSOLE setup_inittab_console $CONSOLE
# copy alpine release info # copy alpine release info
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment