Commit 37851f40 authored by amnesia's avatar amnesia

build multilingual images

- (test-)supported languages are: ar de en es fr it pt; ru and zh are not part
  of them as I don't know which fonts / input methods are needed to properly
  support these languages
- install localization iceweasel's and openoffice.org's l10n packages for every
  supported language
- do most locale-dependent configuration at boot time rather than at build time
- ugly hacko to tweak generated syslinux configuration in order to add
  language-choosing menu, and remove failsafe entry for now; will need to be
  somehow re-added at some point
parent 65db54a2
......@@ -17,6 +17,7 @@ rm -rf cache/stages_rootfs
# build the doc wiki
./build-wiki
# FIXME: do this at boot time, if possible
if [ -r config/binary_local-includes/doc/amnesia/wiki/index.${LH_LANGUAGE}.html ]; then
cp config/binary_local-includes/doc/amnesia/wiki/index.${LH_LANGUAGE}.html \
config/binary_local-includes/doc/amnesia/wiki/index.html
......@@ -56,7 +57,7 @@ for BUILD_TYPE in ${AMNESIA_IMAGES} ; do
exit 1
;;
esac
BUILD_BASENAME="amnesia-${LH_ARCHITECTURE}-${AMNESIA_BASE}-${LH_LANGUAGE}-${AMNESIA_VERSION}-${AMNESIA_TODAY}"
BUILD_BASENAME="amnesia-${LH_ARCHITECTURE}-${AMNESIA_BASE}-${AMNESIA_VERSION}-${AMNESIA_TODAY}"
BUILD_DEST_FILENAME="${BUILD_BASENAME}.${BUILD_FILENAME_EXT}"
BUILD_MANIFEST="${BUILD_DEST_FILENAME}.list"
BUILD_PACKAGES="${BUILD_DEST_FILENAME}.packages"
......
......@@ -15,6 +15,7 @@ $RUN_LH_CONFIG --distribution lenny ${@}
# set Amnesia's general options
$RUN_LH_CONFIG \
--apt-recommends false \
--bootappend-live "${AMNESIA_APPEND}" \
--cache-stages "bootstrap rootfs" \
--archive-areas "main contrib non-free" \
--hostname="amnesia" \
......@@ -43,47 +44,13 @@ elif [ "$hw_arch" = powerpc -o "$hw_arch" = powerpc64 ]; then
${@}
fi
# locale-dependent configuration
. config/chroot
case "${LH_LANGUAGE}" in
de)
AMNESIA_APPEND="${AMNESIA_APPEND} locale=de_DE.UTF-8 keyb=de timezone=Europe/Berlin"
;;
en)
AMNESIA_APPEND="${AMNESIA_APPEND} locale=en_US.UTF-8 keyb=us timezone=America/Detroit"
;;
fr)
AMNESIA_APPEND="${AMNESIA_APPEND} locale=fr_FR.UTF-8 keyb=fr timezone=Europe/Paris"
;;
*)
;;
esac
$RUN_LH_CONFIG --bootappend-live "${AMNESIA_APPEND}" ${@}
case "${LH_LANGUAGE}" in
de|fr|en)
ADD_PACKAGES_LISTS="amnesia-${AMNESIA_BASE} amnesia-${LH_LANGUAGE}"
;;
*)
ADD_PACKAGES_LISTS="amnesia-${AMNESIA_BASE}"
;;
esac
# packages lists
ADD_PACKAGES_LISTS="amnesia-${AMNESIA_BASE}"
for basename in ${ADD_PACKAGES_LISTS} ; do
cp "config/chroot_local-packageslists/${basename}" \
"config/chroot_local-packageslists/${basename}.list"
done
case "${LH_LANGUAGE}" in
fr)
ln -s "/usr/local/bin/nautilus-wipe.${LH_LANGUAGE}" \
config/chroot_local-includes/home/amnesia/.gnome2/nautilus-scripts/Effacer_definitivement
;;
*)
ln -s "/usr/local/bin/nautilus-wipe" \
config/chroot_local-includes/home/amnesia/.gnome2/nautilus-scripts/Securely_erase
;;
esac
# version
mkdir -p config/chroot_local-includes/etc/amnesia/
echo "${AMNESIA_FULL_VERSION}" > config/chroot_local-includes/etc/amnesia/version
......
......@@ -167,3 +167,6 @@ AMNESIA_FULL_VERSION="${AMNESIA_VERSION} - ${AMNESIA_TODAY}"
AMNESIA_DEV_FULLNAME="amnesia"
AMNESIA_DEV_EMAIL="amnesia@boum.org"
AMNESIA_DEV_KEYID="F93E735F"
# Supported languages
AMNESIA_SUPPORTED_LANGUAGES="ar de en es fr it pt"
#!/bin/bash
# Including common functions
. "${LH_BASE:-/usr/share/live-helper}"/live-helper.sh
# Setting static variables
DESCRIPTION="$(Echo 'internationalizing the syslinux menu')"
HELP=""
USAGE="${PROGRAM}"
# Reading configuration files
Read_conffiles config/all config/common config/binary
Set_defaults
if [ "${LH_BOOTLOADER}" != "syslinux" ]
then
exit 0
fi
Echo_message "internationalizing the syslinux menu"
# Get AMNESIA_SUPPORTED_LANGUAGES
. config/amnesia
if [ -e config/amnesia.local ] ; then
. config/amnesia.local
fi
# Setting boot method specific variables
case "${LH_BINARY_IMAGES}" in
iso)
SYSLINUX_PATH="binary/isolinux"
;;
usb-hdd)
SYSLINUX_PATH="binary/syslinux"
;;
esac
# Setting variables
SYSLINUX_LIVE_CFG="${SYSLINUX_PATH}/live.cfg"
ORIG_SYSLINUX_LIVE_CFG="${SYSLINUX_PATH}/live.cfg.orig"
CFG_SNIPPET="${SYSLINUX_PATH}/tmp.cfg"
# Backup the original live.cfg
mv "${SYSLINUX_LIVE_CFG}" "${ORIG_SYSLINUX_LIVE_CFG}"
# Get needed values from the original live.cfg
ORIG_KERNEL="`grep -E --max-count=1 '^[ ]+kernel ' "${ORIG_SYSLINUX_LIVE_CFG}"`"
ORIG_APPEND="`grep -E --max-count=1 '^[ ]+append ' "${ORIG_SYSLINUX_LIVE_CFG}"`"
# Sanity checks
if [ -z "${ORIG_KERNEL}" ]; then
Echo_error "Could not parse kernel line in ${ORIG_SYSLINUX_LIVE_CFG}"
exit 15
fi
if [ -z "${ORIG_APPEND}" ]; then
Echo_error "Could not parse append line in ${ORIG_SYSLINUX_LIVE_CFG}"
exit 16
fi
# Add menu entries
for LANG_CODE in ${AMNESIA_SUPPORTED_LANGUAGES}; do
case "${LANG_CODE}" in
ar)
LANG_NAME='^Arabic'
LANG_APPEND='locale=ar' # FIXME: probably suboptimal
;;
de)
LANG_NAME='^German'
LANG_APPEND='locale=de_DE.UTF-8 keyb=de timezone=Europe/Berlin'
;;
en)
LANG_NAME='^English'
LANG_APPEND='locale=en_US.UTF-8 keyb=us timezone=America/Detroit'
;;
es)
LANG_NAME='^Spanish'
LANG_APPEND='locale=es keyb=es'
;;
fr)
LANG_NAME='^French'
LANG_APPEND='locale=fr_FR.UTF-8 keyb=fr timezone=Europe/Paris'
;;
it)
LANG_NAME='^Italian'
LANG_APPEND='locale=it'
;;
pt)
LANG_NAME='^Portuguese'
LANG_APPEND='locale=pt'
;;
ru)
LANG_NAME='^Russian'
LANG_APPEND='locale=ru'
;;
zh)
LANG_NAME='^Chinese'
LANG_APPEND='locale=zh_CN.UTF-8 keyb=zh'
;;
*)
Echo_error "Language ${LANG_CODE} is not supported yet, ask amnesia developpers!"
exit 17
;;
esac
echo "label amnesia-${LANG_CODE}" >> "${CFG_SNIPPET}"
echo " menu label ${LANG_NAME}" >> "${CFG_SNIPPET}"
if [ "${LANG_CODE}" = 'en' ]; then
echo ' menu default' >> "${CFG_SNIPPET}"
fi
echo "${ORIG_KERNEL}" >> "${CFG_SNIPPET}"
echo "${ORIG_APPEND} ${LANG_APPEND}" >> "${CFG_SNIPPET}"
cat "${CFG_SNIPPET}" >> "${SYSLINUX_LIVE_CFG}"
rm -f "${CFG_SNIPPET}"
done
# Cleanup
rm -f "${ORIG_SYSLINUX_LIVE_CFG}"
#!/bin/sh
#set -e
# initramfs-tools header
PREREQ=""
prereqs()
{
echo "${PREREQ}"
}
case "${1}" in
prereqs)
prereqs
exit 0
;;
esac
# live-initramfs header
if [ -n "${NOUSER}" ]
then
exit 0
fi
. /scripts/live-functions
log_begin_msg "Adding a localized secure-delete action to Nautilus"
# live-initramfs script
case "${LANGUAGE}" in
fr)
NAME="Effacer_definitivement"
;;
*)
NAME="Securely_erase"
;;
esac
if [ -x "/root/usr/local/bin/nautilus-wipe.${LANGUAGE}" ]; then
DEST="/usr/local/bin/nautilus-wipe.${LANGUAGE}"
else
DEST="/usr/local/bin/nautilus-wipe"
fi
chroot /root sudo -H -u "${USERNAME}" ln -s "${DEST}" "${HOME}/.gnome2/nautilus-scripts/${NAME}"
log_end_msg
......@@ -59,12 +59,26 @@ gstreamer0.10-plugins-base
gstreamer0.10-plugins-good
gstreamer0.10-plugins-ugly
iceweasel
iceweasel-l10n-ar
iceweasel-l10n-de
iceweasel-l10n-es-es
iceweasel-l10n-fr
iceweasel-l10n-it
iceweasel-l10n-pt-pt
iceweasel-torbutton/testing
iptables
less
localepurge
lvm2
macchanger
# manpages
# manpages-de
# manpages-es
# manpages-es-extra
# manpages-fr
# manpages-fr-extra
# manpages-it
# manpages-pt
msmtp
mutt
network-manager-gnome
......@@ -72,6 +86,12 @@ ntfs-3g
ntfsprogs
ntpdate
openoffice.org
openoffice.org-l10n-ar
openoffice.org-l10n-de
openoffice.org-l10n-es
openoffice.org-l10n-fr
openoffice.org-l10n-it
openoffice.org-l10n-pt
openoffice.org-hyphenation-en-us
openoffice.org-thesaurus-en-us
openssh-client
......@@ -115,3 +135,8 @@ xserver-xorg-input-all
xserver-xorg-video-geode
#endif
xserver-xorg-video-all
### l10n, i18n
# arabic fonts
ttf-kacst
ttf-farsiweb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment