conf.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
  3. # ex: ts=8 sw=4 sts=4 et filetype=sh
  4. type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
  5. KEYMAP=$(getarg vconsole.keymap)
  6. FONT=$(getarg vconsole.font)
  7. FONT_MAP=$(getarg vconsole.font.map)
  8. FONT_UNIMAP=$(getarg vconsole.font.unimap)
  9. LOCALE=$(getarg locale.LANG)
  10. if [ -n "$KEYMAP" ]; then
  11. sed -i -e "s|^KEYMAP=.*|KEYMAP=$KEYMAP|g" ${NEWROOT}/etc/vconsole.conf
  12. fi
  13. if [ -n "$FONT" ]; then
  14. sed -i -e "s|^FONT=.*|FONT=$FONT|g" ${NEWROOT}/etc/vconsole.conf
  15. fi
  16. if [ -n "$FONT_MAP" ]; then
  17. sed -i -e "s|^FONT_MAP=.*|FONT_MAP=$FONT_MAP|g" ${NEWROOT}/etc/vconsole.conf
  18. fi
  19. if [ -n "$FONT_UNIMAP" ]; then
  20. sed -i -e "s|^FONT_UNIMAP=.*|FONT_UNIMAP=$FONT_UNIMAP|g" ${NEWROOT}/etc/vconsole.conf
  21. fi
  22. if [ -n "$LOCALE" ]; then
  23. sed -i -e "s|^LANG=.*|LANG=$LOCALE|g" ${NEWROOT}/etc/locale.conf
  24. fi
  25. # Setup keymap for X.org evdev.
  26. if [ -r "${NEWROOT}/etc/udev/rules.d/75-x11-input.rules" ]; then
  27. sed -i -e "s|\(ENV{xkblayout}\=\)\"us\"|\1\"${KEYMAP}\"|" \
  28. ${NEWROOT}/etc/udev/rules.d/75-x11-input.rules
  29. fi