From c771b40913eddd22809dc5504e44a1f3da9a4ede Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Thu, 8 Feb 2018 06:33:44 +0000 Subject: [PATCH] rand_check_poweroff.sh + random stuff --- CONTRIBUTING.md | 2 +- rootfs_overlay/rand_check_poweroff.sh | 20 ++++++++++++++++++++ run | 3 --- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100755 rootfs_overlay/rand_check_poweroff.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3e5aa21..8ad6913 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,5 +7,5 @@ Testing you should do before pushing: new modules: New arch: - `./build -a ARCH && ./run -a ARCH` -- `wget google.com` for Internet +- `wget google.com && cat index.html` for Internet - `./run -a ARCH -d` and `./rungdb -a ARCH` diff --git a/rootfs_overlay/rand_check_poweroff.sh b/rootfs_overlay/rand_check_poweroff.sh new file mode 100755 index 0000000..78b2a63 --- /dev/null +++ b/rootfs_overlay/rand_check_poweroff.sh @@ -0,0 +1,20 @@ +#!/bin/sh +set -ex +/rand_check.out + +# Check if network is being replayed. +# +# TODO; requires internet to be up, which is done by inittab. +# We could do this with a /etc/init.d/SXX file, +# but how to both check that into git, and make it optional? +# +# https://superuser.com/questions/635020/how-to-know-current-time-from-internet-from-command-line-in-linux +# Raw IP because was failing with hostname: +# https://unix.stackexchange.com/questions/124283/busybox-ping-ip-works-but-hostname-nslookup-fails-with-bad-address +# https://tf.nist.gov/tf-cgi/servers.cgi +# +#echo | nc 129.6.15.28 13 + +# busybox's poweroff panics, TODO why. Likely tries to kill shell. +# So just use our super raw command. +/poweroff.out diff --git a/run b/run index a3cf263..c9b2df2 100755 --- a/run +++ b/run @@ -4,7 +4,6 @@ set -e # CLI handling. arch=x86_64 -debug=false debug_qemu='' kgdb=false nographic=false @@ -20,14 +19,12 @@ while getopts a:de:knqt:x OPT; do arch="$OPTARG" ;; d) - debug=true extra_flags="$extra_flags -S -s" ;; e) extra_append="$extra_append $OPTARG" ;; k) - debug=true extra_append="$extra_append kgdbwait" # For those who want to try KDB. #extra_append="$extra_append kgdbwait kgdboc=kbd"