-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
40ignition-ostree: split out
coreos-rootflags
script
Split out a small script where the canonical rootflags live in the non-reprovisioning case. This will be used by both `ignition-ostree-mount-sysroot` and `rdcore rootmap`.
- Loading branch information
Showing
3 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/coreos-rootflags.sh
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,19 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
rootpath=/dev/disk/by-label/root | ||
|
||
# If the rootfs was reprovisioned, then the user is free to define their own | ||
# rootflags. | ||
if [ -d /run/ignition-ostree-rootfs ]; then | ||
exit 0 | ||
fi | ||
|
||
eval $(blkid -o export ${rootpath}) | ||
# this really should always be true, but let's be conservative | ||
if [ "${TYPE}" == "xfs" ]; then | ||
# We use prjquota on XFS by default to aid multi-tenant Kubernetes (and | ||
# other container) clusters. See | ||
# https://github.com/coreos/coreos-assembler/pull/303/commits/6103effbd006bb6109467830d6a3e42dd847668d | ||
echo "prjquota" | ||
fi |
21 changes: 9 additions & 12 deletions
21
overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-mount-sysroot.sh
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 |
---|---|---|
@@ -1,20 +1,17 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# We use prjquota on XFS by default to aid multi-tenant | ||
# Kubernetes (and other container) clusters. See | ||
# https://github.com/coreos/coreos-assembler/pull/303/commits/6103effbd006bb6109467830d6a3e42dd847668d | ||
# In the future this will be augmented with a check for whether | ||
# or not we've reprovisioned the rootfs, since we don't want to | ||
# force on prjquota there. | ||
# Note that on *new machines* this script is now only ever used on firstboot. On | ||
# subsequent boots, systemd-fstab-generator mounts /sysroot from the | ||
# root=UUID=... and rootflags=... kargs. | ||
|
||
# We may do a migration window at some point where older machines have these | ||
# kargs injected so that we can simplify the model further. | ||
|
||
rootpath=/dev/disk/by-label/root | ||
if ! [ -b "${rootpath}" ]; then | ||
echo "ignition-ostree-mount-sysroot: Failed to find ${rootpath}" 1>&2 | ||
exit 1 | ||
fi | ||
eval $(blkid -o export ${rootpath}) | ||
mountflags= | ||
if [ "${TYPE}" == "xfs" ]; then | ||
mountflags=prjquota | ||
fi | ||
mount -o "${mountflags}" "${rootpath}" /sysroot | ||
|
||
mount -o "$(coreos-rootflags)" "${rootpath}" /sysroot |
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