/usr/share/tcos/hooks-addons/00init is in initramfs-tools-tcos 0.89.93ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | # 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 <<EOF > ${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 <<EOF > ${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
|