From d70cfcaab9d5575e264bb55985c1d6d237de7398 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Wed, 10 Dec 2025 10:37:19 +0000 Subject: [PATCH] set_lsb_release: Set some fields dynamically from the base profile This leverages the branding eclass that was recently added to Gentoo. Since originally preparing this commit, these fields were added to our make.conf, but setting them in the profile is more versatile, allowing for downstreams. Signed-off-by: James Le Cuirot --- build_library/set_lsb_release | 34 +++++++++---------- .../profiles/coreos/base/make.defaults | 19 +++++------ 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/build_library/set_lsb_release b/build_library/set_lsb_release index 7705b16490..44a4a5f4a1 100755 --- a/build_library/set_lsb_release +++ b/build_library/set_lsb_release @@ -11,7 +11,7 @@ SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..) . "${SCRIPT_ROOT}/common.sh" || exit 1 # Flags -DEFINE_string board "" "The board to build an image for." +DEFINE_string board "${DEFAULT_BOARD}" "The board to build an image for." DEFINE_string root "" "The root file system to write /etc/lsb-release to." DEFINE_string group "" "The default update group for update_engine." @@ -25,17 +25,16 @@ ROOT_FS_DIR="$FLAGS_root" [ -n "$ROOT_FS_DIR" ] || die "--root is required." [ -d "$ROOT_FS_DIR" ] || die "Root FS does not exist? ($ROOT_FS_DIR)" -OS_NAME="Flatcar Container Linux by Kinvolk" -OS_ID="flatcar" -OS_ID_LIKE="coreos" -OS_PRETTY_NAME="$OS_NAME $FLATCAR_VERSION" +# These variables are set in the base profile. +eval $("portageq-${FLAGS_board}" envvar -v BRANDING_OS_\*) +BRANDING_OS_PRETTY_NAME="${BRANDING_OS_NAME} ${FLATCAR_VERSION}" FLATCAR_APPID="{e96281a6-d1af-4bde-9a0a-97b76e56dc57}" # DISTRIB_* are the standard lsb-release names sudo mkdir -p "${ROOT_FS_DIR}/usr/share/flatcar" "${ROOT_FS_DIR}/etc/flatcar" sudo_clobber "${ROOT_FS_DIR}/usr/share/flatcar/lsb-release" <