Update '1.initramfs-and-tftp-setup.sh'
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TFTP_ROOT="/volume1/rpi/tftpboot/"
|
TFTP_ROOT="/volume1/rpi/tftpboot/"
|
||||||
ISCSI_TARGET_IP="192.168.1.5"
|
ISCSI_TARGET_IP="192.168.1.5"
|
||||||
ISCSI_TARGET_IQN="iqn.2000-01.com.synology:SynologyNAS.default-target.b63ef49539c"
|
ISCSI_TARGET_IQN="iqn.2000-01.com.synology:SynologyNAS.Target-11.b63ef49539c"
|
||||||
ISCSI_INITIATOR_IQN="iqn.1993-08.org.debian:01:ab91dbfb8224"
|
ISCSI_INITIATOR_IQN="iqn.1993-08.org.debian:01:9174e3877a3"
|
||||||
PI_SERIAL="3079dde4"
|
PI_SERIAL="6218cd17"
|
||||||
|
|
||||||
PI_HOSTNAME=$(hostname)
|
PI_HOSTNAME=$(hostname)
|
||||||
PI_IP=$(ifconfig eth0 | awk '/inet /{ print $2;}')
|
PI_IP=$(ifconfig eth0 | awk '/inet /{ print $2;}')
|
||||||
@@ -28,8 +28,8 @@ update-initramfs -v -k "$(uname -r)" -c -b /nfs/$(hostname -s)-boot
|
|||||||
# https://git.kernel.org/pub/scm/libs/klibc/klibc.git/tree/usr/kinit/ipconfig/README.ipconfig
|
# https://git.kernel.org/pub/scm/libs/klibc/klibc.git/tree/usr/kinit/ipconfig/README.ipconfig
|
||||||
# However, don't put anything after static in the line below, because it completely breaks
|
# However, don't put anything after static in the line below, because it completely breaks
|
||||||
# everything in a very non-obvious way.
|
# everything in a very non-obvious way.
|
||||||
touch /nfs/$(hostname -s)-boot/cmdline.txt
|
cp cmdline.txt /nfs/$(hostname -s)-boot/cmdline.txt
|
||||||
touch /nfs/$(hostname -s)-boot/config.txt
|
cp config.txt /nfs/$(hostname -s)-boot/config.txt
|
||||||
sed -i -r -e \
|
sed -i -r -e \
|
||||||
"s/$/ ip=${PI_IP}:::${PI_NETMASK}:${PI_HOSTNAME}:eth0:static ISCSI_INITIATOR=${ISCSI_INITIATOR_IQN} ISCSI_TARGET_NAME=${ISCSI_TARGET_IQN} ISCSI_TARGET_IP=${ISCSI_TARGET_IP} rw/g" \
|
"s/$/ ip=${PI_IP}:::${PI_NETMASK}:${PI_HOSTNAME}:eth0:static ISCSI_INITIATOR=${ISCSI_INITIATOR_IQN} ISCSI_TARGET_NAME=${ISCSI_TARGET_IQN} ISCSI_TARGET_IP=${ISCSI_TARGET_IP} rw/g" \
|
||||||
/nfs/$(hostname -s)-boot/cmdline.txt
|
/nfs/$(hostname -s)-boot/cmdline.txt
|
||||||
@@ -39,4 +39,4 @@ sed -i -r -e \
|
|||||||
"s@\[pi4\]@[pi4]\ninitramfs initrd.img-$(uname -r) followkernel@" \
|
"s@\[pi4\]@[pi4]\ninitramfs initrd.img-$(uname -r) followkernel@" \
|
||||||
/nfs/$(hostname -s)-boot/config.txt
|
/nfs/$(hostname -s)-boot/config.txt
|
||||||
|
|
||||||
umount /nfs/$(hostname -s)-boot
|
#umount /nfs/$(hostname -s)-boot
|
||||||
Reference in New Issue
Block a user