summaryrefslogtreecommitdiff
path: root/pcr/openrc/use-optional-modules-load-d.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/openrc/use-optional-modules-load-d.patch')
-rw-r--r--pcr/openrc/use-optional-modules-load-d.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/pcr/openrc/use-optional-modules-load-d.patch b/pcr/openrc/use-optional-modules-load-d.patch
new file mode 100644
index 000000000..7c91f032c
--- /dev/null
+++ b/pcr/openrc/use-optional-modules-load-d.patch
@@ -0,0 +1,53 @@
+--- ../conf.d/modules.orig 2015-07-06 01:50:49.893895158 +0200
++++ ../conf.d/modules 2015-07-06 01:27:49.000000000 +0200
+@@ -1,6 +1,11 @@
+ # You can define a list modules for a specific kernel version,
+ # a released kernel version, a main kernel version or just a list.
+ # The most specific versioned variable will take precedence.
++
++# if openrc should make use of /etc/modules-load.d
++# systemd places stuff there
++use_modules_load_d=false
++
+ #modules_2_6_23_gentoo_r5="ieee1394 ohci1394"
+ #modules_2_6_23="tun ieee1394"
+ #modules_2_6="tun"
+
+--- ../init.d/modules.in.orig 2015-06-19 16:55:37.000000000 +0200
++++ ../init.d/modules.in 2015-07-06 01:30:29.154313412 +0200
+@@ -16,6 +16,35 @@
+ # support compiled in ...
+ [ ! -f /proc/modules ] && return 0
+
++ if ${use_modules_load_d};then
++ local conf_s=/etc/modules-load.d
++ einfo "using ${conf_s}"
++ local conf_rc=/etc/conf.d/modules
++ mv ${conf_rc} ${conf_rc}.lastboot
++ touch ${conf_rc}
++ echo "use_modules_load_d=${use_modules_load_d}" >> ${conf_rc}
++ if [[ -d ${conf_s} ]] && [[ -f ${conf_s}/mhwd-gpu.conf ]]; then
++ local mods=() mhwd=() fn= kv=
++ for m in $(cat ${conf_s}/mhwd-gpu.conf | sed '/^.*#/d'); do
++ mhwd+=("$m")
++ done
++ for f in $(ls ${conf_s}/*.conf); do
++ if [[ $fn != mhwd-gpu ]];then
++ fn=${f##*/}
++ fn=${fn%%.conf}
++ kv=${fn//-*}
++ kv=${kv##linux}
++ for m in $(cat $f | sed '/^.*#/d'); do
++ mods+=("$m")
++ done
++ [[ $fn == linux${kv}-* ]] && echo 'modules_'${kv:0:1}'_'${kv:1:2}'="'${mods[@]} ${mhwd[@]}'"' >> ${conf_rc}
++ echo '' >> ${conf_rc}
++ mods=()
++ fi
++ done
++ fi
++ fi
++
+ local KV x y kv_variant_list
+ KV=$(uname -r)
+ # full $KV