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

flatcar-postinst: Ensure /etc/extensions is mergable #32

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions flatcar-postinst
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,18 @@ for NAME in $(grep -h -o '^[^#]*' /etc/flatcar/enabled-sysext.conf /usr/share/fl
mv "/var/lib/update_engine/flatcar-${NAME}.raw" "/etc/flatcar/sysext/flatcar-${NAME}-${NEXT_VERSION}.raw"
done

# A mkdir -p /etc/extensions was done for the OEM sysext symlink when the /etc overlay
# was already set up but we didn't ship /etc/extensions in the lowerdir. Since overlayfs
# creates any folders that don't exist in the lowerdir as opaque it means that when
# they appear later in the lowerdir through an update, the lowerdir folder is ignored.
# That happened in the update from, e.g., 3760.1.0 to 3794.0.0 to where /etc/extensions
# wasn't present in /usr/share/flatcar/etc/.
# To fix this, remove any opaque markers for this directory. Other common folders which
# we introduce later in the lowerdir could also be handled that way, e.g., /etc/cni/.
if mountpoint -q /etc; then
unshare -m sh -c "umount /etc && mkdir -p /etc/extensions && attr -R -r overlay.opaque /etc/extensions || true"
fi

# Keep old nodes on cgroup v1
if [[ "${BUILD_ID}" != "dev-"* ]]; then
if [ "${VERSION_ID%%.*}" -lt 2956 ]; then
Expand Down