2011-05-19 16:02:37 +02:00
# execute platform specific script
[ -e $TARGETDIR /platforms/$PLATFORM /pre.inc.sh ] && . $TARGETDIR /platforms/$PLATFORM /pre.inc.sh
[ " $PRODUCT_NAME " ] && \
2014-12-06 13:37:42 +01:00
MEDIA_NAME = ` PLATFORM = $PRODUCT_NAME VARIANT = $VARIANT medium_name` ||
MEDIA_NAME = ` VARIANT = $VARIANT medium_name`
2011-05-19 16:02:37 +02:00
#if [ "$FORCE" = "1" -o ! -e "$LOCALSTATEDIR/$MEDIA_NAME" ]; then
#create_livecd
2013-09-08 16:09:58 +02:00
initialize_root_dir
2011-05-19 16:02:37 +02:00
create_rpm_database
create_devices
2014-03-25 12:40:17 +01:00
echo "Installing preparation packages..."
2018-01-29 12:55:39 +01:00
install_rpms " filesystem shadow gzip texinfo ldconfig bash libreadline glibc libncurses setup coreutils chkconfig \
libcap libaudit libselinux libsepol libpcre libcap-ng libattr libstdc++6 libpam" " --nodeps --noorder --noscripts"
# pam initscripts
chroot $MOUNTDIR /usr/sbin/update-alternatives --install /bin/sh sh /bin/bash 20
2011-05-19 16:02:37 +02:00
2011-09-01 15:00:19 +02:00
[ " $LANGUAGE " ] && {
[ " $LANGUAGE " = "en" ] && KEYMAP = us || KEYMAP = " $LANGUAGE "
# configure localization
2014-04-12 22:27:51 +02:00
if [ ! " $MULTILANGUAGE " ] ; then
cat > $MOUNTDIR /etc/vconsole.conf << _EOF
2011-09-01 15:00:19 +02:00
KEYMAP = $KEYMAP
2015-03-14 14:38:59 +01:00
FONT = LatGrkCyr-8x16
FONT_MAP = latin2u
2011-09-01 15:00:19 +02:00
FONT_UNIMAP =
2011-12-26 14:10:25 +01:00
UNICODE = 1
2011-09-01 15:00:19 +02:00
_EOF
2014-04-12 22:27:51 +02:00
else
cat > $MOUNTDIR /etc/vconsole.conf << _EOF
2015-03-14 14:38:59 +01:00
FONT = LatGrkCyr-8x16
FONT_MAP = latin2u
2014-04-12 22:27:51 +02:00
FONT_UNIMAP =
UNICODE = 1
2011-09-01 15:00:19 +02:00
_EOF
2014-04-12 22:27:51 +02:00
fi
2011-09-01 15:00:19 +02:00
[ " $COUNTRY " ] && {
2014-04-12 22:27:51 +02:00
if [ ! " $MULTILANGUAGE " ] ; then
cat > $MOUNTDIR /etc/locale.conf << _EOF
2011-09-01 15:00:19 +02:00
LANG = ${ LANGUAGE } _${ COUNTRY } .UTF-8
LC_COLLATE = C
_EOF
2014-04-12 22:27:51 +02:00
else
cat > $MOUNTDIR /etc/locale.conf << _EOF
LC_COLLATE = C
2011-09-01 15:00:19 +02:00
_EOF
2014-04-12 22:27:51 +02:00
fi
2011-09-01 15:00:19 +02:00
}
}
2011-05-19 16:02:37 +02:00
# Workaround: avoid a circular dependency with bash
INSTALLED = "texinfo"
#install_rpms_by_target \
# "Installing kernel..." mtd-base \
# "$NOARCHDIR/filesystem*"
#if [ "$BUILDARCH" != "$ARCH" ]; then
# NOSCRIPTARG="--noscripts"
#fi
if [ " $BUILDARCH " != " $ARCH " ] ; then
pre_qemu
QEMU_COPIED_FOR_INST = 1
fi
install_rpms_by_target " Installing base packages for ${ MAKEDIST_TARGET } target " ${ MAKEDIST_TARGET } -base " --replacepkgs ${ RPMEXTRAARGS } ${ NOSCRIPTARG } "
pre_install_rpms
if [ ! " $KERNEL_IGNORE " ] ; then
2011-10-06 14:54:45 +02:00
for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER ; do
install_kernel ${ K } ${ KERNEL_PLATFORM } " ${ KERNEL_ADDITIONAL } "
done
2011-05-19 16:02:37 +02:00
fi
# set system hostname and domain
[ [ " $TARGET_HOSTNAME " ] ] || TARGET_HOSTNAME = " $MAKEDIST_TARGET "
[ [ " $TARGET_DOMAIN " ] ] || TARGET_DOMAIN = "localdomain"
2014-10-08 21:24:45 +02:00
echo " $TARGET_HOSTNAME . $TARGET_DOMAIN " > $MOUNTDIR /etc/hostname
2011-05-19 16:02:37 +02:00
2015-02-20 13:48:32 +01:00
# 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
2015-02-19 14:53:09 +01:00
if [ " $PREPLATFORM_TARGET " ] ; then
install_rpms_by_target " Installing ${ PLATFORM } pre-platform workaround packages " ${ MAKEDIST_TARGET } -${ PREPLATFORM_TARGET } " ${ RPMEXTRAARGS } "
fi
2011-05-19 16:02:37 +02:00
#install_rpms_by_target "Installing tools packages for ${MAKEDIST_TARGET} target" ${MAKEDIST_TARGET}-tools ""
install_rpms_by_target " Installing ${ PLATFORM } platform packages " ${ MAKEDIST_TARGET } -${ PLATFORM } " ${ RPMEXTRAARGS } "
2014-03-09 14:52:36 +01:00
if [ " $MULTILANGUAGE " ] ; then
for l in $MULTILANGUAGE ; do
install_rpms_by_target " Installing ${ PLATFORM } platform localization packages for language $l " ${ MAKEDIST_TARGET } -${ PLATFORM } -${ l } " ${ RPMEXTRAARGS } "
done
else
[ " $LANGUAGE " ] && install_rpms_by_target " Installing ${ PLATFORM } platform localization packages for language $LANGUAGE " ${ MAKEDIST_TARGET } -${ PLATFORM } -${ LANGUAGE } " ${ RPMEXTRAARGS } "
fi
2011-10-26 21:54:36 +02:00
[ " $ARCH " ] && install_rpms_by_target " Installing ${ PLATFORM } platform packages for arch $ARCH " ${ MAKEDIST_TARGET } -${ PLATFORM } -${ ARCH } " ${ RPMEXTRAARGS } "
2011-05-19 16:02:37 +02:00
2017-03-06 16:03:05 +01:00
if [ " $VARIANT " ] ; then
install_rpms_by_target " Installing ${ PLATFORM } platform packages for variant $VARIANT " ${ MAKEDIST_TARGET } -${ PLATFORM } -${ VARIANT } " ${ RPMEXTRAARGS } "
fi
2011-05-19 16:02:37 +02:00
if [ " $APPLICATION_TARGET " ] ; then
2013-03-07 17:23:45 +01:00
add_additional_defs_file /usr/share/openmamba/pkggroups.db
2011-05-19 16:02:37 +02:00
for t in $APPLICATION_TARGET ; do
install_rpms_by_target " Installing $t application packages. " " $t " " ${ RPMEXTRAARGS } "
done
fi
if [ ${ DEBUG :- 0 } -gt 0 ] ; then
install_rpms_by_target "Installing debugging packages." ${ MAKEDIST_TARGET } -debug " ${ RPMEXTRAARGS } "
2011-10-26 21:54:36 +02:00
cat > $MOUNTDIR /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF
DEVICE = eth0
2011-05-19 16:02:37 +02:00
BOOTPROTO = dhcp
2011-10-26 21:54:36 +02:00
ONBOOT = yes
#NM_CONTROLLED=no
2011-05-19 16:02:37 +02:00
_EOF
fi
2015-02-20 13:48:32 +01:00
# 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
2011-05-19 16:02:37 +02:00
# delete unused localizations
#
2014-03-09 14:52:36 +01:00
if [ ! " $MULTILANGUAGE " ] ; then
echo "Deleting other languages l10n files..."
for d in /usr/share/locale /opt/kde/share/locale \
2011-11-02 14:24:07 +01:00
/opt/kde/share/locale/l10n /opt/kde3/share/locale; do
2014-03-09 14:52:36 +01:00
find ${ MOUNTDIR } ${ d } -maxdepth 1 -mindepth 1 -type d \
! -name ${ LANGUAGE } * ! -name en* ! -name C ! -name l10n -exec rm -rf { } \; 2>/dev/null
done
fi
2011-05-19 16:02:37 +02:00
if [ " $U_BOOT " ] ; then
echo "Copying u-boot Image for Kernel"
#mkimage -A ppc -O linux -T kernel -C gzip -a 0x8000 -e 0x8000 \
# -n "$DISTRONAME 2.6" -d $MOUNTDIR/boot/vmlinuz-2.6.12 $DISTRONAME-$MAKEDIST_TARGET-uImage.bin
fi
# disable parport
#sed -i "/parport_pc/d" $MOUNTDIR/etc/modprobe.conf
# disable multithreaded init ?
if [ ${ MULTITHREAD :- 0 } -gt 0 ] ; then
sed -i "s|multithread=1|multithread=0|" $MOUNTDIR /etc/sysconfig/rc
fi
# set rootdev on extlinux
[ -e $MOUNTDIR /boot/extlinux.conf ] && sed -i " s|\([^::alpha]root=\)[^ ]*|\1 $ROOTDEV | " $MOUNTDIR /boot/extlinux.conf
# execute platform specific script
[ -e $TARGETDIR /platforms/$PLATFORM /post.inc.sh ] && . $TARGETDIR /platforms/$PLATFORM /post.inc.sh
2011-06-12 17:21:54 +02:00
# cleanup: prevent generating a cleanfs script crash due to a unionfs bug
rm -rf $MOUNTDIR /tmp/.ICE-unix
rm -rf $MOUNTDIR /tmp/kde-root
2011-05-19 16:02:37 +02:00
# copy static files for target
[ -e $TARGETDIR /root ] &&
2012-03-17 18:03:13 +01:00
cp -a --no-preserve= ownership $TARGETDIR /root/* $MOUNTDIR /
2011-05-19 16:02:37 +02:00
# copy static files for specific platform
[ -e $TARGETDIR /platforms/$PLATFORM /root -a " `ls $TARGETDIR /platforms/ $PLATFORM /root/* 2>/dev/null` " ] &&
2012-03-17 18:03:13 +01:00
cp -a --no-preserve= ownership $TARGETDIR /platforms/$PLATFORM /root/* $MOUNTDIR /
2011-05-19 16:02:37 +02:00
# copy localized static files for specific platform
2014-03-09 14:52:36 +01:00
if [ " $MULTILANGUAGE " ] ; then
for l in $MULTILANGUAGE ; do
[ -e $TARGETDIR /platforms/$PLATFORM /root-$l ] &&
cp -a --no-preserve= ownership $TARGETDIR /platforms/$PLATFORM /root-$l /* $MOUNTDIR /
done
else
[ " $LANGUAGE " -a -e $TARGETDIR /platforms/$PLATFORM /root-$LANGUAGE ] &&
cp -a --no-preserve= ownership $TARGETDIR /platforms/$PLATFORM /root-$LANGUAGE /* $MOUNTDIR /
fi
2011-05-19 16:02:37 +02:00
2012-12-06 16:44:52 +01:00
# enable additional smart repositories
if [ " $SMART_CHANNELS_ENABLE " != "" ] ; then
for r in $SMART_CHANNELS_ENABLE ; do
chroot $MOUNTDIR smart channel --enable $r
done
echo " $SMART_CHANNELS_ENABLE " > $MOUNTDIR /etc/smart/openmamba-install-enabled-channels
fi
2013-04-14 21:28:39 +02:00
if [ ! " $KERNEL_IGNORE " ] ; then
for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER ; do
echo " Updating modules dependencies for kernel ${ KERNEL_MAJVER } ${ K } "
update_modules_dependencies ${ KERNEL_MAJVER } ${ K }
done
fi
2013-12-30 16:51:27 +01:00
# rpm database
post_install_rpms
clean_rpm_database
2013-04-30 14:39:17 +02:00
[ " $QEMU_COPIED_FOR_INST " ] && post_qemu
2011-05-19 16:02:37 +02:00
produce_media