init: add ability to use existing ISO/sha256sum#210
init: add ability to use existing ISO/sha256sum#210cgwalters merged 1 commit intocoreos:masterfrom miabbott:iso_location
Conversation
cgwalters
left a comment
There was a problem hiding this comment.
LGTM overall, so far I've generally been doing cp -al /srv/fcos/installer /srv/silverblue/installer then coreos-assembler init --force.
That said I lean a bit towards baking in the installer to the image, but in the end we're going to move away from Anaconda anyways.
| if [ "${INSTALLER_DIR}" != "null" ] && [ "${FORCE}" != "1" ]; then | ||
| if (cd "${INSTALLER_DIR}" && sha256sum -c "${checksums_bn}"); then | ||
| (cd installer | ||
| cp "${INSTALLER_DIR}"/"${installer_bn}" . |
There was a problem hiding this comment.
cp --reflink=auto is a general good practice.
| # Initialize FORCE to 0 | ||
| # Initialize FORCE to 0 and INSTALLER_DIR to null | ||
| FORCE=0 | ||
| INSTALLER_DIR="null" |
There was a problem hiding this comment.
Hm...I'd say use the empty string "" as an "unset" value.
| checksums_bn=$(basename ${INSTALLER_CHECKSUM}) | ||
| mkdir -p installer | ||
|
|
||
| if [ "${INSTALLER_DIR}" != "null" ] && [ "${FORCE}" != "1" ]; then |
There was a problem hiding this comment.
Then [ -n "${INSTALLER_DIR}" ] && ...
I found myself doing a lot of `init` operations when testing changes related to #190 and wanted a way to skip the download of the ISO/sha256sum. This change introduces a new flag (`--installerdir`) that will instruct the `init` command to look in a provided directory for the ISO and sha256sum. If the required files are found, they'll be copied to the `installer` directory for use later on. If the `--force` option is provided, it downloads the ISO/sha256sum regardless if the `--installerdir` flag is provided.
|
Thanks for the feedback! Updated ⬆️ |
|
👍 |
| if (cd "${INSTALLER_DIR}" && sha256sum -c "${checksums_bn}"); then | ||
| (cd installer | ||
| cp --reflink=auto "${INSTALLER_DIR}"/"${installer_bn}" . | ||
| cp --reflink=auto "${INSTALLER_DIR}"/"${checksums_bn}" . |
There was a problem hiding this comment.
Though why even copy it? We could just ln -s here, right? There's precedence at least doing this with how we handle local paths to checkouts of fedora-coreos-config.
There was a problem hiding this comment.
I think really we want ln and then fall back to cp --reflink=auto, like what ostree does.
But in the end we're going to be dropping Anaconda hopefully soon anyways...
I found myself doing a lot of
initoperations when testing changesrelated to #190 and wanted a way to skip the download of the
ISO/sha256sum.
This change introduces a new flag (
--installerdir) that willinstruct the
initcommand to look in a provided directory for theISO and sha256sum. If the required files are found, they'll be copied
to the
installerdirectory for use later on.If the
--forceoption is provided, it downloads the ISO/sha256sumregardless if the
--installerdirflag is provided.