set_lsb_release: change distro name to Flatcar

Also, change default update server to Flatcar's.
This commit is contained in:
Iago López Galeiras 2018-03-19 15:30:53 +01:00 committed by Dongsu Park
parent b01f303bb6
commit ff182fcb4a
2 changed files with 24 additions and 24 deletions

View File

@ -25,52 +25,52 @@ 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_NAME="Flatcar Linux by Kinvolk"
OS_CODENAME="Rhyolite"
OS_ID="coreos"
OS_PRETTY_NAME="$OS_NAME $COREOS_VERSION (${OS_CODENAME})"
OS_ID="flatcar"
OS_PRETTY_NAME="$OS_NAME $FLATCAR_VERSION (${OS_CODENAME})"
COREOS_APPID="{e96281a6-d1af-4bde-9a0a-97b76e56dc57}"
FLATCAR_APPID="{e96281a6-d1af-4bde-9a0a-97b76e56dc57}"
# 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" <<EOF
sudo mkdir -p "${ROOT_FS_DIR}/usr/share/flatcar" "${ROOT_FS_DIR}/etc/flatcar"
sudo_clobber "${ROOT_FS_DIR}/usr/share/flatcar/lsb-release" <<EOF
DISTRIB_ID="$OS_NAME"
DISTRIB_RELEASE=$COREOS_VERSION
DISTRIB_RELEASE=$FLATCAR_VERSION
DISTRIB_CODENAME="$OS_CODENAME"
DISTRIB_DESCRIPTION="$OS_PRETTY_NAME"
EOF
sudo ln -sf "../usr/share/coreos/lsb-release" "${ROOT_FS_DIR}/etc/lsb-release"
sudo ln -sf "../usr/share/flatcar/lsb-release" "${ROOT_FS_DIR}/etc/lsb-release"
# And the new standard, os-release
# https://www.freedesktop.org/software/systemd/man/os-release.html
sudo_clobber "${ROOT_FS_DIR}/usr/lib/os-release" <<EOF
NAME="$OS_NAME"
ID=$OS_ID
VERSION=$COREOS_VERSION
VERSION_ID=$COREOS_VERSION_ID
BUILD_ID=$COREOS_BUILD_ID
VERSION=$FLATCAR_VERSION
VERSION_ID=$FLATCAR_VERSION_ID
BUILD_ID=$FLATCAR_BUILD_ID
PRETTY_NAME="$OS_PRETTY_NAME"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://issues.coreos.com"
COREOS_BOARD="$FLAGS_board"
HOME_URL="https://flatcar-linux.org/"
BUG_REPORT_URL="https://issues.flatcar-linux.org"
FLATCAR_BOARD="$FLAGS_board"
EOF
sudo ln -sf "../usr/lib/os-release" "${ROOT_FS_DIR}/etc/os-release"
sudo ln -sf "../../lib/os-release" "${ROOT_FS_DIR}/usr/share/coreos/os-release"
sudo ln -sf "../../lib/os-release" "${ROOT_FS_DIR}/usr/share/flatcar/os-release"
# Create the defaults for the coreos configuration files in the usr directory
sudo_clobber "${ROOT_FS_DIR}/usr/share/coreos/release" <<EOF
COREOS_RELEASE_VERSION=$COREOS_VERSION
COREOS_RELEASE_BOARD=$FLAGS_board
COREOS_RELEASE_APPID=$COREOS_APPID
sudo_clobber "${ROOT_FS_DIR}/usr/share/flatcar/release" <<EOF
FLATCAR_RELEASE_VERSION=$FLATCAR_VERSION
FLATCAR_RELEASE_BOARD=$FLAGS_board
FLATCAR_RELEASE_APPID=$FLATCAR_APPID
EOF
sudo_clobber "${ROOT_FS_DIR}/usr/share/coreos/update.conf" <<EOF
SERVER=https://public.update.core-os.net/v1/update/
sudo_clobber "${ROOT_FS_DIR}/usr/share/flatcar/update.conf" <<EOF
SERVER=https://public.update.flatcar-linux.net/v1/update/
GROUP=$FLAGS_group
EOF
sudo_clobber "${ROOT_FS_DIR}/etc/coreos/update.conf" <<EOF
sudo_clobber "${ROOT_FS_DIR}/etc/flatcar/update.conf" <<EOF
GROUP=$FLAGS_group
EOF

View File

@ -4,11 +4,11 @@ VERSION_ID=stable
USAGE="Usage: $0 [-V version] [-d /target/path]
Options:
-d DEST Create CoreOS VDI image to the given path.
-d DEST Create Flatcar VDI image to the given path.
-V VERSION Version to install (e.g. alpha) [default: ${VERSION_ID}]
-h This help
This tool creates a CoreOS VDI image to be used with VirtualBox.
This tool creates a Flatcar VDI image to be used with VirtualBox.
"
# Image signing key: buildbot@coreos.com