makedist-openmamba-milestone3/platforms/flash-1GB/post.inc.sh

118 lines
4.8 KiB
Bash
Raw Normal View History

2011-05-19 16:02:37 +02:00
## don't activate some services
#rm -f $MOUNTDIR/etc/rcsysinit.d/{S35hdparm,S30loadmodules,S40swap}
#rm -f $MOUNTDIR/etc/rc*.d/{S12random,S13sysinit,S20network,S44acpid,S55sshd}
#rm -f $MOUNTDIR/etc/rc*.d/{K00splash,K01acpid,K90random,K96swap,K97network,K97udev,K98localnet}
# change inittab so it opens tty root shells instead of asking for login
#
echo "Forcing \`inittab' to open tty root shells with no login..."
sed -i 's,^\([1-3]\):.*,\1:2345:respawn:/sbin/mingetty --autologin root --noclear tty\1,' $MOUNTDIR/etc/inittab
sed -i '/^[4-6]:.*/d' $MOUNTDIR/etc/inittab
# make initramfs
chroot $MOUNTDIR depmod -a
# temporary workaround to disable nouveau driver in favour of nvidia proprietary until
# it gets 3D support
echo "blacklist nouveau" > $MOUNTDIR/etc/modprobe.d/nouveau.conf
LANG=${LANGUAGE}_${COUNTRY} chroot $MOUNTDIR dracut \
--filesystems "ext3 ext4 unionfs squashfs isofs reiserfs reiser4" \
--nomdadmconf --nolvmconf \
/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz \
${KERNEL_MAJVER}${KERNEL_EXTRAVER}
# configure isolinux boot loader
2011-07-10 17:30:09 +02:00
[ -e $MOUNTDIR2/boot/isolinux ] || mkdir -p $MOUNTDIR2/boot/isolinux
2011-05-19 16:02:37 +02:00
cat > $MOUNTDIR2/boot/isolinux/isolinux.cfg << _EOF
PROMPT 0
TIMEOUT 20
DEFAULT vesamenu.c32
MENU TITLE ${buildinfo} (${KERNEL_MAJVER}${KERNEL_EXTRAVER} kernel)
MENU BACKGROUND openmamba.png
MENU COLOR TITLE 1;32;49 #ff00993d #00000000 std
LABEL kms
MENU LABEL default
kernel /boot/vmlinuz-${KERNEL_MAJVER}${KERNEL_EXTRAVER}
append initrd=/boot/initrmfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=789
LABEL vga1024
MENU LABEL VGA 1024x768 (no modeset)
kernel /boot/vmlinuz-${KERNEL_MAJVER}${KERNEL_EXTRAVER}
append initrd=/boot/initrmfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=792 nomodeset
LABEL vga800
MENU LABEL VGA 800x600 (no modeset)
kernel /boot/vmlinuz-${KERNEL_MAJVER}${KERNEL_EXTRAVER}
append initrd=/boot/initrmfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 quiet splash vga=789 nomodeset
LABEL debug
MENU LABEL Debug mode
kernel /boot/vmlinuz-${KERNEL_MAJVER}${KERNEL_EXTRAVER}
append initrd=/boot/initrmfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz root=live:LABEL=${MAKEDIST_TARGET}_${PLATFORM} ro selinux=0 rddebug rdshell
MENU SEPARATOR
LABEL memtest
MENU LABEL Memory test
kernel memtest
MENU SEPARATOR
MENU SEPARATOR
LABEL -
MENU LABEL $PRODUCT_NAME build:`date -R`
MENU DISABLE
_EOF
# install isolinux binary
[ -e $MOUNTDIR/usr/share/syslinux/isolinux.bin ] && cp $MOUNTDIR/usr/share/syslinux/isolinux.bin $MOUNTDIR2/boot/isolinux/isolinux.bin ||
{ echo "Error: /usr/share/syslinux/isolinux.bin not found. Please install the syslinux package.";
exit 1; }
# copy syslinux addons to final root /boot dir
cp $MOUNTDIR/usr/share/syslinux/vesamenu.c32 $MOUNTDIR2/boot/isolinux/
# install memtest
[ -e $MOUNTDIR/boot/memtest.bin ] && cp $MOUNTDIR/boot/memtest.bin $MOUNTDIR2/boot/isolinux/memtest ||
{ echo "Error: /boot/memtest.bin not found. Please install the memtest86 package.";
exit 1; }
# configure for runlevel 5 boot
sed -i "s|id:3\(:initdefault.*\)|id:5\1|" $MOUNTDIR/etc/inittab
# 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 ;;
*) timezone=UTC ;;
esac
echo $timezone > $MOUNTDIR/etc/timezone
cp $MOUNTDIR/usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
# configure KDM for autologin
#
if [ -e $MOUNTDIR/opt/kde/share/config/kdm/kdmrc ]; then
sed -i 's|[#]AutoLoginEnable=.*|AutoLoginEnable=true|' \
$MOUNTDIR/opt/kde/share/config/kdm/kdmrc
sed -i 's|[#]AutoReLogin=.*|AutoReLogin=true|' \
$MOUNTDIR/opt/kde/share/config/kdm/kdmrc
sed -i 's|[#]AutoLoginUser=.*|AutoLoginUser=root|' \
$MOUNTDIR/opt/kde/share/config/kdm/kdmrc
sed -i 's|[#]AllowRootLogin=.*|AllowRootLogin=root|' \
$MOUNTDIR/opt/kde/share/config/kdm/kdmrc
# installer icon on root desktop
# FIXME: move this somewhere else
mkdir -p $MOUNTDIR/root/Desktop/
cp $MOUNTDIR/usr/share/applications/openmamba-installer.desktop $MOUNTDIR/root/Desktop/
# prebuild postplug sound CARDID_DB (with some ugly trick to make it work from chroot)
[ -e $MOUNTDIR/lib/modules/`uname -r` ] || ln -s ${KERNEL_MAJVER}${KERNEL_EXTRAVER} $MOUNTDIR/lib/modules/`uname -r`
echo "SOUND_BUILD_CARDID_DB_ONLY=1 /etc/postplug/postplug.d/sound" >> $MOUNTDIR/tmp/sounddb.sh
chroot $MOUNTDIR sh /tmp/sounddb.sh
rm -f $MOUNTDIR/tmp/sounddb.sh
[ -L $MOUNTDIR/lib/modules/`uname -r` ] && rm $MOUNTDIR/lib/modules/`uname -r`
prelink
#echo "Performing binaries prelinking..."
#chroot $MOUNTDIR /bin/bash -c "PRELINK_NOINITCHECK=1 /etc/cron.daily/prelink"