diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ff4347..8c7c3b8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,12 +20,12 @@ test-oksh: - apk add oksh - ln -sf /bin/oksh /bin/sh -# disabling for now - yash now hates 'local' -.test-yash: - extends: test-default - before_script: - - apk add yash - - ln -sf /usr/bin/yash /bin/sh +# disabled - yash hates 'local' +#test-yash: +# extends: test-default +# before_script: +# - apk add yash +# - ln -sf /usr/bin/yash /bin/sh test-zsh: extends: test-default diff --git a/bin/imds b/bin/imds index 35ba0d6..45b6d40 100755 --- a/bin/imds +++ b/bin/imds @@ -101,19 +101,19 @@ imds() { key="$1"; shift case $key in # error handling - -e) err=0; continue ;; # ignore - +e) err=1; continue ;; # return + -e) err=0; continue ;; # ignore + +e) err=1; continue ;; # return # TODO: retry/deadline # output control - +n) printf "\n"; continue ;; # insert newline - +s) printf " "; continue ;; # insert space - +t) printf "\t"; continue ;; # insert tab + +n) printf "\n"; continue ;; # insert newline + +s) printf " "; continue ;; # insert space + +t) printf "\t"; continue ;; # insert tab # key aliasing - @hostname) args="$IMDS_HOSTNAME" ;; - @local-hostname) args="$IMDS_LOCAL_HOSTNAME" ;; - @ssh-keys) cmd=_imds_ssh_keys ;; - @userdata) cmd=_imds_userdata ;; - @nics) args="$IMDS_NICS" ;; + @hostname) args="$IMDS_HOSTNAME" ;; + @local-hostname) args="$IMDS_LOCAL_HOSTNAME" ;; + @ssh-keys) cmd=_imds_ssh_keys ;; + @userdata) cmd=_imds_userdata ;; + @nics) args="$IMDS_NICS" ;; @nic:*) cmd=imds args=$(_imds_nic_args $(echo "${key#@nic:}" | tr , ' ')) diff --git a/lib/mdev/nvme-ebs-links b/lib/mdev/nvme-ebs-links index 663a1e9..5b96d56 100755 --- a/lib/mdev/nvme-ebs-links +++ b/lib/mdev/nvme-ebs-links @@ -2,7 +2,7 @@ # vim:set ft=sh: # NOTE: The mdev-conf APK handles this now, but only for xvd or sd links (not -# both) +# both) : "${LIBDIR:=$PREFIX/lib}" . "$LIBDIR/tiny-cloud/common" diff --git a/lib/tiny-cloud/common b/lib/tiny-cloud/common index 6eaa8fc..a993895 100644 --- a/lib/tiny-cloud/common +++ b/lib/tiny-cloud/common @@ -15,7 +15,7 @@ log() { local tag=$(basename "$0") while [ "${1#-}" != "$1" ]; do case "$1" in - -i) init=1 ;; # TODO: value = indent? + -i) init=1 ;; -f) facility="$2"; shift ;; -s) stderr=-s ;; -t) tag="$tag/$2"; shift ;; diff --git a/lib/tiny-cloud/init b/lib/tiny-cloud/init index 79b8a4e..f28f8ce 100644 --- a/lib/tiny-cloud/init +++ b/lib/tiny-cloud/init @@ -72,7 +72,7 @@ init__install_hotplugs() { for module in $HOTPLUG_MODULES; do result='unknown' level='err' - printf " >> " >&2 + printf " >> " >&2 log -i -t "$phase/$ACTION" info "$module: installing" if type "mod__$module" | grep -q -w "function"; then if "mod__$module"; then @@ -83,7 +83,7 @@ init__install_hotplugs() { rc=1 fi fi - printf " >> " >&2 + printf " >> " >&2 log -i -t "$phase/$ACTION" info "$module: $result" done return $rc diff --git a/sbin/tiny-cloud b/sbin/tiny-cloud index a95f787..7a3a7bb 100755 --- a/sbin/tiny-cloud +++ b/sbin/tiny-cloud @@ -10,7 +10,7 @@ set -e usage() { cat <<-EOF - Usage: ${0##*/} [-h | --help] { early | net | main | final | --bootstrap [complete|incomplete|status] | --setup } + Usage: ${0##*/} [-h | --help] { early | net | main | final | --bootstrap {complete|incomplete|status} | --setup } EOF } @@ -35,17 +35,17 @@ while true; do -h|--help) usage; exit 0;; -b|--bootstrap) shift case "$1" in - complete) # indicate bootstrap is done + complete) # indicate bootstrap is done bootstrap_complete log -i notice 'bootstrap marked complete';; - incomplete) # indicate bootstrap isn't done + incomplete) # indicate bootstrap isn't done bootstrap_incomplete log -i warn 'bootstrap marked incomplete';; status) is_bootstrap_complete && echo 'complete' || echo 'incomplete' ;; *) usage >&2; exit 1;; esac exit 0;; - -s|--setup) # just openrc for now + -s|--setup) # just openrc for now for phase in -early -net '' -final; do rc-update -a del "tiny-cloud$phase" || true done @@ -97,11 +97,11 @@ INIT_ACTIONS_FINAL="${INIT_ACTIONS_FINAL} bootstrap_complete" ### let's do stuff! case "$phase" in - early) INIT_ACTIONS="$INIT_ACTIONS_EARLY";; + early) INIT_ACTIONS="$INIT_ACTIONS_EARLY";; net) INIT_ACTIONS="$INIT_ACTIONS_NET";; - main) INIT_ACTIONS="$INIT_ACTIONS_MAIN";; - final) INIT_ACTIONS="$INIT_ACTIONS_FINAL";; - *) usage >&2; exit 1 + main) INIT_ACTIONS="$INIT_ACTIONS_MAIN";; + final) INIT_ACTIONS="$INIT_ACTIONS_FINAL";; + *) usage >&2; exit 1;; esac printf '\n' >&2 diff --git a/usr/libexec/ifupdown-ng/imds b/usr/libexec/ifupdown-ng/imds index 0d54b3c..4864574 100755 --- a/usr/libexec/ifupdown-ng/imds +++ b/usr/libexec/ifupdown-ng/imds @@ -8,7 +8,8 @@ post-up) /sbin/imds-net-sync ;; pre-down) - /sbin/imds-net-sync -k + # TODO: someday make imds-net-sync a daemon + # /sbin/imds-net-sync -k ;; *) ;; esac