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 Inline Diff

platforms/livedvd-root/settings.inc
1 PRODUCT_NAME=livedvd 1 PRODUCT_NAME=livedvd
2 MEDIA=squash_xz 2 MEDIA=squash_xz
3 MULTITHREAD=1 3 MULTILANGUAGE="en it es fr"
4 4
5 if [ "$ARCH" = "i586" ]; then 5 if [ "$ARCH" = "i586" ]; then
6 KERNEL_EXTRAVER=mamba 6 KERNEL_EXTRAVER=mamba
7 KERNEL_PLATFORM="" 7 KERNEL_PLATFORM=""
8 #KERNEL_ADDITIONAL="extramodules sound" 8 #KERNEL_ADDITIONAL="extramodules sound"
9 KERNEL_MORE_EXTRAVER=mamba-64GB 9 KERNEL_MORE_EXTRAVER=mamba-64GB
10 elif [ "$ARCH" = "x86_64" ]; then 10 elif [ "$ARCH" = "x86_64" ]; then
11 KERNEL_EXTRAVER=mamba-x86_64 11 KERNEL_EXTRAVER=mamba-x86_64
12 KERNEL_PLATFORM="" 12 KERNEL_PLATFORM=""
13 #KERNEL_ADDITIONAL="vboxvideo" 13 #KERNEL_ADDITIONAL="vboxvideo"
14 KERNEL_MORE_EXTRAVER= 14 KERNEL_MORE_EXTRAVER=
15 MULTILANGUAGE="it en es fr"
16 fi 15 fi
17 16
18 TARGET_HOSTNAME=openmamba-livedvd 17 TARGET_HOSTNAME=openmamba-livedvd
19 ROOTDEV= 18 ROOTDEV=
20 ROOTFS= 19 ROOTFS=
21 20
22 APPLICATION_TARGET="BASE_PKGS OFFICE_PKGS MULTIMEDIA_PLAYERS_PKGS MULTIMEDIA_EDITING_PKGS INTERNET_PKGS GRAPHICS_PKGS GAMES_PKGS VIRTUALIZATION_PKGS" 21 APPLICATION_TARGET="BASE_PKGS OFFICE_PKGS MULTIMEDIA_PLAYERS_PKGS MULTIMEDIA_EDITING_PKGS INTERNET_PKGS GRAPHICS_PKGS GAMES_PKGS VIRTUALIZATION_PKGS"
23 22
platforms/livedvd/post.inc.sh
1 # livecd post script 1 # livecd post script
2 # 2 #
3 # creates a fake installation aimed at producing a kernel image and initrd 3 # creates a fake installation aimed at producing a kernel image and initrd
4 # for livecd boot 4 # for livecd boot
5 5
6 # make initramfs 6 # make initramfs
7 7
8 [ -e $MOUNTDIR2/boot/isolinux ] || mkdir -p $MOUNTDIR2/boot/isolinux 8 [ -e $MOUNTDIR2/boot/isolinux ] || mkdir -p $MOUNTDIR2/boot/isolinux
9 9
10 ISOID= 10 ISOID=
11 for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do 11 for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
12 chroot $MOUNTDIR depmod -a ${KERNEL_MAJVER}${K} 12 chroot $MOUNTDIR depmod -a ${KERNEL_MAJVER}${K}
13 LANG=${LANGUAGE}_${COUNTRY} chroot $MOUNTDIR dracut \ 13 LANG=${LANGUAGE}_${COUNTRY} chroot $MOUNTDIR dracut \
14 --filesystems "autofs4 ext3 ext4 overlayfs squashfs isofs reiserfs" \ 14 --filesystems "autofs4 ext3 ext4 overlayfs squashfs isofs reiserfs" \
15 --nomdadmconf --nolvmconf \ 15 --nomdadmconf --nolvmconf \
16 /boot/initramfs-${KERNEL_MAJVER}${K}.img.gz \ 16 /boot/initramfs-${KERNEL_MAJVER}${K}.img.gz \
17 ${KERNEL_MAJVER}${K} 17 ${KERNEL_MAJVER}${K}
18 18
19 # Note: isolinux requires 8.3 filenames 19 # Note: isolinux requires 8.3 filenames
20 cp $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${K}.img.gz \ 20 cp $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${K}.img.gz \
21 $MOUNTDIR2/boot/initrd${ISOID}.gz 21 $MOUNTDIR2/boot/initrd${ISOID}.gz
22 22
23 cp $MOUNTDIR/boot/vmlinuz-${KERNEL_MAJVER}${K} \ 23 cp $MOUNTDIR/boot/vmlinuz-${KERNEL_MAJVER}${K} \
24 $MOUNTDIR2/boot/vmlinuz${ISOID} 24 $MOUNTDIR2/boot/vmlinuz${ISOID}
25 25
26 ISOID=$(($ISOID + 1)) 26 ISOID=$(($ISOID + 1))
27 done 27 done
28 28
29 # add buildinfo 29 # add buildinfo
30 buildinfo="`cat $MOUNTDIR/etc/openmamba-release` ${PLATFORM}" 30 buildinfo="`cat $MOUNTDIR/etc/openmamba-release` ${PLATFORM}"
31 31
32 # configure isolinux boot loader 32 # configure isolinux boot loader
33 cat > $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF 33 cat > $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
34 PROMPT 0 34 PROMPT 0
35 TIMEOUT 20 35 TIMEOUT 20
36 DEFAULT vesamenu.c32 36 DEFAULT vesamenu.c32
37 MENU TITLE ${buildinfo} (${KERNEL_MAJVER} kernel) 37 MENU TITLE ${buildinfo} (${KERNEL_MAJVER} kernel)
38 MENU BACKGROUND openmamba.png 38 MENU BACKGROUND openmamba.png
39 MENU COLOR TITLE 1;32;49 #ff00993d #00000000 std 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 _EOF 44 _EOF
41 45
42 ISOID= 46 ISOID=
43 for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do 47 for l in $MULTILANGUAGE; do
44 cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF 48 case $l in
45 LABEL default-${KERNEL_MAJVER}${K} 49 "en") LABEL="English"; LOCALELANG="en_US.UTF-8"; VCONSOLEKEYMAP="us" ;;
46 MENU LABEL default (${KERNEL_MAJVER}${K}) 50 "it") LABEL="Italiano"; LOCALELANG="it_IT.UTF-8"; VCONSOLEKEYMAP="it" ;;
47 kernel /boot/vmlinuz${ISOID} 51 "fr") LABEL="Français"; LOCALELANG="fr_FR.UTF-8"; VCONSOLEKEYMAP="fr" ;;
48 append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=792 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 _EOF 59 _EOF
50 ISOID=$(($ISOID + 1))
51 done
52 60
53 echo "MENU SEPARATOR" >> $MOUNTDIR2/boot/isolinux/isolinux.cfg 61 ISOID=
54 ISOID= 62 for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
55 for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do 63 cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
56 cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF 64 LABEL default-${KERNEL_MAJVER}${K}
57 LABEL vga800-${KERNEL_MAJVER}${K} 65 MENU LABEL default (${KERNEL_MAJVER}${K} $l)
58 MENU LABEL VGA 800x600 no modeset (${KERNEL_MAJVER}${K}) 66 kernel /boot/vmlinuz${ISOID}
59 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
60 append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=789 nomodeset
61 _EOF 68 _EOF
62 ISOID=$(($ISOID + 1)) 69 ISOID=$(($ISOID + 1))
63 done 70 done
64 71
65 ISOID= 72 echo "MENU SEPARATOR" >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8
66 for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do 73 ISOID=
67 cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF 74 for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
68 LABEL vga1024-${KERNEL_MAJVER}${K} 75 cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
69 MENU LABEL VGA 1024x768 no modeset (${KERNEL_MAJVER}${K}) 76 LABEL vga800-${KERNEL_MAJVER}${K}
70 kernel /boot/vmlinuz${ISOID} 77 MENU LABEL VGA 800x600 no modeset (${KERNEL_MAJVER}${K} $l)
71 append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=792 nomodeset 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 _EOF 80 _EOF
73 ISOID=$(($ISOID + 1)) 81 ISOID=$(($ISOID + 1))
74 done 82 done
75 83
76 echo "MENU SEPARATOR" >> $MOUNTDIR2/boot/isolinux/isolinux.cfg 84 ISOID=
77 ISOID= 85 for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do
78 for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do 86 cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
79 cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF 87 LABEL vga1024-${KERNEL_MAJVER}${K}
80 LABEL debug-${KERNEL_MAJVER}${K} 88 MENU LABEL VGA 1024x768 no modeset (${KERNEL_MAJVER}${K} $l)
81 MENU LABEL Debug mode (${KERNEL_MAJVER}${K}) 89 kernel /boot/vmlinuz${ISOID}
82 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
83 append initrd=/boot/initrd${ISOID}.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 rddebug nomodeset
84 _EOF 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 done 109 done
87 110
88 cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF 111 cat >> $MOUNTDIR2/boot/isolinux/isolinux.cfg.utf8 << _EOF
89 MENU SEPARATOR 112 MENU SEPARATOR
90 LABEL memtest 113 LABEL memtest
91 MENU LABEL Memory test 114 MENU LABEL Memory test
92 kernel memtest 115 kernel memtest
93 MENU SEPARATOR 116 MENU SEPARATOR
94 MENU SEPARATOR 117 MENU SEPARATOR
95 LABEL - 118 LABEL -
96 MENU LABEL $PRODUCT_NAME build:`date -R` 119 MENU LABEL $PRODUCT_NAME build:`date -R`
97 MENU DISABLE 120 MENU DISABLE
98 _EOF 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 # install isolinux binary 127 # install isolinux binary
101 [ -e $MOUNTDIR/usr/share/syslinux/isolinux.bin ] && cp $MOUNTDIR/usr/share/syslinux/isolinux.bin $MOUNTDIR2/boot/isolinux/isolinux.bin || 128 [ -e $MOUNTDIR/usr/share/syslinux/isolinux.bin ] && cp $MOUNTDIR/usr/share/syslinux/isolinux.bin $MOUNTDIR2/boot/isolinux/isolinux.bin ||
102 { echo "Error: /usr/share/syslinux/isolinux.bin not found. Please install the syslinux package."; 129 { echo "Error: /usr/share/syslinux/isolinux.bin not found. Please install the syslinux package.";
103 exit 1; } 130 exit 1; }
104 131
105 # copy syslinux addons to final root /boot dir 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 # install memtest 135 # install memtest
109 [ -e $MOUNTDIR/boot/memtest.bin ] && cp $MOUNTDIR/boot/memtest.bin $MOUNTDIR2/boot/isolinux/memtest || 136 [ -e $MOUNTDIR/boot/memtest.bin ] && cp $MOUNTDIR/boot/memtest.bin $MOUNTDIR2/boot/isolinux/memtest ||
110 { echo "Error: /boot/memtest.bin not found. Please install the memtest86 package."; 137 { echo "Error: /boot/memtest.bin not found. Please install the memtest86 package.";
111 exit 1; } 138 exit 1; }
112 139
113 # copy static files for specific platform 140 # copy static files for specific platform
114 [ -e $TARGETDIR/platforms/$PLATFORM/root ] && 141 [ -e $TARGETDIR/platforms/$PLATFORM/root ] &&
115 cp -a --no-preserve=ownership $TARGETDIR/platforms/$PLATFORM/root/* $MOUNTDIR2/ 142 cp -a --no-preserve=ownership $TARGETDIR/platforms/$PLATFORM/root/* $MOUNTDIR2/
116 143
117 # copy localized static files for specific platform 144 # copy localized static files for specific platform
118 [ "$LANGUAGE" -a -e $TARGETDIR/platforms/$PLATFORM/root-$LANGUAGE ] && 145 [ "$LANGUAGE" -a -e $TARGETDIR/platforms/$PLATFORM/root-$LANGUAGE ] &&
119 cp -a --no-preserve=ownership $TARGETDIR/platforms/$PLATFORM/root-$LANGUAGE/* $MOUNTDIR2/ 146 cp -a --no-preserve=ownership $TARGETDIR/platforms/$PLATFORM/root-$LANGUAGE/* $MOUNTDIR2/
120 147
121 # add buildinfo 148 # add buildinfo
122 buildinfo="`cat $MOUNTDIR/etc/openmamba-release` [$PRODUCT_NAME build:`date +%c`]" 149 buildinfo="`cat $MOUNTDIR/etc/openmamba-release` [$PRODUCT_NAME build:`date +%c`]"
123 sed -i "s|%buildinfo%|$buildinfo|" $MOUNTDIR2/boot/isolinux/menu.txt 150 sed -i "s|%buildinfo%|$buildinfo|" $MOUNTDIR2/boot/isolinux/menu.txt
124 151
125 #echo "Adding binary packages from pkggroups.db..." 152 #echo "Adding binary packages from pkggroups.db..."
126 #. $LOCALSTATEDIR/.${MEDIA_NAMES[0]}.distinfo 153 #. $LOCALSTATEDIR/.${MEDIA_NAMES[0]}.distinfo
127 #LANG=${LANGUAGE:0:2} . $MOUNTDIR/usr/share/openmamba/pkggroups.db 154 #LANG=${LANGUAGE:0:2} . $MOUNTDIR/usr/share/openmamba/pkggroups.db
128 # 155 #
129 #add_binary_packages_to_repository $MOUNTDIR2/openmamba "$ALL_PKGS $EXTRA_PKGS" "$INSTALLED" 156 #add_binary_packages_to_repository $MOUNTDIR2/openmamba "$ALL_PKGS $EXTRA_PKGS" "$INSTALLED"
130 157
131 #echo "Generating APT database..." 158 #echo "Generating APT database..."
132 #ln -s RPMS/$arch $MOUNTDIR2/openmamba/RPMS.$arch 159 #ln -s RPMS/$arch $MOUNTDIR2/openmamba/RPMS.$arch
133 #genbasedir $MOUNTDIR2/openmamba 160 #genbasedir $MOUNTDIR2/openmamba
134 #mkdir $MOUNTDIR2/.disk 161 #mkdir $MOUNTDIR2/.disk
135 #cat $MOUNTDIR/etc/openmamba-release > $MOUNTDIR2/.disk/info 162 #cat $MOUNTDIR/etc/openmamba-release > $MOUNTDIR2/.disk/info
136 163
137 # Finally produce the media 164 # Finally produce the media
138 MOUNTDIR=$MOUNTDIR2 produce_media $MEDIA_NAME 165 MOUNTDIR=$MOUNTDIR2 produce_media $MEDIA_NAME
139 166
140 for i in $SUBPLATFORM; do 167 for i in $SUBPLATFORM; do
141 . $TARGETDIR/platforms/$i/settings.inc 168 . $TARGETDIR/platforms/$i/settings.inc
142 CURR_MEDIA_NAME=`PLATFORM=$i media_name` 169 CURR_MEDIA_NAME=`PLATFORM=$i media_name`
143 cat >> $LOCALSTATEDIR/.$MEDIA_NAME.inc.html << _EOF 170 cat >> $LOCALSTATEDIR/.$MEDIA_NAME.inc.html << _EOF
144 <br><p><b>Root target(s):</b> 171 <br><p><b>Root target(s):</b>
145 <div><table width="90%"><tr><td> 172 <div><table width="90%"><tr><td>
146 _EOF 173 _EOF
147 cat $LOCALSTATEDIR/.$CURR_MEDIA_NAME.inc.html >> \ 174 cat $LOCALSTATEDIR/.$CURR_MEDIA_NAME.inc.html >> \
148 $LOCALSTATEDIR/.$MEDIA_NAME.inc.html 175 $LOCALSTATEDIR/.$MEDIA_NAME.inc.html
149 echo "</td></tr></table></div>" >> $LOCALSTATEDIR/.$MEDIA_NAME.inc.html 176 echo "</td></tr></table></div>" >> $LOCALSTATEDIR/.$MEDIA_NAME.inc.html
platforms/livedvd/settings.inc
1 MEDIA=iso 1 MEDIA=iso
2 MULTITHREAD=1 2 MULTILANGUAGE="en it es fr"
3 DISTROMATIC=off 3 DISTROMATIC=off
4 4
5 if [ "$ARCH" = "i586" ]; then 5 if [ "$ARCH" = "i586" ]; then
6 KERNEL_EXTRAVER=mamba 6 KERNEL_EXTRAVER=mamba
7 KERNEL_PLATFORM="" 7 KERNEL_PLATFORM=""
8 #KERNEL_ADDITIONAL="vboxvideo" 8 #KERNEL_ADDITIONAL="vboxvideo"
9 KERNEL_MORE_EXTRAVER=mamba-64GB 9 KERNEL_MORE_EXTRAVER=mamba-64GB
10 elif [ "$ARCH" = "x86_64" ]; then 10 elif [ "$ARCH" = "x86_64" ]; then
11 KERNEL_EXTRAVER=mamba-x86_64 11 KERNEL_EXTRAVER=mamba-x86_64
12 KERNEL_PLATFORM="" 12 KERNEL_PLATFORM=""
13 #KERNEL_ADDITIONAL="vboxvideo" 13 #KERNEL_ADDITIONAL="vboxvideo"
14 KERNEL_MORE_EXTRAVER= 14 KERNEL_MORE_EXTRAVER=
15 fi 15 fi
16 16
17 [ "$SUBPLATFORM" ] || { 17 [ "$SUBPLATFORM" ] || {
18 SUBPLATFORM="livedvd-root" 18 SUBPLATFORM="livedvd-root"
19 PRODUCT_NAME="livedvd" 19 PRODUCT_NAME="livedvd"
20 } 20 }
21 PRODUCT_NAME_OVERRIDE=livedvd 21 PRODUCT_NAME_OVERRIDE=livedvd
22 TARGET_HOSTNAME=openmamba-livedvd 22 TARGET_HOSTNAME=openmamba-livedvd
23 ROOTDEV=/dev/sda1 23 ROOTDEV=/dev/sda1
24 ROOTFS=ext3 24 ROOTFS=ext3
25 APPLICATION_TARGET= 25 APPLICATION_TARGET=
26 26