-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build live PXE and ISO images #738
Changes from all commits
9a9614f
b03676e
d289bd6
23a35f1
48277ec
8fc5ec8
0c5e593
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cmd-buildextend-installer |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
dn=$(dirname "$0") | ||
# shellcheck source=src/cmdlib.sh | ||
. "${dn}"/cmdlib.sh | ||
# shellcheck source=src/libguestfish.sh | ||
. "${dn}"/libguestfish.sh | ||
|
||
# Usage: gf-mksquashfs <input image> <output image> | ||
# Example: gf-mksquashfs fedora-coreos.qcow2 fedora-coreos.squashfs | ||
# | ||
# This will generate a squashfs from the contents of the root partition. | ||
|
||
src="$1" | ||
dest="$2" | ||
|
||
if [[ $src == *.gz || $src == *.xz ]]; then | ||
img="$(basename "$src")" | ||
fatal "Cannot generate squashfs from $img; not an uncompressed image" | ||
fi | ||
|
||
set -x | ||
# Work in a tmpdir on the destination so that we don't inherit some MCS labeling | ||
# from the /tmp dir in the container. This also ensures that the final move is a | ||
# pure `rename()`. | ||
# See also: | ||
# https://github.com/coreos/coreos-assembler/issues/292 | ||
# https://github.com/coreos/coreos-assembler/pull/394 | ||
tmpd=$(mktemp -tdp "$(dirname "${dest}")" gf-mksquashfs.XXXXXX) | ||
tmp_dest=${tmpd}/image.squashfs | ||
|
||
coreos_gf_run "${src}" --ro | ||
|
||
root=$(coreos_gf findfs-label root) | ||
coreos_gf mount "${root}" / | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't include the kernel and initramfs. We could include everything else, if that's the right way to proceed. Filed as ostreedev/ostree#1921, and let's not block this PR for it. |
||
|
||
coreos_gf mksquashfs / "${tmp_dest}" compress:zstd | ||
dustymabe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
coreos_gf_shutdown | ||
|
||
mv "${tmp_dest}" "${dest}" | ||
rm "${tmpd}" -rf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely took me a minute looking at the code sideways :) - any idea how long before we can drop the other images?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For FCOS, hopefully soon. For RHCOS it's more of a policy question.