recipes: devel/perl: configure without threads support, this is causing troubles
[dragora.git] / archive / isolinux / generate-keymap
blob8b016a787315c3063f8b1aaeb41d6ac0fb8cd52b
1 #! /bin/sh -
3 # Script to create a list of menu items for the keyboard selection.
4 # This is specific for SYSLINUX/ISOLINUX.
7 set -e
9 # Default values
11 location=/usr/share/keymaps/i386
12 output=keys_i386.cfg
14 echo ""
15 echo "Looking for keymaps at $location ..."
16 echo ""
18 # Compose header for 'output' file
20 cat << EOF > $output
21 MENU BEGIN keymap
22 MENU TITLE Keyboard map
24 EOF
26 # Search of keymaps
28 find $location \( ! -path '*fgGIod*' -a ! -path '*include*' \) | sort | \
29 while read -r line
31 test -f "$line" || continue;
33 category="${line%/*}"
34 category="${category##*/}" # Extract up the last level.
35 file="${line##*/}" # Full file name.
36 file="${file%.map*}" # Get the rid of file extension.
38 # Add body content to 'output' file
40 # Make default entry, help text
41 if test "${category}/$file" = qwerty/us
42 then
43 cat << EOF >> $output
44 LABEL ${category}/$file
45 MENU LABEL ^${category}/$file
46 MENU DEFAULT
47 COM32 cmd.c32
48 APPEND dragora RC_KEYMAP=${category}/$file
49 TEXT HELP
50 This menu is organized as keyboard "Layout/Language".
51 Select a keyboard map for the console before booting:
52 ${category}/$file [default]
53 ENDTEXT
55 EOF
56 continue;
59 cat << EOF >> $output
60 LABEL ${category}/$file
61 MENU LABEL ${category}/$file
62 COM32 cmd.c32
63 APPEND dragora RC_KEYMAP=${category}/$file
64 TEXT HELP
65 This menu is organized as keyboard "Layout/Language".
66 Select a keyboard map for the console before booting:
67 ${category}/$file
68 ENDTEXT
69 EOF
70 done
72 # Compose footer for 'output' file
74 cat << EOF >> $output
75 MENU SEPARATOR
77 LABEL return
78 MENU LABEL ^Return to main menu
79 MENU EXIT
80 MENU END
81 EOF
83 echo "Output file: $output"
84 echo ""