diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2008-11-05 10:14:38 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2008-11-05 10:14:38 +0000 |
commit | e7567a4829d921c9d207eab4cd15adbea1d74279 (patch) | |
tree | 6a9c48dd0011d53c2383b004ecaca69422e8e076 /core | |
parent | ab663f9f95e1730ae4a3de22b7e6bd0984700e8b (diff) | |
download | aports-e7567a4829d921c9d207eab4cd15adbea1d74279.tar.bz2 aports-e7567a4829d921c9d207eab4cd15adbea1d74279.tar.xz |
new aport: core/alpine-baselayout
Diffstat (limited to 'core')
-rw-r--r-- | core/alpine-baselayout/APKBUILD | 61 | ||||
-rw-r--r-- | core/alpine-baselayout/install-D.patch | 11 | ||||
-rw-r--r-- | core/alpine-baselayout/modloop.initd | 54 |
3 files changed, 126 insertions, 0 deletions
diff --git a/core/alpine-baselayout/APKBUILD b/core/alpine-baselayout/APKBUILD new file mode 100644 index 0000000000..f5d0264059 --- /dev/null +++ b/core/alpine-baselayout/APKBUILD @@ -0,0 +1,61 @@ +pkgname=alpine-baselayout +pkgver=1.12 +pkgdesc="Alpine base dir structure and init scripts" +url=http://dev.alpinelinux.org/alpine/alpine-baselayout +source="http://dev.alpinelinux.org/alpine/$pkgname/$pkgname-$pkgver.tar.gz + modloop.initd + install-D.patch + " +license=GPL-2 + +build() { + cd "$srcdir/$pkgname-$pkgver" + patch -p1 < ../install-D.patch + make install PREFIX= DESTDIR="$pkgdir" || return 1 + mkdir -p \ + $pkgdir/etc/modules.d \ + $pkgdir/etc/network/if-down.d \ + $pkgdir/etc/network/if-post-down.d \ + $pkgdir/etc/network/if-pre-up.d \ + $pkgdir/etc/network/if-up.d \ + $pkgdir/etc/periodic/15min \ + $pkgdir/etc/periodic/hourly \ + $pkgdir/etc/periodic/daily \ + $pkgdir/etc/periodic/weekly \ + $pkgdir/etc/periodic/monthly \ + $pkgdir/media/cdrom \ + $pkgdir/media/floppy \ + $pkgdir/media/usb \ + $pkgdir/mnt \ + $pkgdir/proc \ + $pkgdir/sys \ + $pkgdir/dev \ + $pkgdir/home \ + $pkgdir/root \ + $pkgdir/usr/bin \ + $pkgdir/usr/sbin \ + $pkgdir/usr/local/bin \ + $pkgdir/usr/local/sbin \ + $pkgdir/var/lib/misc \ + $pkgdir/var/log \ + $pkgdir/var/run \ + $pkgdir/var/lock/subsys \ + $pkgdir/var/tmp \ + $pkgdir/tmp + + chmod 0700 "$pkgdir/root" + chmod 1777 "$pkgdir/tmp" + + ln -s /.alpine-release "$pkgdir"/etc/alpine-release + ln -s /proc/mounts $pkgdir/etc/mtab + + echo "deadline-iosched" > $pkgdir/etc/modules + echo "af_packet" >> $pkgdir/etc/modules + + cp $srcdir/modloop.initd $pkgdir/etc/init.d/modloop + +} + +md5sums="c63e002ec6693d44cc9542601dbd2698 alpine-baselayout-1.12.tar.gz +20829b8111829da1441da95cb5370ddf modloop.initd +bcb24ca480935cb11116a6512f07fa63 install-D.patch" diff --git a/core/alpine-baselayout/install-D.patch b/core/alpine-baselayout/install-D.patch new file mode 100644 index 0000000000..df9f6af5fd --- /dev/null +++ b/core/alpine-baselayout/install-D.patch @@ -0,0 +1,11 @@ +--- alpine-baselayout-1.12/init.d/Makefile.orig Wed Nov 5 10:09:38 2008 ++++ alpine-baselayout-1.12/init.d/Makefile Wed Nov 5 10:10:57 2008 +@@ -36,7 +36,7 @@ + install -m 0755 -d $(DESTDIR)/etc/init.d + + for i in $(SCRIPTS) ; do \ +- install -m 755 -D $$i $(DESTDIR)/etc/init.d/$$i ;\ ++ install -m 755 $$i $(DESTDIR)/etc/init.d/$$i ;\ + done + + clean: diff --git a/core/alpine-baselayout/modloop.initd b/core/alpine-baselayout/modloop.initd new file mode 100644 index 0000000000..3f915c1a9b --- /dev/null +++ b/core/alpine-baselayout/modloop.initd @@ -0,0 +1,54 @@ +#!/sbin/runscript + +# script that will mount image with modules + +# read kernel options +for i in `cat /proc/cmdline` ; do + case $i in + *=*) eval KOPT_$i ;; + *) eval KOPT_$i=yes ;; + esac +done + +find_media() { + ALPINE_DEV=${KOPT_alpine_dev%%:*} + ALPINE_MNT=`awk '/^\/dev\/'$ALPINE_DEV'/ { print $2 }' /etc/fstab` +} + +start() { + local rc= + local imgdir=$(dirname ${KOPT_BOOT_IMAGE:-""}) + find_media + if [ "$ALPINE_DEV" ] ; then + if [ -n "$KOPT_modloop" ]; then + CMG="$ALPINE_MNT/$KOPT_modloop" + else + CMG=$ALPINE_MNT/$imgdir/modloop.cmg + fi + ebegin "Mounting loopback device for kernel modules" + mount $ALPINE_MNT >/dev/null 2>&1 &&\ + mkdir -p /.modloop &&\ + if [ ! -f "$CMG" ] ; then + CMG=$ALPINE_MNT/$imgdir/modules.cmg + fi &&\ + mount -o loop,ro -t cramfs $CMG /.modloop + rc=$? + ln -sf /.modloop/modules /lib + ln -sf /.modloop/firmware /lib + eend $rc + else + ebegin "Skipping mount media with modules (specify with alpine_dev)" + eend 0 + fi +} + +stop() { + find_media + if [ "$ALPINE_DEV" ] ; then + ebegin "Unmounting loopback device for kernel modules" + umount -d /.modloop &&\ + umount $ALPINE_MNT 2>/dev/null + eend $? + fi +} + |