Centralize localtime setting from paltforms to main makedist.inc.sh

Also added configuration for calamares (maybe will move this to calamares script next)
This commit is contained in:
Silvan Calarco 2015-02-20 13:48:32 +01:00
parent ce9d14ac4b
commit 16127b652d
10 changed files with 30 additions and 85 deletions

View File

@ -85,6 +85,19 @@ fi
echo "$TARGET_HOSTNAME.$TARGET_DOMAIN" > $MOUNTDIR/etc/hostname
# set timezone according to LANGUAGE (default is UTC)
if [ ! "$MULTILANGUAGE" ]; then
case $LANGUAGE in
de) region="Europe"; zone="Berlin" ;;
it) region="Europe"; zone="Rome" ;;
es) region="Europe"; zone="Madrid" ;;
fi) region="Europe"; zone="Paris" ;;
*) region="Europe"; zone="London" ;;
esac
timezone="$region/$zone"
ln -s ../usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
fi
if [ "$PREPLATFORM_TARGET" ]; then
install_rpms_by_target "Installing ${PLATFORM} pre-platform workaround packages" ${MAKEDIST_TARGET}-${PREPLATFORM_TARGET} "${RPMEXTRAARGS}"
fi
@ -118,6 +131,23 @@ ONBOOT=yes
_EOF
fi
# configure calamares installer if present
if [ ! "$MULTILANGUAGE" ]; then
if [ -e $MOUNTDIR/etc/calamares/modules/locale.conf ]; then
sed -i "s|^region:.*|region: \"$region\"|" $MOUNTDIR/etc/calamares/modules/locale.conf
sed -i "s|^zone:.*|zone: \"$zone\"|" $MOUNTDIR/etc/calamares/modules/locale.conf
fi
fi
if [ -e $MOUNTDIR/etc/calamares/branding/openmamba/branding.desc ]; then
(
. $MOUNTDIR/etc/os-release
sed -i "s|\(version:[ \t]*\).*|\1$VERSION|" $MOUNTDIR/etc/calamares/branding/openmamba/branding.desc
sed -i "s|\(shortVersion:[ \t]*\).*|\1$VERSION_ID|" $MOUNTDIR/etc/calamares/branding/openmamba/branding.desc
sed -i "s|\(versionedName:[ \t]*\).*|\1$PRETTY_NAME|" $MOUNTDIR/etc/calamares/branding/openmamba/branding.desc
sed -i "s|\(shortVersionedName:[ \t]*\).*|\1$ID $VERSION_ID|" $MOUNTDIR/etc/calamares/branding/openmamba/branding.desc
)
fi
# delete unused localizations
#
if [ ! "$MULTILANGUAGE" ]; then

View File

@ -16,15 +16,6 @@ chroot $MOUNTDIR gtk-update-icon-cache /usr/share/icons/hicolor
# FIXME: ensure alternatives are correclty set
chroot $MOUNTDIR update-alternatives-set-dri
# set timezone according to LANGUAGE (default is UTC)
#
case $LANGUAGE in
it) timezone=Europe/Rome ;;
es) timezone=Europe/Madrid ;;
*) timezone=UTC ;;
esac
ln -s ../usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
# clean rpm database before doing other operations with internal rpm
# to fix cross x86/x86_64 installation error:
# error: db4 error(-30986) from dbcursor->get: DB_PAGE_NOTFOUND: Requested page not found

View File

@ -5,15 +5,6 @@ sed -i "s|# autologin.*|autologin=liveuser|" $MOUNTDIR/etc/lxdm/lxdm.conf
# FIXME: ensure alternatives are correclty set
chroot $MOUNTDIR update-alternatives-set-dri
# set timezone according to LANGUAGE (default is UTC)
#
case $LANGUAGE in
it) timezone=Europe/Rome ;;
es) timezone=Europe/Madrid ;;
*) timezone=UTC ;;
esac
ln -s ../usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
# clean rpm database before doing other operations with internal rpm
# to fix cross x86/x86_64 installation error:
# error: db4 error(-30986) from dbcursor->get: DB_PAGE_NOTFOUND: Requested page not found

View File

