Commit 69bf3cc142af6981c4fddf9664d25356313bbf84

Authored by Silvan Calarco
1 parent 4484bac95e
Exists in master

livedvd: implemented syslinux multilanguage menu

Showing 3 changed files with 70 additions and 44 deletions Side-by-side Diff

platforms/livedvd-root/settings.inc
1 1 PRODUCT_NAME=livedvd
2 2 MEDIA=squash_xz
3   -MULTITHREAD=1
  3 +MULTILANGUAGE="en it es fr"
4 4  
5 5 if [ "$ARCH" = "i586" ]; then
6 6 KERNEL_EXTRAVER=mamba
... ... @@ -12,7 +12,6 @@
12 12 KERNEL_PLATFORM=""
13 13 #KERNEL_ADDITIONAL="vboxvideo"
14 14 KERNEL_MORE_EXTRAVER=
15   - MULTILANGUAGE="it en es fr"
16 15 fi
17 16  
18 17 TARGET_HOSTNAME=openmamba-livedvd
platforms/livedvd/post.inc.sh
... ... @@ -30,62 +30,85 @@
30 30 buildinfo="`cat $MOUNTDIR/etc/openmamba-release` ${PLATFORM}"
31 31  
32 32 # configure isolinux boot loader
33   -cat > $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF
  33 +cat > $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
34 34 PROMPT 0
35 35 TIMEOUT 20
36 36 DEFAULT vesamenu.c32
37 37 MENU TITLE ${buildinfo} (${KERNEL_MAJVER} kernel)
38 38 MENU BACKGROUND openmamba.png
39 39 MENU COLOR TITLE 1;32;49 #ff00993d #00000000 std
  40 +
  41 +LABEL -
  42 + MENU LABEL Please select system startup language:
  43 + MENU DISABLE
40 44 _EOF
41 45  
42 46 ISOID=
43   -for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
44   - cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF
45   -LABEL default-${KERNEL_MAJVER}${K}
46   -MENU LABEL default (${KERNEL_MAJVER}${K})
47   - kernel /boot/vmlinuz${ISOID}
48   - append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=792
  47 +for l in $MULTILANGUAGE; do
  48 + case $l in
  49 + "en") LABEL="English"; LOCALELANG="en_US.UTF-8"; VCONSOLEKEYMAP="us" ;;
  50 + "it") LABEL="Italiano"; LOCALELANG="it_IT.UTF-8"; VCONSOLEKEYMAP="it" ;;
  51 + "fr") LABEL="Français"; LOCALELANG="fr_FR.UTF-8"; VCONSOLEKEYMAP="fr" ;;
  52 + "es") LABEL="Español"; LOCALELANG="es_ES.UTF-8"; VCONSOLEKEYMAP="es" ;;
  53 + *) LABEL="$l"
  54 + esac
  55 + cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
  56 +MENU BEGIN $l
  57 + MENU LABEL $LABEL
  58 + MENU TITLE ${buildinfo} (${KERNEL_MAJVER} kernel)
49 59 _EOF
50   - ISOID=$(($ISOID + 1))
51   -done
52 60  
53   -echo "MENU SEPARATOR" >> $MOUNTDIR2/boot/isolinux/isolinux.cfg
54   -ISOID=
55   -for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
56   - cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF
57   -LABEL vga800-${KERNEL_MAJVER}${K}
58   -MENU LABEL VGA 800x600 no modeset (${KERNEL_MAJVER}${K})
59   - kernel /boot/vmlinuz${ISOID}
60   - append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=789 nomodeset
  61 + ISOID=
  62 + for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
  63 + cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
  64 + LABEL default-${KERNEL_MAJVER}${K}
  65 + MENU LABEL default (${KERNEL_MAJVER}${K} $l)
  66 + kernel /boot/vmlinuz${ISOID}
  67 + append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=792 locale.LANG=$LOCALELANG vconsole.keymap=$VCONSOLEKEYMAP
61 68 _EOF
62   - ISOID=$(($ISOID + 1))
63   -done
  69 + ISOID=$(($ISOID + 1))
  70 + done
