Skip to content

Conversation

@ajeddeloh
Copy link
Contributor

@ajeddeloh ajeddeloh commented Jun 20, 2019

Also fail out on unsupported arches and continue using anaconda on
aarch64.

Tested on packet (bios) and that worked with the current fcos installer, ran through a cosa build on arm64 as well to confirm this doesn't break that.

Fixes #334

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Looks good from a quick scan!
Haven't had a chance to test it yet.


Build raw metal images for bios or metal. If neither switches are provided,
both targets are built.
Build raw metal images.
Copy link
Member

Choose a reason for hiding this comment

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

I guess we only have one metal image now, right? So raw metal image ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Build a bare metal image? raw seems redundant.

itype=metal
img=${name}-${build}-${itype}.raw
if [ -f "${builddir}/${img}" ]; then
echo "Image $itype already exists"
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just Bare metal image already exists

@ajeddeloh
Copy link
Contributor Author

Pushed the suggested changes

/usr/lib/coreos-assembler/estimate-commit-disk-size --repo "$ostree_repo" "$ref" > "$PWD/tmp/ostree-size.json"
fi
size="$(jq '."estimate-mb".final' "$PWD/tmp/ostree-size.json")"
# 384M is the non-ostree partitions
Copy link
Member

Choose a reason for hiding this comment

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

Random thought related to this: I remember we recently discussed the fact that because we don't actually expand until the real root, it technically limits how much Ignition can write to the disk. Or I forgot, did we say we want to switch that auto-expand logic to a base config so ignition-disks does it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't remember where we stand on that either, but it's somewhat disconnected from this PR. Ignition disks notably can't extend filesystems, only partitions (fixing that is... complicated). We might think about doing something between disks and files though (effectively moving coreos-growpart or something like it to the initramfs).

This currently matches the existing behavior, lets separate any changes there to another PR?

Copy link
Member

Choose a reason for hiding this comment

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

Yup, WFM!

@jlebon jlebon self-assigned this Jun 27, 2019
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Nice, built and installed locally with no issues.
Just a couple more comments.

rm -f "${path}".tmp
else
if [ ! -e "$PWD/tmp/ostree-size.json" ]; then
/usr/lib/coreos-assembler/estimate-commit-disk-size --repo "$ostree_repo" "$ref" > "$PWD/tmp/ostree-size.json"
Copy link
Member

Choose a reason for hiding this comment

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

An echo "Estimating disk size..." here would be useful, since it does take some time.

/usr/lib/coreos-assembler/estimate-commit-disk-size --repo "$ostree_repo" "$ref" > "$PWD/tmp/ostree-size.json"
fi
size="$(jq '."estimate-mb".final' "$PWD/tmp/ostree-size.json")"
# 384M is the non-ostree partitions
Copy link
Member

Choose a reason for hiding this comment

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

Yup, WFM!

"x86_64"|"aarch64")
## fall through to the rest of the file
;;
"ppc64le"|"s390x")
Copy link
Member

Choose a reason for hiding this comment

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

Minor: wouldn't just * here be safer?

path=${PWD}/${img}
run_virtinstall "${ostree_repo}" "${ref}" "${path}.tmp" --variant="${itype}"
if [ "$arch" == "aarch64" ]; then
run_virtinstall "${ostree_repo}" "${ref}" "${path}.tmp" --variant="${itype}-uefi"
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, how come we don't have to estimate the disk size in this path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do, it's in run_virtinstall

@ajeddeloh
Copy link
Contributor Author

Fixed!

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

LGTM! Optional tweak but feel free to merge as is.

/usr/lib/coreos-assembler/estimate-commit-disk-size --repo "$ostree_repo" "$ref" > "$PWD/tmp/ostree-size.json"
fi
size="$(jq '."estimate-mb".final' "$PWD/tmp/ostree-size.json")"
echo "Disk size estimated to $size"
Copy link
Member

Choose a reason for hiding this comment

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

Minor/optional: this has no units. Maybe just move it one line down so we print with the M.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh right. fixed now. That would have also left off the 384M.

Also fail out on unsupported arches and continue using anaconda on
aarch64.
@jlebon jlebon merged commit 55102a2 into coreos:master Jun 27, 2019
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.

investigate UEFI/BIOS combined bare metal image

2 participants