Skip to content

Commit

Permalink
Rename HOSTNAME variable to TARGET_HOSTNAME
Browse files Browse the repository at this point in the history
Bash sets the HOSTNAME variable, overriding our default
  • Loading branch information
XECDesign committed Jan 21, 2020
1 parent f8f3d6f commit 24bb01d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions stage1/02-net-tweaks/00-run.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 24bb01d

Please sign in to comment.