64 71  
65   -ISOID=
66   -for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
67   - cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF
68   -LABEL vga1024-${KERNEL_MAJVER}${K}
69   -MENU LABEL VGA 1024x768 no modeset (${KERNEL_MAJVER}${K})
70   - kernel /boot/vmlinuz${ISOID}
71   - append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=792 nomodeset
  72 + echo "MENU SEPARATOR" >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8
  73 + ISOID=
  74 + for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
  75 + cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
  76 + LABEL vga800-${KERNEL_MAJVER}${K}
  77 + MENU LABEL VGA 800x600 no modeset (${KERNEL_MAJVER}${K} $l)
  78 + kernel /boot/vmlinuz${ISOID}
  79 + append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=789 locale.LANG=$LOCALELANG vconsole.keymap=$VCONSOLEKEYMAP nomodeset
72 80 _EOF
73   - ISOID=$(($ISOID + 1))
74   -done
  81 + ISOID=$(($ISOID + 1))
  82 + done
75 83  
76   -echo "MENU SEPARATOR" >> $MOUNTDIR2/boot/isolinux/isolinux.cfg
77   -ISOID=
78   -for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
79   - cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF
80   -LABEL debug-${KERNEL_MAJVER}${K}
81   -MENU LABEL Debug mode (${KERNEL_MAJVER}${K})
82   - kernel /boot/vmlinuz${ISOID}
83   - append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 rddebug nomodeset
  84 + ISOID=
  85 + for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
  86 + cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
  87 + LABEL vga1024-${KERNEL_MAJVER}${K}
  88 + MENU LABEL VGA 1024x768 no modeset (${KERNEL_MAJVER}${K} $l)
  89 + kernel /boot/vmlinuz${ISOID}
  90 + append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=792 locale.LANG=$LOCALELANG vconsole.keymap=$VCONSOLEKEYMAP nomodeset
84 91 _EOF
85   - ISOID=$(($ISOID + 1))
  92 + ISOID=$(($ISOID + 1))
  93 + done
  94 +
  95 + echo "MENU SEPARATOR" >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8
  96 + ISOID=
  97 + for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
  98 + cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
  99 + LABEL debug-${KERNEL_MAJVER}${K}
  100 + MENU LABEL Debug mode (${KERNEL_MAJVER}${K} $l)
  101 + kernel /boot/vmlinuz${ISOID}
  102 + append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 locale.LANG=$LOCALELANG vconsole.keymap=$VCONSOLEKEYMAP rddebug nomodeset
  103 +_EOF
  104 + ISOID=$(($ISOID + 1))
  105 + done
  106 + cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
  107 +MENU END
  108 +_EOF
86 109 done
87 110  
88   -cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF
  111 +cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
89 112 MENU SEPARATOR
90 113 LABEL memtest
91 114 MENU LABEL Memory test
92 115  
... ... @@ -97,13 +120,17 @@
97 120 MENU DISABLE
98 121 _EOF
99 122  
  123 +# convert isolinux.cfg from UTF-8 to CP437
  124 +iconv -f utf-8 -t cp437 $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 > $MOUNTDIR2/boot/isolinux/isolinux.cfg
  125 +rm -f $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8
  126 +
100 127 # install isolinux binary
101 128 [ -e $MOUNTDIR/usr/share/syslinux/isolinux.bin ] && cp $MOUNTDIR/usr/share/syslinux/isolinux.bin $MOUNTDIR2/boot/isolinux/isolinux.bin ||
102 129 { echo "Error: /usr/share/syslinux/isolinux.bin not found. Please install the syslinux package.";
103 130 exit 1; }
104 131  
105 132 # copy syslinux addons to final root /boot dir
106   -cp $MOUNTDIR/usr/share/syslinux/{ldlinux,libcom32,libutil,vesamenu}.c32 $MOUNTDIR2/boot/isolinux/
  133 +cp $MOUNTDIR/usr/share/syslinux/vesamenu.c32 $MOUNTDIR2/boot/isolinux/
107 134  
108 135 # install memtest
109 136 [ -e $MOUNTDIR/boot/memtest.bin ] && cp $MOUNTDIR/boot/memtest.bin $MOUNTDIR2/boot/isolinux/memtest ||
platforms/livedvd/settings.inc
1 1 MEDIA=iso
2   -MULTITHREAD=1
  2 +MULTILANGUAGE="en it es fr"
3 3 DISTROMATIC=off
4 4  
5 5 if [ "$ARCH" = "i586" ]; then