-
Notifications
You must be signed in to change notification settings - Fork 524
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
add support for unified image layout #1870
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c4c2dc2
systemd: exclude default repart service
bcressey 067671a
release: use systemd-repart for partition resizing
bcressey 6f2c173
build: add support for building unified images
bcressey 4c7912f
pubsys: add support for publishing unified images
bcressey 29de89f
release: label overlayfs state directories
bcressey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Local Directory (/local) | ||
DefaultDependencies=no | ||
Conflicts=umount.target | ||
Before=local-fs.target umount.target | ||
|
||
[Mount] | ||
What=/dev/disk/by-partlabel/BOTTLEROCKET-DATA | ||
Where=/local | ||
Type=ext4 | ||
Options=defaults,noatime,nosuid,nodev | ||
|
||
[Install] | ||
WantedBy=preconfigured.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Partition] | ||
# This is the partition type UUID for BOTTLEROCKET-DATA, which will be resized | ||
# to fill the remaining sectors on the disk where it resides. | ||
Type=626f7474-6c65-6474-6861-726d61726b73 | ||
|
||
# We want the partition to end on the last 1 MiB boundary before the end of | ||
# the disk, to match the historical implementation. Assuming the disk itself is | ||
# an even multiple of MiBs in size, and using 512 byte sectors as an example, | ||
# we need 33 sectors for the GPT label in the last MiB, and therefore want 2015 | ||
# sectors left, or 1031680 bytes. The repart tool expects a multiple of 4096, | ||
# which is (1031680 - (1031680 % 4096)), or 1028096 bytes. | ||
PaddingMinBytes=1028096 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ Summary: Bottlerocket release | |
License: Apache-2.0 OR MIT | ||
|
||
Source11: nsswitch.conf | ||
Source96: release-repart-local.conf | ||
Source97: release-sysctl.conf | ||
Source98: release-systemd-system.conf | ||
Source99: release-tmpfiles.conf | ||
|
@@ -31,6 +32,7 @@ Source1008: var-lib-bottlerocket.mount | |
Source1009: etc-cni.mount | ||
Source1010: mnt.mount | ||
Source1012: opt-cni-bin.mount | ||
Source1013: local.mount | ||
|
||
# CD-ROM mount & associated udev rules | ||
Source1015: media-cdrom.mount | ||
|
@@ -45,6 +47,7 @@ Source1023: lib-modules.mount.in | |
# Mounts that require helper programs | ||
Source1040: prepare-boot.service | ||
Source1041: prepare-local.service | ||
Source1042: repart-local.service | ||
|
||
# Services for kdump support | ||
Source1060: capture-kernel-dump.service | ||
|
@@ -101,6 +104,9 @@ install -p -m 0644 %{S:11} %{buildroot}%{_cross_factorydir}%{_cross_sysconfdir} | |
install -d %{buildroot}%{_cross_factorydir}%{_cross_sysconfdir}/wicked/ifconfig | ||
install -p -m 0644 %{S:1000} %{buildroot}%{_cross_factorydir}%{_cross_sysconfdir}/wicked/ifconfig | ||
|
||
install -d %{buildroot}%{_cross_libdir}/repart.d | ||
install -p -m 0644 %{S:96} %{buildroot}%{_cross_libdir}/repart.d/80-local.conf | ||
|
||
install -d %{buildroot}%{_cross_sysctldir} | ||
install -p -m 0644 %{S:97} %{buildroot}%{_cross_sysctldir}/80-release.conf | ||
|
||
|
@@ -117,9 +123,9 @@ EOF | |
|
||
install -d %{buildroot}%{_cross_unitdir} | ||
install -p -m 0644 \ | ||
%{S:1001} %{S:1002} %{S:1003} %{S:1004} %{S:1005} \ | ||
%{S:1006} %{S:1007} %{S:1008} %{S:1009} %{S:1010} %{S:1011} %{S:1012} \ | ||
%{S:1015} %{S:1040} %{S:1041} %{S:1060} %{S:1061} %{S:1062} %{S:1080} \ | ||
%{S:1001} %{S:1002} %{S:1003} %{S:1004} %{S:1005} %{S:1006} %{S:1007} \ | ||
%{S:1008} %{S:1009} %{S:1010} %{S:1011} %{S:1012} %{S:1013} %{S:1015} \ | ||
%{S:1040} %{S:1041} %{S:1042} %{S:1060} %{S:1061} %{S:1062} %{S:1080} \ | ||
Comment on lines
-120
to
+128
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. This hurts to review 😰 |
||
%{buildroot}%{_cross_unitdir} | ||
|
||
install -d %{buildroot}%{_cross_unitdir}/systemd-tmpfiles-setup.service.d | ||
|
@@ -162,6 +168,8 @@ ln -s %{_cross_unitdir}/preconfigured.target %{buildroot}%{_cross_unitdir}/defau | |
%{_cross_sysctldir}/80-release.conf | ||
%{_cross_tmpfilesdir}/release.conf | ||
%{_cross_libdir}/os-release | ||
%dir %{_cross_libdir}/repart.d | ||
%{_cross_libdir}/repart.d/80-local.conf | ||
%{_cross_libdir}/systemd/system.conf.d/80-release.conf | ||
%{_cross_unitdir}/configured.target | ||
%{_cross_unitdir}/preconfigured.target | ||
|
@@ -174,12 +182,14 @@ ln -s %{_cross_unitdir}/preconfigured.target %{buildroot}%{_cross_unitdir}/defau | |
%{_cross_unitdir}/load-crash-kernel.service | ||
%{_cross_unitdir}/prepare-boot.service | ||
%{_cross_unitdir}/prepare-local.service | ||
%{_cross_unitdir}/repart-local.service | ||
%{_cross_unitdir}/var.mount | ||
%{_cross_unitdir}/opt.mount | ||
%{_cross_unitdir}/mnt.mount | ||
%{_cross_unitdir}/etc-cni.mount | ||
%{_cross_unitdir}/opt-cni-bin.mount | ||
%{_cross_unitdir}/media-cdrom.mount | ||
%{_cross_unitdir}/local.mount | ||
%{_cross_unitdir}/*-lower.mount | ||
%{_cross_unitdir}/*-kernels.mount | ||
%{_cross_unitdir}/*-licenses.mount | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[Unit] | ||
Description=Resize Data Partition | ||
DefaultDependencies=no | ||
Conflicts=shutdown.target | ||
Wants=dev-disk-by\x2dpartlabel-BOTTLEROCKET\x2dDATA.device | ||
After=dev-disk-by\x2dpartlabel-BOTTLEROCKET\x2dDATA.device | ||
|
||
# Ensure the device is mounted first, to avoid racing with the unit that tries | ||
# to mount it since the symlink can disappear if the partition is resized. | ||
RequiresMountsFor=/local | ||
|
||
[Service] | ||
Type=oneshot | ||
|
||
# Resize the partition, whether or not it resides on the same disk as /. | ||
ExecStart=/usr/bin/systemd-repart --dry-run=no /dev/disk/by-partlabel/BOTTLEROCKET-DATA | ||
|
||
# Grow the filesystem to fill the partition. Doing this in another unit could | ||
# introduce a race if the underlying block device is not ready after resizing. | ||
ExecStart=/usr/lib/systemd/systemd-growfs /local | ||
|
||
RemainAfterExit=true | ||
StandardError=journal+console | ||
|
||
# systemd-repart returns 77 if there's no existing GPT partition table | ||
SuccessExitStatus=77 | ||
|
||
[Install] | ||
WantedBy=local-fs.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why is this a drop-in, and not part of the unit itself?
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.
systemd-repart
looks for its config files in/usr/lib/repart.d
, like howsystemd-tmpfiles
looks in/usr/lib/tmpfiles.d
.