1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-05-18 03:26:14 +02:00
build/pkg/init/build
David Oberhollenzer f5a62aef6a Replace OpenRC with custom init system
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-03-24 18:28:29 +01:00

47 lines
915 B
Plaintext
Executable file

VERSION="0.1"
SRCDIR="init-${VERSION}"
TARBALL="${SRCDIR}.tar.gz"
URL="http://infraroot.at/pygos"
SHA256SUM="56fb57c7cc1b869642028497f81ea20f42d17821cd60af3d3b6a58170123f750"
DEPENDS="toolchain"
prepare() {
return
}
build() {
local SOURCE="$1"
local DEPLOY="$2"
$SOURCE/configure --prefix="" --host="$TARGET" --sbindir=/bin
make -j $NUMJOBS
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
local svc
make DESTDIR="$DEPLOY" install-strip
mkdir -p "$DEPLOY/etc/init.d"
if [ -e "$SCRIPTDIR/board/$BOARD/INIT" ]; then
source "$SCRIPTDIR/board/$BOARD/INIT"
fi
if [ -e "$SCRIPTDIR/product/$PRODUCT/INIT" ]; then
source "$SCRIPTDIR/product/$PRODUCT/INIT"
fi
for svc in hostname loopback sysctl hwclock sysinit; do
ln -s "/share/init/$svc" "$DEPLOY/etc/init.d/$svc"
done
for svc in $GETTY_TTY; do
ln -s "/share/init/agetty" "$DEPLOY/etc/init.d/agetty@$svc"
done
unset -v i GETTY_TTY
}