2018-07-20 17:43:39 +02:00
|
|
|
VERSION="0.5"
|
2018-03-04 16:35:28 +01:00
|
|
|
SRCDIR="init-${VERSION}"
|
2018-04-05 00:16:32 +02:00
|
|
|
TARBALL="${SRCDIR}.tar.xz"
|
2018-03-04 16:35:28 +01:00
|
|
|
URL="http://infraroot.at/pygos"
|
2018-07-20 17:43:39 +02:00
|
|
|
SHA256SUM="ea964c7ef150c14987bce0eff10b80a5e071b0ac451fe2e3d9e12915d5a2f987"
|
2018-03-04 16:35:28 +01:00
|
|
|
DEPENDS="toolchain"
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
local SOURCE="$1"
|
|
|
|
local DEPLOY="$2"
|
|
|
|
|
2018-04-06 01:03:29 +02:00
|
|
|
$SOURCE/configure --prefix="" --host="$TARGET" --sbindir=/bin \
|
|
|
|
--libexecdir=/lib/libexec
|
2018-03-04 16:35:28 +01:00
|
|
|
|
|
|
|
make -j $NUMJOBS
|
|
|
|
}
|
|
|
|
|
|
|
|
deploy() {
|
|
|
|
local SOURCE="$1"
|
|
|
|
local DEPLOY="$2"
|
|
|
|
local svc
|
|
|
|
|
2018-06-17 16:08:11 +02:00
|
|
|
make DESTDIR="$DEPLOY" install
|
2018-03-04 16:35:28 +01:00
|
|
|
|
2018-04-21 19:39:48 +02:00
|
|
|
cp -r ${SCRIPTDIR}/pkg/${PKGNAME}/{etc,lib,share} "$DEPLOY"
|
2018-06-16 17:46:17 +02:00
|
|
|
cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "$DEPLOY"
|
2018-03-04 16:35:28 +01:00
|
|
|
|
2018-05-10 14:41:13 +02:00
|
|
|
include_merge "INIT"
|
2018-03-04 16:35:28 +01:00
|
|
|
|
2018-04-05 00:16:32 +02:00
|
|
|
if [ "x$HWCLOCK" == "xyes" ]; then
|
2018-07-20 17:43:39 +02:00
|
|
|
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"
|
2018-04-05 00:16:32 +02:00
|
|
|
fi
|
2018-03-04 16:35:28 +01:00
|
|
|
|
2018-04-27 10:53:45 +02:00
|
|
|
svc=$(file_path_override "ifrename")
|
|
|
|
if [ ! -z "$svc" ]; then
|
|
|
|
cp "$svc" "$DEPLOY/etc/netcfg/ifrename"
|
2018-06-16 17:46:17 +02:00
|
|
|
echo "etc/netcfg/ifrename m 644 0 0" >> "$DEPLOY/rootfs_files.txt"
|
2018-07-20 17:43:39 +02:00
|
|
|
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"
|
2018-04-27 10:53:45 +02:00
|
|
|
fi
|
|
|
|
|
2018-04-27 22:54:28 +02:00
|
|
|
svc=$(file_path_override "interfaces")
|
|
|
|
if [ ! -z "$svc" ]; then
|
2018-06-16 17:46:17 +02:00
|
|
|
echo "etc/init.d/ifcfg m 777 0 0" >> "$DEPLOY/rootfs_files.txt"
|
|
|
|
|
2018-04-27 22:54:28 +02:00
|
|
|
for svc in $svc/*; do
|
|
|
|
[ -f "$svc" ] || continue
|
|
|
|
cp "$svc" "$DEPLOY/etc/netcfg/"
|
2018-06-16 17:46:17 +02:00
|
|
|
svc=$(basename $svc)
|
|
|
|
echo "etc/netcfg/$svc m 644 0 0" >> \
|
|
|
|
"$DEPLOY/rootfs_files.txt"
|
2018-04-27 22:54:28 +02:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2018-03-04 16:35:28 +01:00
|
|
|
for svc in $GETTY_TTY; do
|
|
|
|
ln -s "/share/init/agetty" "$DEPLOY/etc/init.d/agetty@$svc"
|
2018-06-16 17:46:17 +02:00
|
|
|
echo "etc/init.d/agetty@$svc m 777 0 0" >> \
|
|
|
|
"$DEPLOY/rootfs_files.txt"
|
2018-03-04 16:35:28 +01:00
|
|
|
done
|
|
|
|
|
2018-05-05 21:53:34 +02:00
|
|
|
if [ ! -z "$DHCP_PORTS" ]; then
|
2018-07-20 17:43:39 +02:00
|
|
|
SERVICES="$SERVICES dhcpcdmaster"
|
2018-05-05 21:53:34 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
for svc in $DHCP_PORTS; do
|
|
|
|
ln -s "/share/init/dhcpcd" "$DEPLOY/etc/init.d/dhcpcd@$svc"
|
2018-06-16 17:46:17 +02:00
|
|
|
|
|
|
|
echo "etc/init.d/dhcpcd@$svc m 777 0 0" >> \
|
|
|
|
"$DEPLOY/rootfs_files.txt"
|
2018-05-05 21:53:34 +02:00
|
|
|
done
|
|
|
|
|
2018-06-05 00:25:39 +02:00
|
|
|
for svc in $SERVICES; do
|
|
|
|
ln -s "/share/init/$svc" "$DEPLOY/etc/init.d/$svc"
|
2018-06-16 17:46:17 +02:00
|
|
|
echo "etc/init.d/$svc m 777 0 0" >> "$DEPLOY/rootfs_files.txt"
|
2018-06-05 00:25:39 +02:00
|
|
|
done
|
|
|
|
|
2018-07-20 17:43:39 +02:00
|
|
|
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
|
2018-03-04 16:35:28 +01:00
|
|
|
}
|
2018-05-06 17:23:31 +02:00
|
|
|
|
|
|
|
check_update() {
|
|
|
|
return
|
2018-05-10 14:41:13 +02:00
|
|
|
}
|