98 lines
3.9 KiB
Bash
98 lines
3.9 KiB
Bash
## 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:.*,1:234:respawn:/sbin/mingetty --autologin root --loginpause --noclear tty1,' $MOUNTDIR/etc/inittab
|
|
sed -i 's,^\([2-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
|
|
|
|
LANG=${LANGUAGE}_${COUNTRY} chroot $MOUNTDIR dracut \
|
|
--filesystems "ext3 ext4 overlayfs squashfs isofs reiserfs" \
|
|
--nomdadmconf --nolvmconf \
|
|
/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz \
|
|
${KERNEL_MAJVER}${KERNEL_EXTRAVER}
|
|
|
|
# configure isolinux boot loader
|
|
[ -e $MOUNTDIR2/boot/isolinux ] || mkdir -p $MOUNTDIR2/boot/isolinux
|
|
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/{ldlinux,libcom32,libutil,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=liveuser|' \
|
|
$MOUNTDIR/opt/kde/share/config/kdm/kdmrc
|
|
|
|
prelink
|