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 7204b9dd75 Cleanup: strip executables in mk.sh
Automagically strip all executables (recursively for subdirectories in lib
and bin) inside the mk.sh build loop.

This removes the necessity in the build scripts to strip the files. This also
allows us to remove the error prone install-strip target from the build
scripts.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-06-17 20:22:10 +02:00

92 lines
2.2 KiB
Text
Executable file

VERSION="0.4"
SRCDIR="init-${VERSION}"
TARBALL="${SRCDIR}.tar.xz"
URL="http://infraroot.at/pygos"
SHA256SUM="a128be18bbabca600e0553ec539e953eda0a467a337826d520c5fe3ef893ab03"
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
ln -s "/share/init/hwclock" "$DEPLOY/etc/init.d/hwclock"
echo "etc/init.d/hwclock m 777 0 0" >> "$DEPLOY/rootfs_files.txt"
fi
svc=$(file_path_override "ifrename")
if [ ! -z "$svc" ]; then
cp "$svc" "$DEPLOY/etc/netcfg/ifrename"
ln -s "/share/init/ifrename" "$DEPLOY/etc/init.d/ifrename"
echo "etc/netcfg/ifrename m 644 0 0" >> "$DEPLOY/rootfs_files.txt"
echo "etc/init.d/ifrename m 777 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
ln -s "/share/init/dhcpcdmaster" \
"$DEPLOY/etc/init.d/dhcpcdmaster"
echo "etc/init.d/dhcpcdmaster m 777 0 0" >> \
"$DEPLOY/rootfs_files.txt"
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
unset -v i GETTY_TTY HWCLOCK DHCP_PORTS SERVICES
}
check_update() {
return
}