From dfdd8463732d393ea2a67c2ac2b88d4f79d89098 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 6 Mar 2024 16:42:25 +0100 Subject: [PATCH] overlay stage1-hooks: Add hooks for libxcrypt migration --- .../0000-glibc-coreos-portage-stable.sh | 17 +++++++ .../0002-glibc-crypt-coreos-overlay.sh | 51 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100755 sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0000-glibc-coreos-portage-stable.sh create mode 100755 sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0002-glibc-crypt-coreos-overlay.sh diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0000-glibc-coreos-portage-stable.sh b/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0000-glibc-coreos-portage-stable.sh new file mode 100755 index 00000000000..78ba8663f8c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0000-glibc-coreos-portage-stable.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -x +set -euo pipefail + +stage1_repo="${1}" +new_repo="${2}" + +cat=sys-libs +pkg=libxcrypt + +if [[ -d "${stage1_repo}/${cat}/${pkg}" ]]; then + # libxcrypt is already a part of portage-stable, nothing to do + exit 0 +fi + +mkdir -p "${stage1_repo}/${cat}" +cp -a "${new_repo}/${cat}/${pkg}" "${stage1_repo}/${cat}/${pkg}" diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0002-glibc-crypt-coreos-overlay.sh b/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0002-glibc-crypt-coreos-overlay.sh new file mode 100755 index 00000000000..1ec06952caa --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0002-glibc-crypt-coreos-overlay.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -x +set -euo pipefail + +stage1_repo="${1}" +new_repo="${2}" + +base_profile_dir='profiles/coreos/base' + +declare -A fixups_old=( + ['package.mask']='>=virtual/libcrypt-2' + ['package.unmask']='=virtual/libcrypt-1-r1' + ['package.use.force']='sys-libs/glibc crypt' + ['package.use.mask']='sys-libs/glibc -crypt' +) + +declare -A fixups_new=( + ['package.mask']='>=virtual/libcrypt-2' + ['package.unmask']='"${ff}" + done + exit 0 +done