fix(build_image_util): Reorder when set_lsb_release is called

dev_image_util needs to be able to append to update.conf so move
set_lsb_release to start_image instead of finish_image.
This commit is contained in:
Michael Marineau 2014-05-22 22:24:22 -07:00
parent a7b67723ac
commit 0ec871b203
3 changed files with 11 additions and 15 deletions

View File

@ -121,6 +121,7 @@ start_image() {
local image_name="$1"
local disk_layout="$2"
local root_fs_dir="$3"
local update_group="$4"
local disk_img="${BUILD_DIR}/${image_name}"
@ -140,12 +141,17 @@ start_image() {
# FIXME(marineam): Work around glibc setting EROOT=$ROOT
# https://bugs.gentoo.org/show_bug.cgi?id=473728#c12
sudo mkdir -p "${root_fs_dir}/etc/ld.so.conf.d"
# Set /etc/lsb-release on the image.
"${BUILD_LIBRARY_DIR}/set_lsb_release" \
--root="${root_fs_dir}" \
--group="${update_group}" \
--board="${BOARD}"
}
finish_image() {
local disk_layout="$1"
local root_fs_dir="$2"
local update_group="$3"
# Record directories installed to the state partition.
# Explicitly ignore entries covered by existing configs.
@ -158,12 +164,6 @@ finish_image() {
--output="${root_fs_dir}/usr/lib/tmpfiles.d/base_image_etc.conf" \
${tmp_ignore} "${root_fs_dir}/etc"
# Set /etc/lsb-release on the image.
"${BUILD_LIBRARY_DIR}/set_lsb_release" \
--root="${root_fs_dir}" \
--group="${update_group}" \
--board="${BOARD}"
# Only configure bootloaders if there is a boot partition
if mountpoint -q "${root_fs_dir}"/boot/efi; then
${BUILD_LIBRARY_DIR}/configure_bootloaders.sh \

View File

@ -67,14 +67,10 @@ create_dev_image() {
info "Building developer image ${image_name}"
local root_fs_dir="${BUILD_DIR}/rootfs"
start_image "${image_name}" "${disk_layout}" "${root_fs_dir}"
start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}"
emerge_to_image "${root_fs_dir}" coreos-base/coreos-dev
"${BUILD_LIBRARY_DIR}/set_lsb_release" \
--root="${root_fs_dir}" \
--board="${BOARD}"
# Setup portage for emerge and gmerge
configure_dev_portage "${root_fs_dir}" "${devserver}"
@ -96,5 +92,5 @@ EOF
# The remount services are provided by coreos-base/coreos-init
systemd_enable "${root_fs_dir}" "local-fs.target" "remount-usr.service"
finish_image "${disk_layout}" "${root_fs_dir}" "${update_group}"
finish_image "${disk_layout}" "${root_fs_dir}"
}

View File

@ -33,7 +33,7 @@ create_prod_image() {
info "Building production image ${image_name}"
local root_fs_dir="${BUILD_DIR}/rootfs"
start_image "${image_name}" "${disk_layout}" "${root_fs_dir}"
start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}"
# Install minimal GCC (libs only) and then everything else
emerge_prod_gcc "${root_fs_dir}"
@ -69,7 +69,7 @@ EOF
disable_read_write=${FLAGS_FALSE}
fi
finish_image "${disk_layout}" "${root_fs_dir}" "${update_group}"
finish_image "${disk_layout}" "${root_fs_dir}"
# Make the filesystem un-mountable as read-write.
if [[ ${disable_read_write} -eq ${FLAGS_TRUE} ]]; then