From d46af5fbda8857af432214b97dc1401e7b689b9e Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Thu, 28 May 2020 23:41:20 +0300 Subject: [PATCH] Adjust dracut config --- lxqt.ks | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lxqt.ks b/lxqt.ks index afe1909..1d8f63c 100644 --- a/lxqt.ks +++ b/lxqt.ks @@ -47,9 +47,28 @@ sed -e 's/^Session=/Session=lxqt.desktop/' -i /etc/sddm.conf # packages, and then all needed dracut modules will be already # installed during inird generation, and there will be no need # to (re)generate initrds here. -find /boot -name 'vmlinuz-*' | while read -r line ; do +# BUT dracut config by livecd-tools is partly broken +# https://github.com/livecd-tools/livecd-tools/issues/158 +# We remove odd parts - modules that do not exist in this kernel. +# Another possible approach is making and using our own config from scratch. +C="${C:-/etc/dracut.conf.d/99-liveos.conf}" +find /boot -name 'vmlinuz-*' | sort -u | while read -r line ; do kver="$(echo "$line" | sed -e 's,^/boot/vmlinuz-,,g')" + cp "${C}" "${C}.orig" + to_find="$(cat "$C" | grep -E '^(filesystems\+=|add_drivers\+=)' | sed -e 's,",,g' | awk -F '+=' '{print $NF}' | tr ' ' '\n' | grep -v '=' | tr '\n' ' ' | sed -e 's, , ,g')" + not_exist_list="" + for i in ${to_find} ; do + if ! find "/lib/modules/${kver}" -name "${i}.ko*" | grep -q '.' ; then + not_exist_list="${not_exist_list} ${i}" + fi + done + for i in ${not_exist_list} ; do + sed -i -E -e "s,([[:blank:]])*${i}[[:blank:]], ,g" "$C" + done + diff -u "${C}.orig" "${C}" || : + rm -f "${C}.orig" dracut -f "/boot/initrd-${kver}.img" "${kver}" done +find /boot -name 'initrd-*' -print %end