Commit e7567a48 authored by Natanael Copa's avatar Natanael Copa
Browse files

new aport: core/alpine-baselayout

parent ab663f9f
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"
--- 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:
#!/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
}
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