From 73ecbf1332ff89420e76c2e2149fd6263ff5d8ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Tue, 8 Mar 2022 11:39:59 +0100 Subject: [PATCH] Updated efg.pm (converted to the new c3d format). --- .../firstboot/data}/nftables.config | 0 .../firstboot/data}/traversal.txt | 0 .../firstboot/scripts}/01_setupnetworking.sh | 0 .../firstboot/scripts}/02_settimezone.sh | 0 .../c3d/firstboot/scripts/10_setupnftables.sh | 10 ++++++++++ .../c3d/firstboot/scripts/90_setupservices.sh | 12 ++++++++++++ sources/efg.pm/c3d/mode.txt | 4 ++++ .../postinstall/install-data}/etc/radvd.conf | 0 .../install-data}/etc/sysconfig/nftables.conf | 0 .../etc/sysctl.d/01_ipforward.conf | 0 .../install-data}/usr/local/bin/setuprouting.sh | 0 .../c3d/postinstall/scripts/10_setupservices.sh | 8 ++++++++ sources/efg.pm/firstboot/10_setupnftables.sh | 17 ----------------- sources/efg.pm/firstboot/99_cleanup.sh | 6 ------ sources/efg.pm/postinstall/01_setownership.sh | 7 ------- sources/efg.pm/postinstall/02_setpermissions.sh | 5 ----- sources/efg.pm/postinstall/03_installfiles.sh | 16 ---------------- sources/efg.pm/postinstall/10_setupservices.sh | 7 ------- sources/efg.pm/postinstall/99_cleanup.sh | 6 ------ 19 files changed, 34 insertions(+), 64 deletions(-) rename sources/efg.pm/{firstboot => c3d/firstboot/data}/nftables.config (100%) rename sources/efg.pm/{firstboot => c3d/firstboot/data}/traversal.txt (100%) rename sources/efg.pm/{firstboot => c3d/firstboot/scripts}/01_setupnetworking.sh (100%) rename sources/efg.pm/{firstboot => c3d/firstboot/scripts}/02_settimezone.sh (100%) create mode 100755 sources/efg.pm/c3d/firstboot/scripts/10_setupnftables.sh create mode 100755 sources/efg.pm/c3d/firstboot/scripts/90_setupservices.sh create mode 100644 sources/efg.pm/c3d/mode.txt rename sources/efg.pm/{postinstall/install => c3d/postinstall/install-data}/etc/radvd.conf (100%) rename sources/efg.pm/{postinstall/install => c3d/postinstall/install-data}/etc/sysconfig/nftables.conf (100%) rename sources/efg.pm/{postinstall/install => c3d/postinstall/install-data}/etc/sysctl.d/01_ipforward.conf (100%) rename sources/efg.pm/{postinstall/install => c3d/postinstall/install-data}/usr/local/bin/setuprouting.sh (100%) create mode 100755 sources/efg.pm/c3d/postinstall/scripts/10_setupservices.sh delete mode 100755 sources/efg.pm/firstboot/10_setupnftables.sh delete mode 100755 sources/efg.pm/firstboot/99_cleanup.sh delete mode 100755 sources/efg.pm/postinstall/01_setownership.sh delete mode 100755 sources/efg.pm/postinstall/02_setpermissions.sh delete mode 100755 sources/efg.pm/postinstall/03_installfiles.sh delete mode 100755 sources/efg.pm/postinstall/10_setupservices.sh delete mode 100755 sources/efg.pm/postinstall/99_cleanup.sh diff --git a/sources/efg.pm/firstboot/nftables.config b/sources/efg.pm/c3d/firstboot/data/nftables.config similarity index 100% rename from sources/efg.pm/firstboot/nftables.config rename to sources/efg.pm/c3d/firstboot/data/nftables.config diff --git a/sources/efg.pm/firstboot/traversal.txt b/sources/efg.pm/c3d/firstboot/data/traversal.txt similarity index 100% rename from sources/efg.pm/firstboot/traversal.txt rename to sources/efg.pm/c3d/firstboot/data/traversal.txt diff --git a/sources/efg.pm/firstboot/01_setupnetworking.sh b/sources/efg.pm/c3d/firstboot/scripts/01_setupnetworking.sh similarity index 100% rename from sources/efg.pm/firstboot/01_setupnetworking.sh rename to sources/efg.pm/c3d/firstboot/scripts/01_setupnetworking.sh diff --git a/sources/efg.pm/firstboot/02_settimezone.sh b/sources/efg.pm/c3d/firstboot/scripts/02_settimezone.sh similarity index 100% rename from sources/efg.pm/firstboot/02_settimezone.sh rename to sources/efg.pm/c3d/firstboot/scripts/02_settimezone.sh diff --git a/sources/efg.pm/c3d/firstboot/scripts/10_setupnftables.sh b/sources/efg.pm/c3d/firstboot/scripts/10_setupnftables.sh new file mode 100755 index 0000000..53082d9 --- /dev/null +++ b/sources/efg.pm/c3d/firstboot/scripts/10_setupnftables.sh @@ -0,0 +1,10 @@ +#!/bin/sh + + +REAL_PATH=$(realpath $(dirname $0)) +DATA_PATH=$(realpath $REAL_PATH/../data) + + +nft flush ruleset +nft --echo --file $DATA_PATH/nftables.config +nft list ruleset | tee /etc/nftables/efg.nft diff --git a/sources/efg.pm/c3d/firstboot/scripts/90_setupservices.sh b/sources/efg.pm/c3d/firstboot/scripts/90_setupservices.sh new file mode 100755 index 0000000..3034652 --- /dev/null +++ b/sources/efg.pm/c3d/firstboot/scripts/90_setupservices.sh @@ -0,0 +1,12 @@ +#!/bin/sh + + +systemctl enable nftables.service +systemctl start nftables.service +systemctl enable radvd.service +systemctl start radvd.service +systemctl enable NetworkManager-wait-online.service +systemctl start NetworkManager-wait-online.service + +systemctl enable logrotate.timer +systemctl start logrotate.timer diff --git a/sources/efg.pm/c3d/mode.txt b/sources/efg.pm/c3d/mode.txt new file mode 100644 index 0000000..9b8459e --- /dev/null +++ b/sources/efg.pm/c3d/mode.txt @@ -0,0 +1,4 @@ +# mode file (relative to /c3d) +755 firstboot/scripts/*.sh +755 postinstall/install-data/usr/local/bin/* +755 postinstall/scripts/*.sh diff --git a/sources/efg.pm/postinstall/install/etc/radvd.conf b/sources/efg.pm/c3d/postinstall/install-data/etc/radvd.conf similarity index 100% rename from sources/efg.pm/postinstall/install/etc/radvd.conf rename to sources/efg.pm/c3d/postinstall/install-data/etc/radvd.conf diff --git a/sources/efg.pm/postinstall/install/etc/sysconfig/nftables.conf b/sources/efg.pm/c3d/postinstall/install-data/etc/sysconfig/nftables.conf similarity index 100% rename from sources/efg.pm/postinstall/install/etc/sysconfig/nftables.conf rename to sources/efg.pm/c3d/postinstall/install-data/etc/sysconfig/nftables.conf diff --git a/sources/efg.pm/postinstall/install/etc/sysctl.d/01_ipforward.conf b/sources/efg.pm/c3d/postinstall/install-data/etc/sysctl.d/01_ipforward.conf similarity index 100% rename from sources/efg.pm/postinstall/install/etc/sysctl.d/01_ipforward.conf rename to sources/efg.pm/c3d/postinstall/install-data/etc/sysctl.d/01_ipforward.conf diff --git a/sources/efg.pm/postinstall/install/usr/local/bin/setuprouting.sh b/sources/efg.pm/c3d/postinstall/install-data/usr/local/bin/setuprouting.sh similarity index 100% rename from sources/efg.pm/postinstall/install/usr/local/bin/setuprouting.sh rename to sources/efg.pm/c3d/postinstall/install-data/usr/local/bin/setuprouting.sh diff --git a/sources/efg.pm/c3d/postinstall/scripts/10_setupservices.sh b/sources/efg.pm/c3d/postinstall/scripts/10_setupservices.sh new file mode 100755 index 0000000..01a9c55 --- /dev/null +++ b/sources/efg.pm/c3d/postinstall/scripts/10_setupservices.sh @@ -0,0 +1,8 @@ +#!/bin/sh + + +systemctl disable nftables.service +systemctl disable radvd.service +systemctl disable NetworkManager-wait-online.service + +systemctl disable logrotate.timer diff --git a/sources/efg.pm/firstboot/10_setupnftables.sh b/sources/efg.pm/firstboot/10_setupnftables.sh deleted file mode 100755 index 93bbdc1..0000000 --- a/sources/efg.pm/firstboot/10_setupnftables.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - - -REAL_PATH=$(realpath $(dirname $0)) - - -nft list ruleset | grep ^table | sed 's/ {$//' | while read TABLE_SPEC -do - nft flush $TABLE_SPEC - nft delete $TABLE_SPEC -done - -nft --echo --file $REAL_PATH/nftables.config -nft list ruleset >/etc/nftables/efg.nft -nft list ruleset - -systemctl enable nftables.service diff --git a/sources/efg.pm/firstboot/99_cleanup.sh b/sources/efg.pm/firstboot/99_cleanup.sh deleted file mode 100755 index b87f2f4..0000000 --- a/sources/efg.pm/firstboot/99_cleanup.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - - -REAL_PATH=$(dirname $(realpath $0)) - -echo rm -Rf $REAL_PATH diff --git a/sources/efg.pm/postinstall/01_setownership.sh b/sources/efg.pm/postinstall/01_setownership.sh deleted file mode 100755 index f2e6b94..0000000 --- a/sources/efg.pm/postinstall/01_setownership.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - - -REAL_PATH=$(dirname $(realpath $0)) -SOURCE_PATH=$REAL_PATH/install - -chown -R root.root $SOURCE_PATH/* diff --git a/sources/efg.pm/postinstall/02_setpermissions.sh b/sources/efg.pm/postinstall/02_setpermissions.sh deleted file mode 100755 index 241386a..0000000 --- a/sources/efg.pm/postinstall/02_setpermissions.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - - -REAL_PATH=$(dirname $(realpath $0)) -SOURCE_PATH=$REAL_PATH/install diff --git a/sources/efg.pm/postinstall/03_installfiles.sh b/sources/efg.pm/postinstall/03_installfiles.sh deleted file mode 100755 index e4ee7ff..0000000 --- a/sources/efg.pm/postinstall/03_installfiles.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - - -REAL_PATH=$(dirname $(realpath $0)) - -tar --create \ - --directory=$REAL_PATH \ - --exclude=.placeholder \ - --to-stdout \ - install \ - | tar --extract \ - --backup \ - --directory=/ \ - --no-overwrite-dir \ - --strip-components=1 \ - --suffix=.orig diff --git a/sources/efg.pm/postinstall/10_setupservices.sh b/sources/efg.pm/postinstall/10_setupservices.sh deleted file mode 100755 index 3f86f82..0000000 --- a/sources/efg.pm/postinstall/10_setupservices.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - - -systemctl enable NetworkManager-wait-online.service -systemctl enable radvd.service - -systemctl enable logrotate.timer diff --git a/sources/efg.pm/postinstall/99_cleanup.sh b/sources/efg.pm/postinstall/99_cleanup.sh deleted file mode 100755 index b87f2f4..0000000 --- a/sources/efg.pm/postinstall/99_cleanup.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - - -REAL_PATH=$(dirname $(realpath $0)) - -echo rm -Rf $REAL_PATH -- 2.54.0