flash: Add option to specify image URL
The `flash.zsh` script now takes an optional `--image-url` argument, which can be used to specify a different FCOS base image. This could be to use a custom image or to simply avoid downloading the same image from the Internet repeatedly.master
parent
eb0430392e
commit
57815bdcc5
21
flash.zsh
21
flash.zsh
|
@ -67,10 +67,15 @@ function hybridize_gpt() {
|
||||||
function install_coreos() {
|
function install_coreos() {
|
||||||
local ignition="$1"
|
local ignition="$1"
|
||||||
local dev="$2"
|
local dev="$2"
|
||||||
|
local url="$3"
|
||||||
|
|
||||||
coreos-installer install \
|
if [ -z "${url}" ]; then
|
||||||
-a aarch64 \
|
set -- -a aarch64 -s stable
|
||||||
-s stable \
|
else
|
||||||
|
set -- --image-url "${url}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
coreos-installer install "$@" \
|
||||||
-i "${ignition}" \
|
-i "${ignition}" \
|
||||||
--console ttyS0,115200n8 \
|
--console ttyS0,115200n8 \
|
||||||
"${dev}"
|
"${dev}"
|
||||||
|
@ -79,6 +84,7 @@ function install_coreos() {
|
||||||
|
|
||||||
function parse_args() {
|
function parse_args() {
|
||||||
pi=4
|
pi=4
|
||||||
|
image_url=
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--pi)
|
--pi)
|
||||||
|
@ -88,6 +94,13 @@ function parse_args() {
|
||||||
--pi=*)
|
--pi=*)
|
||||||
pi=${1#--pi=}
|
pi=${1#--pi=}
|
||||||
;;
|
;;
|
||||||
|
--image-url)
|
||||||
|
shift
|
||||||
|
image_url=${1}
|
||||||
|
;;
|
||||||
|
--image-url=*)
|
||||||
|
image_url=${1#--image-url=}
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if [ -z "${ignition-}" ]; then
|
if [ -z "${ignition-}" ]; then
|
||||||
ignition="${1}"
|
ignition="${1}"
|
||||||
|
@ -128,7 +141,7 @@ if [ $(id -u) -ne 0 ]; then
|
||||||
exec sudo "$0" "$@"
|
exec sudo "$0" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install_coreos "${ignition}" "${dev}"
|
install_coreos "${ignition}" "${dev}" "${image_url}"
|
||||||
|
|
||||||
case "${pi}" in
|
case "${pi}" in
|
||||||
2|3)
|
2|3)
|
||||||
|
|
Loading…
Reference in New Issue