@ -12,15 +12,6 @@ fi
# FIXME: ensure alternatives are correclty set
chroot $MOUNTDIR update-alternatives-set-dri
# set timezone according to LANGUAGE (default is UTC)
#
case $LANGUAGE in
it) timezone=Europe/Rome ;;
es) timezone=Europe/Madrid ;;
*) timezone=UTC ;;
esac
ln -s ../usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
# configure favorites in kde menu
for f in /usr/share/applications/chromium-devel.desktop; do
chroot $MOUNTDIR /opt/kde/bin/kickoffcfg --add-favorite $f || exit 1

View File

@ -12,20 +12,6 @@ fi
# FIXME: ensure alternatives are correclty set
chroot $MOUNTDIR update-alternatives-set-dri
# set timezone according to LANGUAGE (default is UTC)
#
if [ ! "$MULTILANGUAGE" ]; then
case $LANGUAGE in
it) timezone=Europe/Rome ;;
es) timezone=Europe/Madrid ;;
fr) timezone=Europe/Paris ;;
de) timezone=Europe/Berlin ;;
en) timezone=Europe/London ;;
*) timezone=UTC ;;
esac
ln -s ../usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
fi
# configure favorites in kde menu
for f in /usr/share/applications/chromium-devel.desktop /opt/kde/share/applications/amarok.desktop; do
chroot $MOUNTDIR /opt/kde/bin/kickoffcfg --add-favorite $f

View File

@ -12,15 +12,6 @@ fi
# FIXME: ensure alternatives are correclty set
chroot $MOUNTDIR update-alternatives-set-dri
# set timezone according to LANGUAGE (default is UTC)
#
case $LANGUAGE in
it) timezone=Europe/Rome ;;
es) timezone=Europe/Madrid ;;
*) timezone=UTC ;;
esac
ln -s ../usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
# configure favorites in kde menu
for f in /usr/share/applications/chromium-devel.desktop; do
chroot $MOUNTDIR /opt/kde/bin/kickoffcfg --add-favorite $f

View File

@ -48,15 +48,6 @@ _EOF
#
sed -i "s|# autologin.*|autologin=liveuser|" $MOUNTDIR/etc/lxdm/lxdm.conf
# set timezone according to LANGUAGE (default is UTC)
#
case $LANGUAGE in
it) timezone=Europe/Rome ;;
es) timezone=Europe/Madrid ;;
*) timezone=UTC ;;
esac
ln -s ../usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
# remove some documentation to save space
for f in ChangeLog Changelog CHANGES TODO NEWS README README.txt; do
find $MOUNTDIR/usr/share/doc -name $f -exec rm -f {} \;

View File

@ -55,15 +55,6 @@ if [ -e $MOUNTDIR/opt/kde/share/config/kdm/kdmrc ]; then
$MOUNTDIR/opt/kde/share/config/kdm/kdmrc
fi
# set timezone according to LANGUAGE (default is UTC)
#
case $LANGUAGE in
it) timezone=Europe/Rome ;;
es) timezone=Europe/Madrid ;;
*) timezone=UTC ;;
esac
ln -s ../usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
# configure favorites in kde menu
for f in /usr/share/applications/chromium-devel.desktop /opt/kde/share/applications/kaffeine.desktop; do
chroot $MOUNTDIR /opt/kde/bin/kickoffcfg --add-favorite $f

View File

@ -12,15 +12,6 @@ fi
# FIXME: ensure alternatives are correclty set
chroot $MOUNTDIR update-alternatives-set-dri
# set timezone according to LANGUAGE (default is UTC)
#
case $LANGUAGE in
it) timezone=Europe/Rome ;;
es) timezone=Europe/Madrid ;;
*) timezone=UTC ;;
esac
ln -s ../usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
# configure favorites in kde menu
for f in /usr/share/applications/chromium-devel.desktop; do
chroot $MOUNTDIR /opt/kde/bin/kickoffcfg --add-favorite $f

View File

@ -28,14 +28,6 @@ mv $MOUNTDIR/etc/shadow $MOUNTDIR/etc/shadow.preinst
cat $MOUNTDIR/etc/shadow.tmp $MOUNTDIR/etc/shadow.orig > $MOUNTDIR/etc/shadow
rm -f $MOUNTDIR/etc/shadow.tmp $MOUNTDIR/etc/shadow.orig
# set timezone according to LANGUAGE (default is UTC)
#
case $LANGUAGE in
it) timezone=Europe/Rome ;;
*) timezone=UTC ;;
esac
ln -s ../usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
prelink
extlinux --install $MOUNTDIR/boot