From c6f20655db80a20687caa3747d4f515d06889eaf Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 8 Oct 2013 13:35:10 -0700 Subject: [PATCH 1/2] fix(qemu_template): Fix getopts usage in qemu wrapper script. Previously shifts were added into the getopts loop to work around differences between different sh implementations but that causes getopts to end the loop early. Instead use an intermediate variable to work around inconsistent OPTIND behavior and explicitly check for the -- separator. Tested in bash, dash, and ash. --- build_library/qemu_template.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build_library/qemu_template.sh b/build_library/qemu_template.sh index a1d25b01f4..b04917a99c 100755 --- a/build_library/qemu_template.sh +++ b/build_library/qemu_template.sh @@ -25,17 +25,22 @@ Any arguments after -a and -p will be passed through to qemu, -- may be used as an explicit separator. See the qemu(1) man page for more details. " +script_args=1 while getopts ":a:p:vh" OPTION do case $OPTION in - a) SSH_KEYS="$OPTARG"; shift 2 ;; - p) SSH_PORT="$OPTARG"; shift 2 ;; - v) set -x; shift ;; + a) SSH_KEYS="$OPTARG" ;; + p) SSH_PORT="$OPTARG" ;; + v) set -x ;; h) echo "$USAGE"; exit ;; ?) break ;; esac + script_args=$OPTIND done +shift $((script_args - 1)) +[ "$1" == "--" ] && shift + METADATA=$(mktemp -t -d coreos-meta-data.XXXXXXXXXX) if [ $? -ne 0 ] || [ ! -d "$METADATA" ]; then From c96af93ba6158d0bf666fcc4a6eeef51777d7367 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 8 Oct 2013 18:43:26 -0700 Subject: [PATCH 2/2] fun(set_lsb_release): New code name for version 100 --- build_library/set_lsb_release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_library/set_lsb_release b/build_library/set_lsb_release index fc1eb2cb01..f5c016cf9f 100755 --- a/build_library/set_lsb_release +++ b/build_library/set_lsb_release @@ -71,7 +71,7 @@ sudo mkdir -p "${ROOT_FS_DIR}/etc" sudo_clobber "${ROOT_FS_DIR}/etc/lsb-release" <