aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2014-09-23 12:04:45 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2014-09-23 12:04:52 +0200
commitb472ed2f2d767a10c3905065255929a372dc290e (patch)
treec5819fa90df2f9644b10d6926f6c41c3fec05b46 /main
parent0b19b03759f2c64c551abeb5acee079587df4cf5 (diff)
downloadaports-b472ed2f2d767a10c3905065255929a372dc290e.tar.bz2
aports-b472ed2f2d767a10c3905065255929a372dc290e.tar.xz
main/openrc: add netboot support for modloop
Diffstat (limited to 'main')
-rw-r--r--main/openrc/APKBUILD2
-rw-r--r--main/openrc/modloop.initd43
2 files changed, 28 insertions, 17 deletions
diff --git a/main/openrc/APKBUILD b/main/openrc/APKBUILD
index d4134e46eb..0fb66019c9 100644
--- a/main/openrc/APKBUILD
+++ b/main/openrc/APKBUILD
@@ -2,7 +2,7 @@
pkgname=openrc
pkgver=0.12.4
_ver=${pkgver/_git*/}
-pkgrel=2
+pkgrel=3
pkgdesc="OpenRC manages the services, startup and shutdown of a host"
url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git"
arch="all"
diff --git a/main/openrc/modloop.initd b/main/openrc/modloop.initd
index 11e8089700..ec52697446 100644
--- a/main/openrc/modloop.initd
+++ b/main/openrc/modloop.initd
@@ -73,29 +73,40 @@ find_media() {
}
start() {
- local modloop= mount_opts= modloop_mounted=
+ local modloop= mount_opts= modloop_mounted= modloop_dldir="/lib"
+
find_media
- if [ -z "$alpine_dev" ] ; then
- return 0
- fi
- if [ -z "$alpine_mounted" ]; then
- ebegin "Mounting $alpine_mnt"
- [ -n "$alpine_fs" ] && mount_opts="-t $alpine_fs"
- mount $mount_opts /dev/$alpine_dev $alpine_mnt 2>/dev/null
- eend $? || return 1
- fi
- mkdir -p /.modloop /lib
+ case "$KOPT_modloop" in
+ http://*|https://|ftp://*)
+ wget -P "$modloop_dldir" "$KOPT_modloop" \
+ && modloop=$modloop_dldir/$(basename $KOPT_modloop)
+ ;;
+ *)
+ if [ -z "$alpine_dev" ] ; then
+ return 0
+ fi
+ if [ -z "$alpine_mounted" ]; then
+ ebegin "Mounting $alpine_mnt"
+ [ -n "$alpine_fs" ] && mount_opts="-t $alpine_fs"
+ mount $mount_opts /dev/$alpine_dev $alpine_mnt 2>/dev/null
+ eend $? || return 1
+ fi
+ for modloop in ${alpine_mnt}$KOPT_modloop \
+ ${alpine_mnt}$KOPT_BOOT_IMAGE.modloop.* \
+ ${alpine_mnt}$KOPT_BOOT_IMAGE.cmg; do
+ [ -f "$modloop" ] || continue
+ done
+ ;;
+ esac
- for modloop in ${alpine_mnt}$KOPT_modloop \
- ${alpine_mnt}$KOPT_BOOT_IMAGE.modloop.* \
- ${alpine_mnt}$KOPT_BOOT_IMAGE.cmg; do
- [ -f "$modloop" ] || continue
+ if [ -f "$modloop" ]; then
ebegin "Mounting modloop $modloop"
+ mkdir -p /.modloop /lib
mount -o loop,ro $fs_opt $modloop /.modloop \
&& modloop_mounted=1
eend $? || return 1
- done
+ fi
[ "$modloop_mounted" = "1" ] || return 1
#use unionfs is available and configured