Use target hostnames and restore lk2nd bootloader reboot
This commit is contained in:
1 parent
1c011b360a
commit
3b96b8f242
22 files changed
+203
-70
No files matched your search
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
# Install the target-specific hostname, hosts file and hostname service link.
|
||||
set -eu
|
||||
|
||||
ROOTFS="${1:-}"
|
||||
DEVICE="${2:-nokia-argon}"
|
||||
|
||||
if [ -z "$ROOTFS" ] || [ ! -d "$ROOTFS" ]; then
|
||||
echo "Usage: $0 <rootfs-dir> <device>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$DEVICE" in
|
||||
nokia-argon|argon)
|
||||
DEVICE="nokia-argon"
|
||||
;;
|
||||
nokia-beatles|beatles)
|
||||
DEVICE="nokia-beatles"
|
||||
;;
|
||||
nokia-tough|nokia-coconut|tough|coconut)
|
||||
DEVICE="nokia-tough"
|
||||
;;
|
||||
nokia-sparkler|sparkler)
|
||||
DEVICE="nokia-sparkler"
|
||||
;;
|
||||
nokia-leo|leo)
|
||||
DEVICE="nokia-leo"
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unsupported device '$DEVICE'." >&2
|
||||
echo "Supported devices: nokia-argon, nokia-beatles, nokia-tough, nokia-sparkler, nokia-leo" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
mkdir -p "$ROOTFS/etc" "$ROOTFS/etc/runlevels/boot"
|
||||
printf '%s\n' "$DEVICE" > "$ROOTFS/etc/hostname"
|
||||
cat > "$ROOTFS/etc/hosts" <<EOF
|
||||
127.0.0.1 $DEVICE localhost.localdomain localhost
|
||||
::1 $DEVICE localhost ipv6-localhost ipv6-loopback
|
||||
fe00::0 ipv6-localnet
|
||||
ff00::0 ipv6-mcastprefix
|
||||
ff02::1 ipv6-allnodes
|
||||
ff02::2 ipv6-allrouters
|
||||
ff02::3 ipv6-allhosts
|
||||
EOF
|
||||
ln -sfn /etc/init.d/hostname "$ROOTFS/etc/runlevels/boot/hostname"
|
||||
Reference in new issue
Block a user