#!/bin/bash # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Script to set /etc/lsb-release on the root file system. This script is run by # build_image inside chroot. 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 root "" "The root file system to write /etc/lsb-release to." DEFINE_string group "" "The default update group for update_engine." # Parse command line FLAGS "$@" || exit 1 eval set -- "${FLAGS_ARGV}" switch_to_strict_mode 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="Container Linux by CoreOS" OS_CODENAME="Ladybug" OS_ID="coreos" OS_PRETTY_NAME="$OS_NAME $COREOS_VERSION (${OS_CODENAME})" # temporarily point arm at a different appid until update support # is completed in update_engine and the CoreUpdate service. COREOS_APPID="{e96281a6-d1af-4bde-9a0a-97b76e56dc57}" if [[ "${FLAGS_board}" == arm64-* ]]; then COREOS_APPID="{103867da-e3a2-4c92-b0b3-7fbd7f7d8b71}" fi # DISTRIB_* are the standard lsb-release names sudo mkdir -p "${ROOT_FS_DIR}/usr/share/coreos" "${ROOT_FS_DIR}/etc/coreos" sudo_clobber "${ROOT_FS_DIR}/usr/share/coreos/lsb-release" <