Skip to content
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_sysext: bugfixes, QoL changes, help updated #983

Merged
merged 3 commits into from
Jul 7, 2023

Conversation

t-lo
Copy link
Member

@t-lo t-lo commented Jul 7, 2023

This change improves build_sysext by sourcing a missing lib dependency, adding a number of comfort / quality-of-life options, and updating the output of --help accordingly.

The OEM sysext finction in build_library/vm_image_util.sh is also updated to use new command line format.

  1. Include missing dependency toolchain_util.sh to fix an error in board_options.sh when --board was not specified (get_board_arch undefined).
  2. Use positional parameters for mandatory arguments: sysext_name and binary_package are positional arguments now; the latter can be omitted if --metapkgs was specified.
  3. --squashfs_base is now guessed better and will use the most recent build by default.
  4. --image_builddir is now guessed and defaults to a sysext sub-directory in the directory the squashfs base resides in.
  5. A new boolean flag --ignore_version_mismatch for the more daring developer was added. The flag will cause the script to continue if a version mismatch between SDK board packages and squashfs base is detected.
  6. Error messages were improved for when mandatory parameters were not provided.
  7. The --help message was improved and adjusted to the new parameters.

Tested with a custom sysext build and with a image_to_vm.sh qemu build (for testing the generic OEM sysext build).

This change improves build_sysext by sourcing a missing lib dependency,
adding a number of comfort / quality-of-life options, and updating the
output of '--help' accordingly.

The OEM sysext finction in build_library/vm_image_util.sh is also
updated to use new command line format.

1. Include missing dependency toolchain_util.sh to fix an error in
   board_options.sh (get_board_arch undefined).
2. Use positional parameters for mandatory arguments.
   build_dir and sysext_name are mandatory and are now positional
   arguments instead of options.
   binary_package is the third positional argument but can be omitted
   if --metapkgs was specified.
3. --squashfs_base is now guessed better and will use the most recent
   build by default.
4. A new boolean flag --ignore_version_mismatch for the more daring
   developer was added. The flag will cause the script to continue if a
   version mismatch between SDK board packages and squashfs base is
   detected.
5. Error messages were improved for when mandatory parameters were not
   provided.
6. The '--help' message was improved and adjusted to the new parameters.

Signed-off-by: Thilo Fromm <[email protected]>
@t-lo t-lo requested a review from krnowak July 7, 2023 09:44
@t-lo t-lo requested a review from a team July 7, 2023 09:56
build_sysext Outdated
@@ -14,42 +14,55 @@ SCRIPT_ROOT=$(dirname "$(readlink -f "$0")")
assert_inside_chroot
assert_root_user

default_squashfs_base="$(readlink -f "${SCRIPT_ROOT}/../build/images/amd64-usr/latest/${FLATCAR_PRODUCTION_IMAGE_SYSEXT_BASE}")"
Copy link
Member

Choose a reason for hiding this comment

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

hmmm, hardcoding board?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's what I get from copy-pasting my command lines, meh. Will fix.

@jepio
Copy link
Member

jepio commented Jul 7, 2023

can you also add -noappend to the mksquashfs invocation?

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

Build action triggered: https://github.com/flatcar/scripts/actions/runs/5486621593

@t-lo
Copy link
Member Author

t-lo commented Jul 7, 2023

Fixed hard-coded architecture, added -noappend option to mksquashfs.

@t-lo t-lo requested review from jepio and a team July 7, 2023 11:28
Copy link
Member

@krnowak krnowak left a comment

Choose a reason for hiding this comment

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

Cool. Nice improvements, thanks!

The situation with meta packages being passed in a different way than binary packages (a flag with comma-separated list as its value vs. a list of positional parameters) is a bit iffy, but I don't really have anything better to suggest right now.

build_sysext Show resolved Hide resolved
@t-lo
Copy link
Member Author

t-lo commented Jul 7, 2023

@krnowak @jepio One more round please: --image_builddir is now guessed and defaults to a sysext sub-directory in the directory the squashfs base resides in. Everything else has been addressed.

This allows a user, after a build, to plainly run

./build_sysext python dev-lang/python

to build a python sysext for the OS image that was just built.

@t-lo t-lo merged commit 37b1d93 into main Jul 7, 2023
1 check failed
@t-lo t-lo deleted the t-lo/build_sysext-improvements branch July 7, 2023 13:20
build_sysext Show resolved Hide resolved
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.

3 participants