]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - setup/setup.nm
json-c: Update to version 0.17-20230812
[ipfire-3.x.git] / setup / setup.nm
index dad72ae0b1296ade59e3a6224cabb53706dd3880..e1f410086731e4f33d70d8774dd7cebf04d6fdaf 100644 (file)
@@ -5,8 +5,7 @@
 
 name       = setup
 version    = 3.0
-release    = 9
-arch       = noarch
+release    = 19
 
 groups     = Base Build System/Base
 url        =
@@ -22,6 +21,8 @@ end
 sources    =
 
 build
+       arches = noarch
+
        DIR_APP = %{DIR_SOURCE}
 
        requires
@@ -29,7 +30,7 @@ build
        end
 
        build
-               ./shadowconvert.sh
+               bash ./shadowconvert.sh
        end
 
        test
@@ -37,22 +38,45 @@ build
        end
 
        install
+               # Create missing folders.
                mkdir -pv %{BUILDROOT}/etc/profile.d %{BUILDROOT}/var/log
 
-               for i in aliases bashrc exports filesystems group gshadow host.conf \
-                       hosts hosts.allow hosts.deny inputrc motd passwd printcap \
-                       profile protocols securetty services shadow shells; do \
+               # Install our config files.
+               for i in aliases bashrc ethertypes exports filesystems group gshadow \
+                       host.conf hosts hosts.allow hosts.deny inputrc motd passwd \
+                       printcap profile protocols securetty services shadow shells; do \
                        cp -vf %{DIR_APP}/${i} %{BUILDROOT}/etc || exit 1; \
                done
 
-               touch %{BUILDROOT}%{sysconfdir}/{environment,fstab}
+               # Create envvar overwrite file for bash.
+               echo "#Add any required envvar overrides to this file, \
+                       it is sourced from /etc/profile" > %{BUILDROOT}%{sysconfdir}/profile.d/sh.local
+
+               touch %{BUILDROOT}%{sysconfdir}/fstab
                chmod -v 0400 %{BUILDROOT}%{sysconfdir}/{,g}shadow
 
+               # Create empty environment config file.
+               touch %{BUILDROOT}%{sysconfdir}/environment
+               chmod 0644 %{BUILDROOT}%{sysconfdir}/environment
+
+               # Create MOTD (message of the day) folder layout.       
+               mkdir -p %{BUILDROOT}/etc/motd.d
+               mkdir -p %{BUILDROOT}/usr/lib/motd.d
+               touch %{BUILDROOT}/usr/lib/motd
+       
+               # Create a tmpfiles file, needed for files in /run
+               mkdir -p %{BUILDROOT}%{tmpfilesdir}     
+               echo "f /run/motd 0644 root root -" > %{BUILDROOT}%{tmpfilesdir}/%{name}.conf
+               echo "d /run/motd.d 0755 root root -" >> %{BUILDROOT}%{tmpfilesdir}/%{name}.conf
+               chmod 0644 %{BUILDROOT}%{tmpfilesdir}/%{name}.conf
+
                mkdir -pv %{BUILDROOT}%{sysconfdir}/sysctl.d
                install -m 644 %{DIR_APP}/sysctl/printk.conf \
                        %{BUILDROOT}%{sysconfdir}/sysctl.d/printk.conf
                install -m 644 %{DIR_APP}/sysctl/swappiness.conf \
                        %{BUILDROOT}%{sysconfdir}/sysctl.d/swappiness.conf
+               install -m 644 %{DIR_APP}/sysctl/kernel-hardening.conf \
+                       %{BUILDROOT}%{sysconfdir}/sysctl.d/kernel-hardening.conf
        end
 end
 
@@ -72,6 +96,8 @@ packages
 
                configfiles
                        /etc/aliases
+                       /etc/environment
+                       /etc/ethertypes
                        /etc/exports
                        /etc/fstab
                        /etc/group