added iptables build

This commit is contained in:
wt
2025-03-24 17:37:47 +07:00
parent f365fbeb8d
commit 5d876267e2
6 changed files with 202 additions and 107 deletions
+4
View File
@@ -14,6 +14,7 @@
. ./scripts/iw.sh
. ./scripts/hostapd.sh
. ./scripts/openssl.sh
. ./scripts/iptables.sh
case $1 in
build)
@@ -48,6 +49,9 @@ case $1 in
openssl)
openssl
;;
iptables)
iptables
;;
sdroot_usable)
if [ ! -d downloads ]; then
download_sources
+1
View File
@@ -37,4 +37,5 @@ export wpa_supplicant_enable="false"
export hostapd_enable="false"
export openssl_enable="false"
export dnsmasq_enable="true"
export iptables_enable="true"
#--------------------------------------
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
. ./scripts/colors.sh
. ./scripts/funcs.sh
. ./scripts/config.sh
iptables() {
pkgname=iptables
pkgver=1.8.11
printf "$GREEN** Building and installing $pkgname\n$RESET"
[ ! -d $build/$pkgname ] && mkdir $build/$pkgname
cd $build/$pkgname
tar -xvf $root/downloads/${pkgname}-${pkgver}.tar.xz
cd ${pkgname}-${pkgver}
./configure \
--prefix=/usr \
--build=x86_64-pc-linux-gnu \
--host=${CROSS_COMPILE} \
--disable-nftables \
--disable-libnfnetlink \
--disable-connlabel
check $? "Configure ${pkgname}"
make ${makeflags}
check $? "Build ${pkgname}"
make install DESTDIR=$rootfspath
check $? "Install to rootfs ${pkgname}"
${CROSS_COMPILE}-strip \
$rootfspath/usr/bin/* \
$rootfspath/usr/sbin/* \
$rootfspath/usr/lib/* \
$rootfspath/usr/lib/xtables/*
rm -rv $rootfspath/usr/share/man
printf "$GREEN** SUCCESS: Building and installing ${pkgname}\n$RESET"
}
+2
View File
@@ -18,6 +18,7 @@
. ./scripts/openssl.sh
. ./scripts/hostapd.sh
. ./scripts/dnsmasq.sh
. ./scripts/iptables.sh
#----------- Building rootfs ----------------------
rootfs() {
@@ -62,6 +63,7 @@ rootfs() {
[ "$libnl_enable" = "true" ] && libnl
[ "$iw_enable" = "true" ] && iw
[ "$hostapd_enable" = "true" ] && hostapd
[ "$iptables_enable" = "true" ] && iptables
chmod 640 $rootfspath/etc/shadow $rootfspath/etc/inittab
chmod 755 $rootfspath/etc/init.d/* $rootfspath/usr/share/udhcpc/default.script $rootfspath/init