makedist-openmamba-milestone3/platforms/sdk-root/post.inc.sh

101 lines
2.7 KiB
Bash

# 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 '/^[1-6]:.*/d' $MOUNTDIR/etc/inittab
if [ "$ARCH" == "arm" ]; then
INITTAB_TTY="ttyS0 ttyAMA0"
else
INITTAB_TTY="tty1 tty2 tty3"
fi
n=0
for t in ${INITTAB_TTY}; do
n=`expr $n + 1`
echo "${n}:2345:respawn:/sbin/mingetty --autologin root --noclear ${t}" >> $MOUNTDIR/etc/inittab
done
# add default sdk user
chroot $MOUNTDIR useradd sdk -G sysadmin,packager
# configure default root password
echo "sdk" | chroot $MOUNTDIR passwd root --stdin
# configure default sdk password
echo "sdk" | chroot $MOUNTDIR passwd sdk --stdin
## add fstab entries
#cat >> $MOUNTDIR/etc/fstab << _EOF
##/dev/hda1 /mnt/cf0 auto defaults 1 1
#/dev/mmcblk0p1 /mnt/sd0 auto defaults 1 1
#_EOF
#mkdir $MOUNTDIR/mnt/cf0 $MOUNTDIR/mnt/sd0
# enable network manager
chroot $MOUNTDIR chkconfig --add NetworkManager
# disable nfs
chroot $MOUNTDIR chkconfig --del nfslock
chroot $MOUNTDIR chkconfig --del portmap
# remove some services
rm -f $MOUNTDIR/etc/rc?.d/???{iptables,acpid}
# configure vncserver
cat >> $MOUNTDIR/etc/sysconfig/vncservers << _EOF
VNCSERVERS="1:root"
export USER=root
_EOF
cat >> $MOUNTDIR/etc/tightvncserver.conf << _EOF
\$geometry = "800x480"
_EOF
chroot $MOUNTDIR chkconfig --add vncserver
chroot $MOUNTDIR chkconfig --level 345 vncserver on
mkdir -p $MOUNTDIR/etc/X11/xinit/
echo "startlxde" > $MOUNTDIR/etc/X11/xinit/xinitrc
chmod +x $MOUNTDIR/etc/X11/xinit/xinitrc
cat > $MOUNTDIR/usr/bin/X-vncserver << _EOF
#!/bin/bash
vncserver
_EOF
chmod +x $MOUNTDIR/usr/bin/X-vncserver
# copy qemu-static
cp /usr/bin/qemu-arm.static $MOUNTDIR/usr/bin/qemu-arm
cp /usr/bin/qemu-arm.static $MOUNTDIR/usr/bin/qemu-arm-suid
chmod 4755 $MOUNTDIR/usr/bin/qemu-arm-suid
cat > $MOUNTDIR/bin/sudo-qemu << _EOF
#!/bin/sh
/usr/bin/qemu-arm-suid /usr/bin/sudo \$@
_EOF
chmod +x $MOUNTDIR/bin/sudo-qemu
# set localtime (default to Europe/Berlin)
case $LANGUAGE in
it) timezone=Europe/Rome ;;
es) timezone=Europe/Madrid ;;
*) timezone=Europe/Berlin ;;
esac
echo $timezone > $MOUNTDIR/etc/timezone
cp /usr/share/zoneinfo/$timezone $MOUNTDIR/etc/localtime
if [ ! "$KERNEL_IGNORE" ]; then
# update module dependencies
chroot $MOUNTDIR depmod -a ${KERNEL_MAJVER}${KERNEL_EXTRAVER}
# create universal initramfs
LANG=${LANGUAGE}_${COUNTRY} chroot $MOUNTDIR dracut \
--filesystems "ext3 ext4 reiserfs reiser4" \
--nomdadmconf --nolvmconf \
/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}.img.gz \
${KERNEL_MAJVER}${KERNEL_EXTRAVER}
fi
# don't remove static qemu for this platform
QEMU_COPIED_FOR_INST=0
#prelink