summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRene Klootwijk <rene@klootwijk.org>2019-10-26 12:49:30 +0200
committerXECDesign <XECDesign@users.noreply.github.com>2019-11-05 17:21:33 +0000
commitd30343f626916a5b6f23cec67df919bd5a5b643a (patch)
tree5ebb1522f6300f4e4eb0cb14ec496ad45c948d18
parent19c0188798f39149e5a82f70a3f96b96cfdaa7d9 (diff)
Added hostname parameter
-rw-r--r--README.md6
-rwxr-xr-xbuild.sh2
-rwxr-xr-xstage1/02-net-tweaks/00-run.sh2
-rw-r--r--stage1/02-net-tweaks/files/hostname1
4 files changed, 8 insertions, 3 deletions
diff --git a/README.md b/README.md
index 33f085e..e131ca4 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,7 @@ The following environment variables are supported:
be built and cached. Note, `WORK_DIR` stores a complete copy of the target
system for each build stage, amounting to tens of gigabytes in the case of
Raspbian.
-
+
**CAUTION**: If your working directory is on an NTFS partition you probably won't be able to build. Make sure this is a proper Linux filesystem.
* `DEPLOY_DIR` (Default: `"$BASE_DIR/deploy"`)
@@ -82,6 +82,10 @@ The following environment variables are supported:
Default system locale.
+ * `HOSTNAME` (Default: "raspberrypi" )
+
+ Setting the hostname to the specified value.
+
* `KEYBOARD_KEYMAP` (Default: "gb" )
Default keyboard keymap.
diff --git a/build.sh b/build.sh
index 81ef26f..a730e44 100755
--- a/build.sh
+++ b/build.sh
@@ -161,6 +161,8 @@ 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 FIRST_USER_NAME=${FIRST_USER_NAME:-pi}
export FIRST_USER_PASS=${FIRST_USER_PASS:-raspberry}
export WPA_ESSID
diff --git a/stage1/02-net-tweaks/00-run.sh b/stage1/02-net-tweaks/00-run.sh
index a49b4b0..8637edc 100755
--- a/stage1/02-net-tweaks/00-run.sh
+++ b/stage1/02-net-tweaks/00-run.sh
@@ -1,5 +1,5 @@
#!/bin/bash -e
-install -m 644 files/hostname "${ROOTFS_DIR}/etc/hostname"
+echo "${HOSTNAME}" > "${ROOTFS_DIR}/etc/hostname"
ln -sf /dev/null "${ROOTFS_DIR}/etc/systemd/network/99-default.link"
diff --git a/stage1/02-net-tweaks/files/hostname b/stage1/02-net-tweaks/files/hostname
deleted file mode 100644
index 41757af..0000000
--- a/stage1/02-net-tweaks/files/hostname
+++ /dev/null
@@ -1 +0,0 @@
-raspberrypi