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:
Michael Marineau 2013-08-07 12:26:38 -04:00
parent f871c34186
commit 5ac0bcdd27

View File

@ -46,6 +46,17 @@ switch_to_strict_mode
. ${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
if [[ -f /etc/lsb-release ]]; then
OLDVER=$(grep "^COREOS_RELEASE_VERSION=" /etc/lsb-release | cut -d = -f 2-)
@ -53,6 +64,10 @@ else
OLDVER="0.0.0"
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
for update_script in ${SCRIPTS_DIR}/sdk_lib/updates/*.sh; do
update_name="${update_script##*/}"
@ -71,19 +86,6 @@ done
--root / --production_track sdk \
--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"
if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
EMERGE_FLAGS="${EMERGE_FLAGS} --usepkg"