From 61973c94cff59d08ec627b9118d3c8841aa2aa52 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Thu, 25 Jan 2024 17:47:31 -0600 Subject: [PATCH] flash: Add option to override console spec The `flash.zsh` script now takes an optional `--console` argument, which can be used to override the `console=` kernel command line argument. --- flash.zsh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/flash.zsh b/flash.zsh index a335836..f538acf 100755 --- a/flash.zsh +++ b/flash.zsh @@ -68,16 +68,19 @@ function install_coreos() { local ignition="$1" local dev="$2" local url="$3" + local console="$4" if [ -z "${url}" ]; then set -- -a aarch64 -s stable else set -- --image-url "${url}" fi + if [ -n "${console}" ]; then + set -- "$@" --console "${console}" + fi coreos-installer install "$@" \ -i "${ignition}" \ - --console ttyS0,115200n8 \ "${dev}" sync; sync; sync } @@ -85,6 +88,7 @@ function install_coreos() { function parse_args() { pi=4 image_url= + console=ttyS0,115200n8 while [ $# -gt 0 ]; do case "$1" in --pi) @@ -101,6 +105,13 @@ function parse_args() { --image-url=*) image_url=${1#--image-url=} ;; + --console) + shift + console=${1} + ;; + --console=*) + console=${1#--console=} + ;; *) if [ -z "${ignition-}" ]; then ignition="${1}" @@ -141,7 +152,7 @@ if [ $(id -u) -ne 0 ]; then exec sudo "$0" "$@" fi -install_coreos "${ignition}" "${dev}" "${image_url}" +install_coreos "${ignition}" "${dev}" "${image_url}" "${console}" case "${pi}" in 2|3)