]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
plymouth: add xz support for kernel modules
authorJames Buren <ryuo@frugalware.org>
Sun, 22 Jan 2012 18:56:24 +0000 (12:56 -0600)
committerHarald Hoyer <harald@redhat.com>
Mon, 23 Jan 2012 08:59:35 +0000 (09:59 +0100)
This rewrites a portion of the module to support xz, as well as allow
an easier expansion should future compression methods for kernel
modules ever materialize.

modules.d/50plymouth/module-setup.sh

index eedc84229b3a2d2ea56ba0eda8afe2018225330d..b78c718be402dcb3d24c862800ca69bf9d25b538 100755 (executable)
@@ -14,8 +14,13 @@ depends() {
 installkernel() {
     local _modname
     # Include KMS capable drm drivers
-    for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" \( -name '*.ko' -o -name '*.ko.gz' \) 2>/dev/null); do
-        if zgrep -q drm_crtc_init  $_modname; then
+    for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" \( -name '*.ko' -o -name '*.ko.gz' -o -name '*.ko.xz' \) 2>/dev/null); do
+        case $_modname in
+            *.ko)      grep -q drm_crtc_init $_modname ;;
+            *.ko.gz)  zgrep -q drm_crtc_init $_modname ;;
+            *.ko.xz) xzgrep -q drm_crtc_init $_modname ;;
+        esac
+        if test $? -eq 0; then
             # if the hardware is present, include module even if it is not currently loaded,
             # as we could e.g. be in the installer; nokmsboot boot parameter will disable
             # loading of the driver if needed