From: Diego Augusto Date: Sat, 15 Oct 2022 17:38:50 +0000 (-0400) Subject: populate-initrd: Ensure all xkb stuff gets moved to initramfs X-Git-Tag: 23.51.283~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c78d01f529107b0f8e4e69828ca67a63f75f25f;p=thirdparty%2Fplymouth.git populate-initrd: Ensure all xkb stuff gets moved to initramfs Now that plymouth supports /dev/input directly, it's important that the initramfs gains all the newly needed support files. This commit adds the necessary changes to the script to ensure those files get moved over. Some contributions by n3rdopolis and Ray Strode. --- diff --git a/scripts/plymouth-populate-initrd.in b/scripts/plymouth-populate-initrd.in index a130616f..6ee6b353 100755 --- a/scripts/plymouth-populate-initrd.in +++ b/scripts/plymouth-populate-initrd.in @@ -33,6 +33,10 @@ ddebug() { [ "$verbose" = "true" ] && echo "$@" } +dfatal() { + echo "$@" > /proc/self/fd/2 +} + # normalize_path # Prints the normalized path, where it removes any duplicated # and trailing slashes. @@ -420,12 +424,13 @@ function usage() { rc=1 fi - echo "usage: plymouth [ --verbose | -v ] { --targetdir | -t } " > $output + echo "usage: plymouth [ --verbose | -v ] { --targetdir | -t } { --x11-directory | -x } " > $output exit $rc } verbose=false INITRDDIR="" +X11_DIRECTORY="/usr/share/X11" while [ $# -gt 0 ]; do case $1 in --verbose|-v) @@ -438,6 +443,10 @@ while [ $# -gt 0 ]; do --help|-h) usage normal ;; + --x11-directory|-x) + shift + X11_DIRECTORY="$1" + ;; *) usage error break @@ -465,6 +474,51 @@ inst @RELEASE_FILE@ $INITRDDIR inst ${PLYMOUTH_POLICYDIR}/plymouthd.defaults $INITRDDIR inst ${PLYMOUTH_CONFDIR}/plymouthd.conf $INITRDDIR +# Install xkb info +mkdir -p "${INITRDDIR}/${X11_DIRECTORY}/xkb/" +mkdir -p "${INITRDDIR}/${X11_DIRECTORY}/xkb/compat/" + +mkdir -p "${INITRDDIR}/${X11_DIRECTORY}/xkb/keycodes/" +mkdir -p "${INITRDDIR}/${X11_DIRECTORY}/xkb/rules/" +mkdir -p "${INITRDDIR}/${X11_DIRECTORY}/xkb/symbols/" +mkdir -p "${INITRDDIR}/${X11_DIRECTORY}/xkb/types/" +mkdir -p "${INITRDDIR}/${X11_DIRECTORY}/locale/" +inst ${X11_DIRECTORY}/xkb/compat/accessx $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/basic $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/caps $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/complete $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/iso9995 $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/ledcaps $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/lednum $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/ledscroll $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/level5 $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/misc $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/mousekeys $INITRDDIR +inst ${X11_DIRECTORY}/xkb/compat/xfree86 $INITRDDIR +inst ${X11_DIRECTORY}/xkb/keycodes/aliases $INITRDDIR +inst ${X11_DIRECTORY}/xkb/keycodes/evdev $INITRDDIR +inst ${X11_DIRECTORY}/xkb/rules/evdev $INITRDDIR +find ${X11_DIRECTORY}/xkb/symbols -maxdepth 1 ! -type d | while read file; do + inst $file $INITRDDIR +done +inst ${X11_DIRECTORY}/xkb/types/basic $INITRDDIR +inst ${X11_DIRECTORY}/xkb/types/complete $INITRDDIR +inst ${X11_DIRECTORY}/xkb/types/extra $INITRDDIR +inst ${X11_DIRECTORY}/xkb/types/iso9995 $INITRDDIR +inst ${X11_DIRECTORY}/xkb/types/level5 $INITRDDIR +inst ${X11_DIRECTORY}/xkb/types/mousekeys $INITRDDIR +inst ${X11_DIRECTORY}/xkb/types/numpad $INITRDDIR +inst ${X11_DIRECTORY}/xkb/types/pc $INITRDDIR + +# In the off chance the user uses their compose key when +# typing their password, install compose sequences +inst ${X11_DIRECTORY}/locale/compose.dir $INITRDDIR +grep UTF-8/Compose: ${X11_DIRECTORY}/locale/compose.dir | awk -F: '{ print $1 }' | sort -u | xargs dirname | while read DIR; do + find ${X11_DIRECTORY}/locale/$DIR -maxdepth 1 ! -type d | while read file; do + inst $file $INITRDDIR + done +done + if [ -z "$PLYMOUTH_THEME_NAME" ]; then echo "No default plymouth plugin is set" >&2 exit 1