-
Notifications
You must be signed in to change notification settings - Fork 206
Misc. Improvements Draft PR #2294
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
base: main
Are you sure you want to change the base?
Changes from all commits
b950604
b08e289
b49c268
dfad00c
69807fe
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 |
|---|---|---|
|
|
@@ -32,28 +32,42 @@ prefix ?= /usr | |
| CARGO_FEATURES_DEFAULT ?= $(shell . /usr/lib/os-release; if echo "$$ID_LIKE" |grep -qF rhel; then echo rhsm; fi) | ||
| # You can set this to override all cargo features, including the defaults | ||
| CARGO_FEATURES ?= $(CARGO_FEATURES_DEFAULT) | ||
| BOOTC_PROFILE ?= $(if $(wildcard target/rpm/bootc),rpm,release) | ||
| BOOTC_TARGET_DIR = target/$(BOOTC_PROFILE) | ||
|
|
||
| # Build all binaries | ||
| .PHONY: bin | ||
| bin: manpages | ||
| cargo build --release --features "$(CARGO_FEATURES)" --bins | ||
| if [ ! -x "$(BOOTC_TARGET_DIR)/bootc" ]; then \ | ||
| cargo build --release --features "$(CARGO_FEATURES)" --bins; \ | ||
| fi | ||
|
|
||
| # Note this cargo build is run without features (such as rhsm) | ||
| .PHONY: manpages | ||
| manpages: | ||
| cargo run --release --package xtask -- manpages | ||
| if [ -x "$(BOOTC_TARGET_DIR)/bootc" ]; then \ | ||
|
Collaborator
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. But yes, this is really really messy how we have our documentation depend on running the binary. Maybe what is easier is to try to move instead to where we just validate the generated docs as a separate phase, but don't default to linking the two together. It's effectively what we did for the tmt stuff |
||
| rm -rf target/man; \ | ||
| if [ -x "$(BOOTC_TARGET_DIR)/xtask" ]; then \ | ||
| BOOTC_DOCGEN_BIN="$(BOOTC_TARGET_DIR)/bootc" "$(BOOTC_TARGET_DIR)/xtask" manpages; \ | ||
| else \ | ||
| BOOTC_DOCGEN_BIN="$(BOOTC_TARGET_DIR)/bootc" cargo run --release --package xtask -- manpages; \ | ||
| fi; \ | ||
| else \ | ||
| mkdir -p target/man; \ | ||
| printf '.TH BOOTC 8\n.SH NAME\nbootc \\- bootable container system\n' > target/man/bootc.8; \ | ||
| printf '.TH BOOTC-SETUP-ROOT-CONF 5\n.SH NAME\nbootc-setup-root.conf \\- bootc setup-root configuration\n' > target/man/bootc-setup-root-conf.5; \ | ||
| fi | ||
|
|
||
| .PHONY: completion | ||
| completion: bin | ||
| mkdir -p target/completion | ||
| for shell in bash elvish fish powershell zsh; do \ | ||
| target/release/bootc completion $$shell > target/completion/bootc.$$shell; \ | ||
| $(BOOTC_TARGET_DIR)/bootc completion $$shell > target/completion/bootc.$$shell; \ | ||
| done | ||
|
|
||
| STORAGE_RELATIVE_PATH ?= $(shell realpath -m -s --relative-to="$(prefix)/lib/bootc/storage" /sysroot/ostree/bootc/storage) | ||
| install: completion | ||
| install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/bootc | ||
| install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/system-reinstall-bootc | ||
| install -D -m 0755 -t $(DESTDIR)$(prefix)/bin $(BOOTC_TARGET_DIR)/bootc | ||
| install -D -m 0755 -t $(DESTDIR)$(prefix)/bin $(BOOTC_TARGET_DIR)/system-reinstall-bootc | ||
| install -d -m 0755 $(DESTDIR)$(prefix)/lib/bootc/bound-images.d | ||
| install -d -m 0755 $(DESTDIR)$(prefix)/lib/bootc/kargs.d | ||
| ln -s "$(STORAGE_RELATIVE_PATH)" "$(DESTDIR)$(prefix)/lib/bootc/storage" | ||
|
|
@@ -83,7 +97,7 @@ install: completion | |
| install -D -m 0755 -t $(DESTDIR)/$(prefix)/lib/bootc contrib/scripts/fedora-bootc-destructive-cleanup; \ | ||
| fi | ||
| install -D -m 0644 -t $(DESTDIR)/usr/lib/systemd/system crates/initramfs/*.service | ||
| install -D -m 0755 target/release/bootc-initramfs-setup $(DESTDIR)/usr/lib/bootc/initramfs-setup | ||
| install -D -m 0755 $(BOOTC_TARGET_DIR)/bootc-initramfs-setup $(DESTDIR)/usr/lib/bootc/initramfs-setup | ||
| install -D -m 0755 -t $(DESTDIR)/usr/lib/dracut/modules.d/51bootc crates/initramfs/dracut/module-setup.sh | ||
|
|
||
| # Run this to also take over the functionality of `ostree container` for example. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -748,11 +748,7 @@ fn basic_packing<'a>( | |
| // If there are fewer packages/components than there are bins, then we don't need to do | ||
| // any "bin packing" at all; just assign a single component to each and we're done. | ||
| if before_processing_pkgs_len < bin_size.get() as usize { | ||
| let mut r = components.iter().map(|pkg| vec![pkg]).collect::<Vec<_>>(); | ||
| if before_processing_pkgs_len > 0 { | ||
| let new_pkgs_bin: Vec<&ObjectSourceMetaSized> = Vec::new(); | ||
| r.push(new_pkgs_bin); | ||
| } | ||
| let r = components.iter().map(|pkg| vec![pkg]).collect::<Vec<_>>(); | ||
| return Ok(r); | ||
| } | ||
|
|
||
|
|
@@ -855,8 +851,6 @@ fn basic_packing<'a>( | |
| r.push(max_freq_components); | ||
| } | ||
|
|
||
| // Allocate an empty bin for new packages | ||
|
Collaborator
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 agree we never used this in practice, and we can probably drop it now. OTOH, this code is basically obsoleted by https://github.com/coreos/chunkah anyways?
Contributor
Author
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. that is a nice tool. I will keep it in mind for non-ostree images ostree-ext provides a fast deploy path for ostree backends so it will have to stay around until the composefs backend is stable with similar performance to the fast ostree deploy path, then add 2-3 more years for migration or a way to specify to bootc interim migration paths so e.g., version 2027.3 switches to composefs and points ostree instances to 2027.2 that has the machinery to migrate from ostree to composefs while being built for ostree. Ah. |
||
| r.push(Vec::new()); | ||
| let after_processing_pkgs_len = r.iter().map(|b| b.len()).sum::<usize>(); | ||
| assert_eq!(after_processing_pkgs_len, before_processing_pkgs_len); | ||
| assert!(r.len() <= bin_size.get() as usize); | ||
|
|
||
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.
This completely breaks the buildsystem, no? We'd just silently be reusing old binaries...
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.
yes, that patch is not good and not designed for merge. But it did its job for me.
It is very hard to iterate with bootc while having it compile three times to deploy