1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 19:19:46 +01:00
build/pkg/init/build

109 lines
2.7 KiB
Text
Raw Normal View History

VERSION="0.5"
SRCDIR="init-${VERSION}"
TARBALL="${SRCDIR}.tar.xz"
URL="http://infraroot.at/pygos"
SHA256SUM="ea964c7ef150c14987bce0eff10b80a5e071b0ac451fe2e3d9e12915d5a2f987"
DEPENDS="toolchain"
prepare() {
return
}
build() {
local SOURCE="$1"
local DEPLOY="$2"
$SOURCE/configure --prefix="" --host="$TARGET" --sbindir=/bin \
--libexecdir=/lib/libexec
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"
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"
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"
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 "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
}