1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-25 04:20:41 +01:00
build/pkg/init/build
David Oberhollenzer bbac1391dc Bump init version
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-21 22:11:58 +02:00

118 lines
3.1 KiB
Text
Executable file

VERSION="0.7"
SRCDIR="init-${VERSION}"
TARBALL="${SRCDIR}.tar.xz"
URL="http://infraroot.at/pygos"
SHA256SUM="68759e2096dbf20e795e8c16c5e8b55ec6935c1020b12896a22abf6325b14370"
DEPENDS="toolchain"
prepare() {
return
}
build() {
run_configure "$1"
make -j $NUMJOBS
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
local svc
make DESTDIR="$DEPLOY" install
cp -r ${SCRIPTDIR}/pkg/${PKGNAME}/{etc,lib,share} "$DEPLOY"
cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "$DEPLOY"
include_merge "INIT"
if [ "x$HWCLOCK" == "xyes" ]; then
SERVICES="$SERVICES hwclock"
else
SERVICES="$SERVICES swclock"
ln -s "/share/init/swclocksave" "$DEPLOY/etc/init.d/swclocksave@shutdown"
ln -s "/share/init/swclocksave" "$DEPLOY/etc/init.d/swclocksave@reboot"
ln -s "/share/init/swclocksave.gcron" "$DEPLOY/etc/gcron.d/swclocksave"
echo "etc/init.d/swclocksave@shutdown m 777 0 0" >> "$DEPLOY/rootfs_files.txt"
echo "etc/init.d/swclocksave@reboot m 777 0 0" >> "$DEPLOY/rootfs_files.txt"
echo "etc/gcron.d/swclocksave m 777 0 0" >> "$DEPLOY/rootfs_files.txt"
mkdir -p "$DEPLOY/var/lib"
date --utc +%m%d%H%M%Y.%S > "$DEPLOY/var/lib/swclock"
echo "var/lib/swclock m 644 0 0" >> "$DEPLOY/rootfs_files.txt"
if [ -z "$DHCP_PORTS" ]; then
ln -s "/share/init/ntpsetdate.gcron" "$DEPLOY/etc/gcron.d/ntpsetdate"
echo "etc/gcron.d/ntpsetdate m 777 0 0" >> "$DEPLOY/rootfs_files.txt"
else
echo "lib/libexec/dhcpcd-hooks/40-ntpsetdate m 555 0 0" >> "$DEPLOY/rootfs_files.txt"
fi
fi
svc=$(file_path_override "ifrename")
if [ ! -z "$svc" ]; then
cp "$svc" "$DEPLOY/etc/netcfg/ifrename"
echo "etc/netcfg/ifrename m 644 0 0" >> "$DEPLOY/rootfs_files.txt"
SERVICES="$SERVICES ifrename"
fi
svc=$(file_path_override "nftables.rules")
if [ ! -z "$svc" ]; then
cp "$svc" "$DEPLOY/etc/nftables.rules"
echo "etc/nftables.rules m 644 0 0" >> "$DEPLOY/rootfs_files.txt"
SERVICES="$SERVICES nft"
fi
svc=$(file_path_override "sysctl.conf")
if [ ! -z "$svc" ]; then
cp "$svc" "$DEPLOY/etc/sysctl.conf"
echo "etc/sysctl.conf m 644 0 0" >> "$DEPLOY/rootfs_files.txt"
fi
svc=$(file_path_override "interfaces")
if [ ! -z "$svc" ]; then
echo "etc/init.d/ifcfg m 777 0 0" >> "$DEPLOY/rootfs_files.txt"
for svc in $svc/*; do
[ -f "$svc" ] || continue
cp "$svc" "$DEPLOY/etc/netcfg/"
svc=$(basename $svc)
echo "etc/netcfg/$svc m 644 0 0" >> \
"$DEPLOY/rootfs_files.txt"
done
fi
for svc in $GETTY_TTY; do
ln -s "/share/init/agetty" "$DEPLOY/etc/init.d/agetty@$svc"
echo "etc/init.d/agetty@$svc m 777 0 0" >> \
"$DEPLOY/rootfs_files.txt"
done
if [ ! -z "$DHCP_PORTS" ]; then
SERVICES="$SERVICES dhcpcdmaster"
fi
for svc in $DHCP_PORTS; do
ln -s "/share/init/dhcpcd" "$DEPLOY/etc/init.d/dhcpcd@$svc"
echo "etc/init.d/dhcpcd@$svc m 777 0 0" >> \
"$DEPLOY/rootfs_files.txt"
done
for svc in $SERVICES; do
ln -s "/share/init/$svc" "$DEPLOY/etc/init.d/$svc"
echo "etc/init.d/$svc m 777 0 0" >> "$DEPLOY/rootfs_files.txt"
done
touch "$DEPLOY/etc/modules"
for svc in $MODULES; do
echo "$svc" >> "$DEPLOY/etc/modules"
done
unset -v i GETTY_TTY HWCLOCK DHCP_PORTS SERVICES MODULES
}
check_update() {
return
}