+ # determine init type
+ if [ "`file /sbin/init | awk '{ print $2 }'`" = "symbolic" ]; then
+ symlink=`ls -al /sbin/init | awk -F'->' '{ print $2 }'`
+ inittype=`basename $symlink`
+ else
+ inittype=sysvinit
+ fi
+ # serial console
+ num=`echo $GETTY | sed 's/\([a-zA-Z].*\)\([0-9].*\)/\2/'`
+ case "$inittype" in
+ systemd)
+ # nothing required to enable serial console
+ ;;
+ sysvinit)
+ echo -en "T${num}:2345:respawn:/sbin/getty -L " >> \ /etc/inittab
+ echo -en "$GETTY 115200 linux" >> /etc/inittab;;
+ *)
+ echo "unsupported init system: $inittype";;
+ esac
+ # more boot scripts
+ echo -en "\nHWCLOCKACCESS=no\n" >> /etc/default/rcS