Files
SimpleLinux/scripts/finit_init.sh
T
2026-02-26 07:04:52 +07:00

89 lines
2.5 KiB
Bash

#!/bin/sh
. ./scripts/colors.sh
. ./scripts/funcs.sh
. ./scripts/config.sh
finit_init() {
printf "$GREEN** Building and installing finit\n$RESET"
[ -d $build/finit ] && return 0
mkdir -pv $build/finit
cd $build/finit
if [ ! -d libite ]; then
git clone https://gitea.home.com:3000/TolaMironcenko/libite.git
check $? "Download libite"
fi
if [ ! -d libuev ]; then
git clone https://gitea.home.com:3000/TolaMironcenko/libuev.git
check $? "Download libuev"
fi
if [ ! -d finit ]; then
git clone https://gitea.home.com:3000/TolaMironcenko/finit.git
check $? "Download finit"
fi
cd libite
./autogen.sh
check $? "Autogen libite"
./configure \
--host=$CROSS_COMPILE \
--prefix=/usr \
--with-sysroot=$rootfspath
check $? "Configure libite"
make $makeflags
check $? "Build libite"
make DESTDIR=$rootfspath install
check $? "Installing to rootfs libite"
cd ../libuev
./autogen.sh
check $? "Autogen libuev"
./configure \
--host=$CROSS_COMPILE \
--prefix=/usr \
--with-sysroot=$rootfspath
check $? "Configure libuev"
make $makeflags
check $? "Build libuev"
make DESTDIR=$rootfspath install
check $? "Installing to rootfs libuev"
cd ../finit
./autogen.sh
check $? "Autogen finit"
PKG_CONFIG_PATH=$rootfspath/usr/lib/pkgconfig ./configure \
--host=$CROSS_COMPILE \
--prefix=/usr \
--exec-prefix= \
--sysconfdir=/etc \
--localstatedir=/var \
--with-watchdog \
--with-keventd \
--with-sulogin \
--with-sysroot=$rootfspath \
--enable-resolvconf-plugin \
--enable-modules-load-plugin
check $? "Configure finit"
make $makeflags
check $? "Build finit"
make DESTDIR=$rootfspath install
check $? "Installing to rootfs finit"
find $rootfspath -name "*.la" -delete
find $rootfspath -name "*.a" -delete
rm -rv \
$rootfspath/usr/lib/pkgconfig \
$rootfspath/lib/pkgconfig \
$rootfspath/usr/include \
$rootfspath/usr/share/man \
$rootfspath/usr/share/doc
$CROSS_COMPILE-strip --strip-unneeded \
$rootfspath/usr/lib/libite.so.5.4.0 \
$rootfspath/usr/lib/libuev.so.3.0.0 \
$rootfspath/sbin/finit \
$rootfspath/sbin/initctl \
$rootfspath/libexec/finit/* \
$rootfspath/lib/libsystemd.so.0.0.0 \
$rootfspath/lib/finit/plugins/*
}