From 24bb01dec280f568ac59cdd1253a33a6d30ac4c4 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 5 Dec 2019 16:25:18 +0000 Subject: [PATCH] Rename HOSTNAME variable to TARGET_HOSTNAME Bash sets the HOSTNAME variable, overriding our default --- README.md | 2 +- build.sh | 2 +- stage1/02-net-tweaks/00-run.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 73d4961..bf681fa 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ The following environment variables are supported: Default system locale. - * `HOSTNAME` (Default: "raspberrypi" ) + * `TARGET_HOSTNAME` (Default: "raspberrypi" ) Setting the hostname to the specified value. diff --git a/build.sh b/build.sh index 9e78728..a906e10 100755 --- a/build.sh +++ b/build.sh @@ -162,7 +162,7 @@ export DEPLOY_DIR=${DEPLOY_DIR:-"${BASE_DIR}/deploy"} export DEPLOY_ZIP="${DEPLOY_ZIP:-1}" export LOG_FILE="${WORK_DIR}/build.log" -export HOSTNAME=${HOSTNAME:-raspberrypi} +export TARGET_HOSTNAME=${TARGET_HOSTNAME:-raspberrypi} export FIRST_USER_NAME=${FIRST_USER_NAME:-pi} export FIRST_USER_PASS=${FIRST_USER_PASS:-raspberry} diff --git a/stage1/02-net-tweaks/00-run.sh b/stage1/02-net-tweaks/00-run.sh index fc9e763..4943cab 100755 --- a/stage1/02-net-tweaks/00-run.sh +++ b/stage1/02-net-tweaks/00-run.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -echo "${HOSTNAME}" > "${ROOTFS_DIR}/etc/hostname" -echo "127.0.1.1 ${HOSTNAME}" >> "${ROOTFS_DIR}/etc/hosts" +echo "${TARGET_HOSTNAME}" > "${ROOTFS_DIR}/etc/hostname" +echo "127.0.1.1 ${TARGET_HOSTNAME}" >> "${ROOTFS_DIR}/etc/hosts" ln -sf /dev/null "${ROOTFS_DIR}/etc/systemd/network/99-default.link"