#! /bin/bash error=0 ; trap "error=$((error|1))" ERR # add a $username user account if [ -n "$username" ]; then if ! $ROOTCMD getent passwd $username ; then $ROOTCMD adduser -c "$username user" $username $ROOTCMD usermod -p "$USERPW" $username fi fi # enable graphical login screen, make run level 5 as default if [ -f $target/usr/sbin/gdm ]; then sed -i -e 's/id:3:initdefault:/id:5:initdefault:/' $target/etc/inittab # do not run this tool echo "RUN_FIRSTBOOT=NO" > $target/etc/sysconfig/firstboot fi exit $error