Ben Hutchings 79f49b96ba {hooks,scripts}/keymap: Use setupcon --setup-dir
setupcon gained a --setup-dir option to support initramfs builders,
documented since console-setup 1.111.  Use this to simplify our
own scripts.

Related-to: #620041
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-02-04 03:16:37 +01:00

41 lines
687 B
Bash
Executable File

#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
# Hook to load keymaps into the initramfs if requested by KEYMAP="y"
if [ "$KEYMAP" != "y" ] && [ "$KEYMAP" != "Y" ]; then
exit 0
fi
if [ ! -x /bin/setupcon ]; then
echo "setupcon is missing. Please install the 'console-setup' package."
exit 0
fi
. /usr/share/initramfs-tools/hook-functions
# Tell setupcon to copy/create the files it needs.
setupcon --setup-dir "$DESTDIR"
# Copy additional files that setupcon needs. We assume they are
# executables.
while read -r file; do
copy_exec "$file"
done < "$DESTDIR/morefiles"
rm -f "$DESTDIR/morefiles"
exit 0