From 98668d0281c20af8424716ac4af2f4685bd7edb6 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 1 Mar 2023 18:30:58 +0100 Subject: [PATCH] coreos/stage1_hooks: Add a hook for pulling a newer version of baselayout Pull in a new version of baselayout to have a proper setup of lib directories in stage1. The proper setup means that the `lib` entry is now a directory instead of a symlink to `lib64`. Honestly, when rewording this commit, I realized that this hook is not really needed, as the updated baselayout ebuild just drops code that became dead after the profile update that the other hook does. But I decided to keep it as is, because the CI build with this hook has passed, and this hook will be needed anyway by the weekly updates. --- .../0000-bump-baselayout-coreos-overlay.sh | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0000-bump-baselayout-coreos-overlay.sh diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0000-bump-baselayout-coreos-overlay.sh b/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0000-bump-baselayout-coreos-overlay.sh new file mode 100755 index 0000000000..e294393eb8 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0000-bump-baselayout-coreos-overlay.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -euo pipefail + +stage1_repo="${1}" +new_repo="${2}" + +good_version="3.6.8-r9" +stage1_version='' + +for f in "${stage1_repo}/sys-apps/baselayout/baselayout-"*'.ebuild'; do + f="${f##*/}" + if [[ "${f}" = *9999* ]]; then continue; fi + f="${f%.ebuild}" + f="${f#baselayout-}" + stage1_version="${f}" +done + +if [[ -z "${stage1_version}" ]]; then exit 1; fi + +older_version=$(printf '%s\n' "${stage1_version}" "${good_version}" | sort -V | head -n 1) + +if [[ "${older_version}" = "${good_version}" ]]; then + # Stage1 version is equal or newer than the good version, nothing + # to do. + exit 0 +fi + +rm -rf "${stage1_repo}/sys-apps/baselayout" +cp -a "${new_repo}/sys-apps/baselayout" "${stage1_repo}/sys-apps/baselayout"