Files
2026-03-06 18:01:24 +07:00

72 lines
1.9 KiB
Bash

#!/bin/bash
. ./scripts/colors.sh
. ./scripts/funcs.sh
. ./scripts/config.sh
finit_init() {
print_info "** Building and installing finit"
[ -d $build/finit ] && return 0
mkdir -p $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"
}