Add MOTD warning about possible reboot

This commit is contained in:
zador-blood-stained
2016-08-28 20:41:52 +03:00
parent e00c650a83
commit 74a16c6aa1
4 changed files with 21 additions and 7 deletions

View File

@@ -33,11 +33,11 @@ create_board_package()
Installed-Size: 1
Section: kernel
Priority: optional
Depends: bash, python3-apt
Depends: bash
Provides: armbian-bsp
Conflicts: armbian-bsp
Replaces: base-files
Recommends: fake-hwclock, initramfs-tools
Recommends: bsdutils, parted, python3-apt, util-linux, initramfs-tools
Description: Armbian tweaks for $RELEASE on $BOARD ($BRANCH branch)
EOF

View File

@@ -7,8 +7,8 @@
# Should-Start: armhwinfo
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: PLEASE BE PATIENT AND DO NOT INTERRUPT THE FIRST REBOOT
# Description: Something needs to be done when is
# Short-Description: PLEASE DO NOT INTERRUPT THE FIRST BOOT
# Description: Something needs to be done when is
# starting at first time.
# regenerate ssh host key
### END INIT INFO
@@ -65,7 +65,11 @@ if [[ "$(apt-cache policy ramlog | grep Installed)" != "" ]]; then
fi
fi
while [ -f /tmp/firstrun_running ]; do sleep 1; done
if [ -f "/var/run/reboot" ]; then reboot; fi
if [ -f "/var/run/reboot" ]; then
wall -n "Performing automatic reboot in 5 seconds"
sleep 5
reboot
fi
rm -f /tmp/create_swap.sh
sync &
EOT
@@ -237,6 +241,8 @@ check_prerequisits() {
} # check_prerequisits
main() {
touch /tmp/firstrun_running
check_prerequisits
collect_information
@@ -244,7 +250,6 @@ main() {
do_expand_rootfs
fi
touch /tmp/firstrun_running
/tmp/create_swap.sh &
# old distros can't handle allow-hotplug

View File

@@ -0,0 +1,8 @@
#!/bin/bash
if [[ -f /tmp/firstrun_running ]]; then
printf "\n\e[0;91m Warning: firstrun script is running \x1B[0m \n"
printf "\e[0;91m automatic reboot may be performed soon \x1B[0m \n"
fi
(sleep 1 && rm "$0") &

View File

@@ -4,5 +4,6 @@
if [ "$LINUXFAMILY" = "sun8i" ]; then
printf "\nNew to Armbian? Check the Armbian H3 Mini FAQ first:\n\e[0;92m https://github.com/igorpecovnik/lib/blob/master/documentation/H3_mini_faq.md \x1B[0m\n"
(sleep 1 && rm "$0") &
fi
(sleep 1 && rm "$0") &