mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-12 07:26:58 +02:00
coreos/stage1_hooks: Add a hook for updating a profile in stage1
This is to make sure that the directory layout wrt. lib directories in stage1 is correctly set up from the beginning, because it gets propagated all the way to the final SDK image. It's easier to do it that way, rather than following the steps described in the deprecation notice of the 17.0 profile.
This commit is contained in:
parent
98668d0281
commit
1ad0ce9964
25
sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0001-update-profile-coreos-overlay.sh
vendored
Executable file
25
sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0001-update-profile-coreos-overlay.sh
vendored
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
stage1_repo="${1}"
|
||||
new_repo="${2}"
|
||||
parent_file='profiles/coreos/amd64/parent'
|
||||
old_parent_line='portage-stable:default/linux/amd64/17.0/no-multilib/hardened'
|
||||
stage1_parent="${stage1_repo}/${parent_file}"
|
||||
new_parent="${new_repo}/${parent_file}"
|
||||
|
||||
if [[ ! -e "${new_parent}" ]]; then
|
||||
echo "no file '${parent_file}' in new repo, nothing to do"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ ! -e "${stage1_parent}" ]]; then
|
||||
echo "no file '${parent_file}' in stage1 repo, nothing to do"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if grep --quiet --fixed-strings --line-regexp --regexp="${old_parent_line}" -- "${stage1_parent}"; then
|
||||
rm -f "${stage1_parent}"
|
||||
cp -a "${new_parent}" "${stage1_parent}"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user