mirror of
https://github.com/flatcar/scripts.git
synced 2026-01-20 16:01:57 +01:00
set_lsb_release: change distro name to Flatcar
Also, change default update server to Flatcar's.
This commit is contained in:
parent
cb9631dea0
commit
d18adef960
@ -25,57 +25,57 @@ 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})"
|
||||
|
||||
# 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}"
|
||||
FLATCAR_APPID="{e96281a6-d1af-4bde-9a0a-97b76e56dc57}"
|
||||
if [[ "${FLAGS_board}" == arm64-* ]]; then
|
||||
COREOS_APPID="{103867da-e3a2-4c92-b0b3-7fbd7f7d8b71}"
|
||||
FLATCAR_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" <<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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user