mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 22:51:03 +02:00
fix(update_chroot): Generate make.conf.host_setup before update scripts.
This doesn't currently have any real impact but seems like a better ordering since update scripts may need to emerge things. Add some friendly version info logging.
This commit is contained in:
parent
f871c34186
commit
5ac0bcdd27
@ -46,6 +46,17 @@ switch_to_strict_mode
|
|||||||
|
|
||||||
. ${SCRIPTS_DIR}/sdk_lib/make_conf_util.sh
|
. ${SCRIPTS_DIR}/sdk_lib/make_conf_util.sh
|
||||||
|
|
||||||
|
# Create /etc/make.conf.host_setup. The file content is regenerated
|
||||||
|
# from scratch every update. There are various reasons to do this:
|
||||||
|
# + It's cheap, so this is an easy way to guarantee correct content
|
||||||
|
# after an upgrade.
|
||||||
|
# + Inside make_chroot.sh, we use a temporary version of the file
|
||||||
|
# which must be updated before the script completes; that final
|
||||||
|
# update happens here.
|
||||||
|
# + If the repositories change to add or remove the private
|
||||||
|
# overlay, the file may need to be regenerated.
|
||||||
|
create_host_setup
|
||||||
|
|
||||||
# Run version hooks as pre-update
|
# Run version hooks as pre-update
|
||||||
if [[ -f /etc/lsb-release ]]; then
|
if [[ -f /etc/lsb-release ]]; then
|
||||||
OLDVER=$(grep "^COREOS_RELEASE_VERSION=" /etc/lsb-release | cut -d = -f 2-)
|
OLDVER=$(grep "^COREOS_RELEASE_VERSION=" /etc/lsb-release | cut -d = -f 2-)
|
||||||
@ -53,6 +64,10 @@ else
|
|||||||
OLDVER="0.0.0"
|
OLDVER="0.0.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
info "Updating chroot:"
|
||||||
|
info " chroot version: $OLDVER"
|
||||||
|
info " CoreOS version: $COREOS_VERSION_STRING"
|
||||||
|
|
||||||
# Updates should be of the form 1.2.3_desc.sh
|
# Updates should be of the form 1.2.3_desc.sh
|
||||||
for update_script in ${SCRIPTS_DIR}/sdk_lib/updates/*.sh; do
|
for update_script in ${SCRIPTS_DIR}/sdk_lib/updates/*.sh; do
|
||||||
update_name="${update_script##*/}"
|
update_name="${update_script##*/}"
|
||||||
@ -71,19 +86,6 @@ done
|
|||||||
--root / --production_track sdk \
|
--root / --production_track sdk \
|
||||||
--board "$(portageq envvar ARCH)-host"
|
--board "$(portageq envvar ARCH)-host"
|
||||||
|
|
||||||
# Create /etc/make.conf.host_setup. The file content is regenerated
|
|
||||||
# from scratch every update. There are various reasons to do this:
|
|
||||||
# + It's cheap, so this is an easy way to guarantee correct content
|
|
||||||
# after an upgrade.
|
|
||||||
# + Inside make_chroot.sh, we use a temporary version of the file
|
|
||||||
# which must be updated before the script completes; that final
|
|
||||||
# update happens here.
|
|
||||||
# + If the repositories change to add or remove the private
|
|
||||||
# overlay, the file may need to be regenerated.
|
|
||||||
create_host_setup
|
|
||||||
|
|
||||||
info "Updating chroot"
|
|
||||||
|
|
||||||
EMERGE_FLAGS="-uNv --with-bdeps=y --select"
|
EMERGE_FLAGS="-uNv --with-bdeps=y --select"
|
||||||
if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
|
if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
|
||||||
EMERGE_FLAGS="${EMERGE_FLAGS} --usepkg"
|
EMERGE_FLAGS="${EMERGE_FLAGS} --usepkg"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user