diff --git a/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb b/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb index 31b16a8..728ef6b 100644 --- a/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb +++ b/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb @@ -14,13 +14,26 @@ DEFAULT_REALM_UNITS = "\ file://systemd/watch-run-user.service \ " +MODPROBE_CONFIG = "\ + file://modprobe.d/audio_powersave.conf \ + file://modprobe.d/wifi_powersave.conf \ +" + +SYSCTL_CONFIG = "\ + file://sysctl/99-grsec-debootstrap.conf \ + file://sysctl/90-citadel-sysctl.conf \ +" + +UDEV_RULES = "\ + file://udev/citadel-network.rules \ + file://udev/pci-pm.rules \ + file://udev/scsi-alpm.rules \ +" + SRC_URI = "\ file://locale.conf \ file://environment.sh \ file://fstab \ - file://99-grsec-debootstrap.conf \ - file://90-citadel-sysctl.conf \ - file://citadel-network.rules \ file://citadel-ifconfig.sh \ file://00-storage-tmpfiles.conf \ file://NetworkManager.conf \ @@ -30,6 +43,9 @@ SRC_URI = "\ file://polkit/citadel.rules \ file://systemd/zram-swap.service \ ${DEFAULT_REALM_UNITS} \ + ${MODPROBE_CONFIG} \ + ${SYSCTL_CONFIG} \ + ${UDEV_RULES} \ " USERADD_PACKAGES = "${PN}" @@ -54,6 +70,7 @@ do_install() { install -m 0755 -d ${D}${sysconfdir}/udev/rules.d install -m 0755 -d ${D}${sysconfdir}/NetworkManager install -m 0755 -d ${D}${sysconfdir}/polkit-1/rules.d + install -m 0755 -d ${D}${sysconfdir}/modprobe.d install -m 0700 -d ${D}${localstatedir}/lib/NetworkManager install -m 0700 -d ${D}${localstatedir}/lib/NetworkManager/system-connections @@ -73,18 +90,24 @@ do_install() { # disable some pax and grsecurity features so that debootstrap will work # this should be removed later - install -m 0644 ${WORKDIR}/99-grsec-debootstrap.conf ${D}${libdir}/sysctl.d/ + install -m 0644 ${WORKDIR}/sysctl/99-grsec-debootstrap.conf ${D}${libdir}/sysctl.d/ - install -m 0644 ${WORKDIR}/90-citadel-sysctl.conf ${D}${libdir}/sysctl.d/ + install -m 0644 ${WORKDIR}/sysctl/90-citadel-sysctl.conf ${D}${libdir}/sysctl.d/ - install -m 0644 ${WORKDIR}/citadel-network.rules ${D}${sysconfdir}/udev/rules.d/ + install -m 0644 ${WORKDIR}/udev/citadel-network.rules ${D}${sysconfdir}/udev/rules.d/ install -m 0755 ${WORKDIR}/citadel-ifconfig.sh ${D}${libexecdir} - install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc - install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile - install -m 0755 ${WORKDIR}/share/dot.vimrc ${D}${sysconfdir}/skel/.vimrc + install -m 0644 ${WORKDIR}/udev/pci-pm.rules ${D}${sysconfdir}/udev/rules.d/ + install -m 0644 ${WORKDIR}/udev/scsi-alpm.rules ${D}${sysconfdir}/udev/rules.d/ - install -m 0755 ${WORKDIR}/polkit/citadel.rules ${D}${sysconfdir}/polkit-1/rules.d/ + install -m 0644 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc + install -m 0644 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile + install -m 0644 ${WORKDIR}/share/dot.vimrc ${D}${sysconfdir}/skel/.vimrc + + install -m 0644 ${WORKDIR}/polkit/citadel.rules ${D}${sysconfdir}/polkit-1/rules.d/ + + install -m 0644 ${WORKDIR}/modprobe.d/audio_powersave.conf ${D}${sysconfdir}/modprobe.d/ + install -m 0644 ${WORKDIR}/modprobe.d/wifi_powersave.conf ${D}${sysconfdir}/modprobe.d/ ln -s /storage/citadel-state/resolv.conf ${D}${sysconfdir}/resolv.conf ln -s /dev/null ${D}${sysconfdir}/tmpfiles.d/etc.conf diff --git a/meta-citadel/recipes-citadel/citadel-config/files/90-citadel-sysctl.conf b/meta-citadel/recipes-citadel/citadel-config/files/90-citadel-sysctl.conf deleted file mode 100644 index 4234b54..0000000 --- a/meta-citadel/recipes-citadel/citadel-config/files/90-citadel-sysctl.conf +++ /dev/null @@ -1 +0,0 @@ -net.ipv4.ip_forward = 1 diff --git a/meta-citadel/recipes-citadel/citadel-config/files/modprobe.d/audio_powersave.conf b/meta-citadel/recipes-citadel/citadel-config/files/modprobe.d/audio_powersave.conf new file mode 100644 index 0000000..e49bd75 --- /dev/null +++ b/meta-citadel/recipes-citadel/citadel-config/files/modprobe.d/audio_powersave.conf @@ -0,0 +1,2 @@ +options snd_hda_intel power_save=1 +options snd_ac97_codec power_save=1 diff --git a/meta-citadel/recipes-citadel/citadel-config/files/modprobe.d/wifi_powersave.conf b/meta-citadel/recipes-citadel/citadel-config/files/modprobe.d/wifi_powersave.conf new file mode 100644 index 0000000..7fafbf6 --- /dev/null +++ b/meta-citadel/recipes-citadel/citadel-config/files/modprobe.d/wifi_powersave.conf @@ -0,0 +1,2 @@ +options iwlwifi power_save=1 d0i3_disable=0 uapsd_disable=0 +options iwldvm force_cam=0 diff --git a/meta-citadel/recipes-citadel/citadel-config/files/sysctl/90-citadel-sysctl.conf b/meta-citadel/recipes-citadel/citadel-config/files/sysctl/90-citadel-sysctl.conf new file mode 100644 index 0000000..5218f6f --- /dev/null +++ b/meta-citadel/recipes-citadel/citadel-config/files/sysctl/90-citadel-sysctl.conf @@ -0,0 +1,4 @@ +net.ipv4.ip_forward = 1 +kernel.nmi_watchdog = 0 +vm.dirty_writeback_centisecs = 6000 + diff --git a/meta-citadel/recipes-citadel/citadel-config/files/99-grsec-debootstrap.conf b/meta-citadel/recipes-citadel/citadel-config/files/sysctl/99-grsec-debootstrap.conf similarity index 100% rename from meta-citadel/recipes-citadel/citadel-config/files/99-grsec-debootstrap.conf rename to meta-citadel/recipes-citadel/citadel-config/files/sysctl/99-grsec-debootstrap.conf diff --git a/meta-citadel/recipes-citadel/citadel-config/files/citadel-network.rules b/meta-citadel/recipes-citadel/citadel-config/files/udev/citadel-network.rules similarity index 100% rename from meta-citadel/recipes-citadel/citadel-config/files/citadel-network.rules rename to meta-citadel/recipes-citadel/citadel-config/files/udev/citadel-network.rules diff --git a/meta-citadel/recipes-citadel/citadel-config/files/udev/pci-pm.rules b/meta-citadel/recipes-citadel/citadel-config/files/udev/pci-pm.rules new file mode 100644 index 0000000..0996e34 --- /dev/null +++ b/meta-citadel/recipes-citadel/citadel-config/files/udev/pci-pm.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="pci", ATTR{power/control}="auto" diff --git a/meta-citadel/recipes-citadel/citadel-config/files/udev/scsi-alpm.rules b/meta-citadel/recipes-citadel/citadel-config/files/udev/scsi-alpm.rules new file mode 100644 index 0000000..9d4485a --- /dev/null +++ b/meta-citadel/recipes-citadel/citadel-config/files/udev/scsi-alpm.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="med_power_with_dipm"