Commit 996b5304 authored by Tails developers's avatar Tails developers
Browse files

Merge branch 'feature/multikernel-light' into feature/tails-greeter

parents 3ba38867 c9e8ff30
......@@ -41,12 +41,12 @@ $RUN_LB_CONFIG \
--initramfs=live-boot \
${@}
# build i386 images on amd64 as well, include only 686 kernel
# build i386 images on amd64 as well, include a bunch of kernels
hw_arch="`dpkg --print-architecture`"
if [ "$hw_arch" = i386 -o "$hw_arch" = amd64 ]; then
$RUN_LB_CONFIG \
--architecture i386 \
--linux-flavours 486 \
--linux-flavours "486 686-pae amd64" \
${@}
# build powerpc images on powerpc64 as well, include only powerpc kernel
elif [ "$hw_arch" = powerpc -o "$hw_arch" = powerpc64 ]; then
......
#!/bin/bash
# Including common functions
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.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 [ "${LB_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 "${LB_BINARY_IMAGES}" in
iso|iso-hybrid)
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
# Make sure all languages are visible in the menu
NUM_LANGUAGES="$(echo ${AMNESIA_SUPPORTED_LANGUAGES} | wc -w)"
echo "menu vshift $[24-${NUM_LANGUAGES}]" >> "${SYSLINUX_LIVE_CFG}"
echo "menu rows ${NUM_LANGUAGES}" >> "${SYSLINUX_LIVE_CFG}"
# Add menu entries
for LANG_CODE in ${AMNESIA_SUPPORTED_LANGUAGES}; do
case "${LANG_CODE}" in
ar)
LANG_NAME='^Arabic'
LANG_APPEND='locales=ar_EG.UTF-8 keyboard-layouts=us,ara'
;;
de)
LANG_NAME='^German'
LANG_APPEND='locales=de_DE.UTF-8 keyboard-layouts=de'
;;
en)
LANG_NAME='^English'
LANG_APPEND=''
;;
es)
LANG_NAME='^Spanish'
LANG_APPEND='locales=es keyboard-layouts=es'
;;
fa)
LANG_NAME='Fa^rsi'
LANG_APPEND='locales=fa_IR.UTF-8 keyboard-layouts=us,ir'
;;
fr)
LANG_NAME='^French'
LANG_APPEND='locales=fr_FR.UTF-8 keyboard-layouts=fr'
;;
it)
LANG_NAME='^Italian'
LANG_APPEND='locales=it keyboard-layouts=it'
;;
pt)
LANG_NAME='^Portuguese'
LANG_APPEND='locales=pt keyboard-layouts=pt'
;;
ru)
LANG_NAME='R^ussian'
LANG_APPEND='locales=ru keyboard-layouts=us,ru'
;;
vi)
LANG_NAME='^Vietnamese'
LANG_APPEND='locales=vi_VN.UTF-8 keyboard-layouts=vn'
;;
zh)
LANG_NAME='^Chinese'
LANG_APPEND='locales=zh_CN.UTF-8'
;;
*)
Echo_error "Language ${LANG_CODE} is not supported yet, ask Tails developpers!"
exit 17
;;
esac
echo "label tails-${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}"
......@@ -138,6 +138,14 @@ Package: linux-headers-486
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-headers-686-pae
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-headers-amd64
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-headers-2.6-common
Pin: release o=Debian,a=unstable
Pin-Priority: 999
......@@ -146,6 +154,14 @@ Package: linux-headers-2.6-486
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-headers-2.6-686-pae
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-headers-2.6-amd64
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-headers-3.2.0-2-common
Pin: release o=Debian,a=unstable
Pin-Priority: 999
......@@ -154,18 +170,50 @@ Package: linux-headers-3.2.0-2-486
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-headers-3.2.0-2-686-pae
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-headers-3.2.0-2-amd64
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-image-486
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-image-686-pae
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-image-amd64
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-image-2.6-486
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-image-2.6-686-pae
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-image-2.6-amd64
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-image-3.2.0-2-486
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-image-3.2.0-2-686-pae
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-image-3.2.0-2-amd64
Pin: release o=Debian,a=unstable
Pin-Priority: 999
Package: linux-kbuild-3.2
Pin: release o=Debian,a=unstable
Pin-Priority: 999
......
......@@ -7,13 +7,8 @@ if [ "$hw_arch" != i386 -a "$hw_arch" != amd64 ]; then
exit 0
fi
# Get version information for the (newest) installed kernel.
KERNEL="`/bin/ls -1 /boot/vmlinuz-* | tail -n 1`"
KERNEL_VERSION="$(basename ${KERNEL} | sed -e 's|vmlinuz-||')"
KERNEL_ARCH="$(basename ${KERNEL} | sed -e 's|.*-||')"
# the -dkms package must be installed *after* dkms to be properly registered
apt-get install --yes build-essential dkms dpatch linux-headers-2.6-${KERNEL_ARCH}
apt-get install --yes build-essential dkms dpatch
# temporary workaround: pretend gcc-4.6 is available, so that
# the modules can build.
......@@ -22,27 +17,35 @@ apt-get install --yes build-essential dkms dpatch linux-headers-2.6-${KERNEL_ARC
apt-get install --yes gcc-4.4
ln -s /usr/bin/gcc-4.4 /usr/bin/gcc-4.6
# dkms uses uname to find out what kernel to build modules for.
# So, after installing dkms, but before installing
# virtualbox-guest-dkms, we divert uname to a fake one that
# emulates 'uname -r' by reporting the kernel version found in /boot rather
# than the build system's one.
# Have the modules built for every installed kernel
for KERNEL in /boot/vmlinuz-* ; do
KERNEL_VERSION="$(basename ${KERNEL} | sed -e 's|vmlinuz-||')"
KERNEL_ARCH="$(basename ${KERNEL} | sed -e 's|.*-||')"
apt-get install --yes linux-headers-2.6-${KERNEL_ARCH}
# dkms uses uname to find out what kernel to build modules for.
# So, after installing dkms, but before installing
# virtualbox-guest-dkms, we divert uname to a fake one that
# emulates 'uname -r' by reporting the kernel version found in /boot rather
# than the build system's one.
mv /bin/uname /bin/uname.$$
cat > /bin/uname <<EOF
mv /bin/uname /bin/uname.$$
cat > /bin/uname <<EOF
#! /bin/sh
echo "$KERNEL_VERSION"
EOF
chmod 755 /bin/uname
chmod 755 /bin/uname
# Have the modules automagically built by dkms.
# Also, at this time of the build, we've got a recent enough X.Org installed,
# so we can install the X11 tools eventually.
dpkg --install /usr/share/amnesia/packages/virtualbox*.deb
apt-get -f install --yes
# Have the modules automagically built by dkms for all kernels.
# Also, at this time of the build, we've got a recent enough X.Org installed,
# so we can install the X11 tools eventually.
dpkg --install /usr/share/amnesia/packages/virtualbox*.deb
apt-get -f install --yes
# Revert to the real uname.
mv /bin/uname.$$ /bin/uname
# Revert to the real uname.
mv /bin/uname.$$ /bin/uname
done
# clean the build directory
rm -rf /var/lib/dkms/virtualbox-guest/
......
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