Skip to content

init: add ability to use existing ISO/sha256sum#210

Merged
cgwalters merged 1 commit intocoreos:masterfrom
miabbott:iso_location
Nov 13, 2018
Merged

init: add ability to use existing ISO/sha256sum#210
cgwalters merged 1 commit intocoreos:masterfrom
miabbott:iso_location

Conversation

@miabbott
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/cmd-init Outdated
if [ "${INSTALLER_DIR}" != "null" ] && [ "${FORCE}" != "1" ]; then
if (cd "${INSTALLER_DIR}" && sha256sum -c "${checksums_bn}"); then
(cd installer
cp "${INSTALLER_DIR}"/"${installer_bn}" .
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cp --reflink=auto is a general good practice.

Comment thread src/cmd-init Outdated
# Initialize FORCE to 0
# Initialize FORCE to 0 and INSTALLER_DIR to null
FORCE=0
INSTALLER_DIR="null"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm...I'd say use the empty string "" as an "unset" value.

Comment thread src/cmd-init Outdated
checksums_bn=$(basename ${INSTALLER_CHECKSUM})
mkdir -p installer

if [ "${INSTALLER_DIR}" != "null" ] && [ "${FORCE}" != "1" ]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@miabbott
Copy link
Copy Markdown
Member Author

Thanks for the feedback! Updated ⬆️

@cgwalters cgwalters merged commit 7f8d245 into coreos:master Nov 13, 2018
@dustymabe
Copy link
Copy Markdown
Member

👍

Comment thread src/cmd-init
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}" .
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants