# create reboot && poweroff scripts if [ "${TCOS_INCLUDE_INIT}" = "1" ]; then # now copy reboot and poweroff in /usr/sbin outside of # usr.squashfs, because reboot -f is exec after umount /usr stat_before mkdir -p $DESTDIR/usr/sbin >/dev/null 2>&1 mkdir -p $DESTDIR/lib/cmds >/dev/null 2>&1 # init reboot poweroff cpifexists /sbin/reboot /lib/cmds/ cpifexists /sbin/poweroff /lib/cmds/ cpifexists ${TCOS_BINS}/down-controller /sbin/ rm -f $DESTDIR/bin/reboot rm -f $DESTDIR/bin/poweroff rm -f $DESTDIR/bin/halt # reboot script cat < ${DESTDIR}/sbin/reboot #!/bin/sh # reboot wrapper . /scripts/functions . /conf/tcos-run-functions kill_xorg clear log_begin_msg "Rebooting" log_end_msg 0 kill_all umount_swap umount_all /lib/cmds/reboot -f EOF chmod +x ${DESTDIR}/sbin/reboot # poweroff script cat < ${DESTDIR}/sbin/poweroff #!/bin/sh # poweroff wrapper . /scripts/functions . /conf/tcos-run-functions kill_xorg clear log_begin_msg "Poweroff system" log_end_msg 0 kill_all umount_swap umount_all /lib/cmds/poweroff -f EOF chmod +x $DESTDIR/sbin/poweroff stat_after "Init binaries" fi