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

ignition-ostree-rootfs: use our own tmpfs with size=80% #685

Merged
merged 3 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions kola-denylist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,3 @@
streams:
- next
- next-devel
# The ext.config.root-reprovision* tests are failing on Fedora 33
# for now. Exclude running the test on `next` and `next-devel`.
- pattern: ext.config.root-reprovision.*
tracker: https://github.com/coreos/fedora-coreos-tracker/issues/644
streams:
- next
- next-devel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ case "${1:-}" in
fi
echo "Detected rootfs replacement in fetched Ignition config: /run/ignition.json"
mkdir "${saved_sysroot}"
# use 80% of RAM: we want to be greedy since the boot breaks anyway, but
# we still want to leave room for everything else so it hits ENOSPC and
# doesn't invoke the OOM killer
mount -t tmpfs tmpfs "${saved_sysroot}" -o size=80%
;;
save)
mount "${rootdisk}" /sysroot
Expand All @@ -29,10 +33,15 @@ case "${1:-}" in
# This one is in a private mount namespace since we're not "offically" mounting
mount "${rootdisk}" /sysroot
echo "Restoring rootfs from RAM..."
cd "${saved_sysroot}"
find . -mindepth 1 -maxdepth 1 -exec mv -t /sysroot {} \;
find "${saved_sysroot}" -mindepth 1 -maxdepth 1 -exec mv -t /sysroot {} \;
chattr +i $(ls -d /sysroot/ostree/deploy/*/deploy/*/)
;;
cleanup)
if [ -d "${saved_sysroot}" ]; then
umount "${saved_sysroot}"
rm -rf "${saved_sysroot}" "${partstate}"
fi
;;
*)
echo "Unsupported operation: ${1:-}" 1>&2; exit 1
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ After=systemd-udevd.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/run/ignition.env
ExecStart=/usr/libexec/ignition-ostree-dracut-rootfs detect
ExecStop=/usr/libexec/ignition-ostree-dracut-rootfs cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ConditionPathIsDirectory=/run/ignition-ostree-rootfs
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/run/ignition.env
# So we can transiently mount sysroot
MountFlags=slave
ExecStart=/usr/libexec/ignition-ostree-dracut-rootfs restore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ After=coreos-gpt-setup.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/run/ignition.env
# So we can transiently mount sysroot
MountFlags=slave
ExecStart=/usr/libexec/ignition-ostree-dracut-rootfs save