From faa35f774229fa236a9381d1a47b4365e9af851b Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Thu, 5 Jan 2023 13:51:26 +0100 Subject: [PATCH] updated optional boot-files --- optional_boot_config/cmdline.txt_eth0 | 1 - optional_boot_config/cmdline.txt_firstboot | 1 + optional_boot_config/cmdline.txt_wlan0 | 1 - optional_boot_config/firstrun.sh | 56 ++++++++++++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) delete mode 100644 optional_boot_config/cmdline.txt_eth0 create mode 100644 optional_boot_config/cmdline.txt_firstboot delete mode 100644 optional_boot_config/cmdline.txt_wlan0 create mode 100644 optional_boot_config/firstrun.sh diff --git a/optional_boot_config/cmdline.txt_eth0 b/optional_boot_config/cmdline.txt_eth0 deleted file mode 100644 index fab1296..0000000 --- a/optional_boot_config/cmdline.txt_eth0 +++ /dev/null @@ -1 +0,0 @@ -console=serial0,115200 console=tty1 root=PARTUUID=74bfbfa1-02 rootfstype=ext4 fsck.repair=yes rootwait ip=192.168.2.20::192.168.2.1:255.255.255.0:wachalarm:eth0:off:192.168.2.1 \ No newline at end of file diff --git a/optional_boot_config/cmdline.txt_firstboot b/optional_boot_config/cmdline.txt_firstboot new file mode 100644 index 0000000..10f2d5f --- /dev/null +++ b/optional_boot_config/cmdline.txt_firstboot @@ -0,0 +1 @@ +console=serial0,115200 console=tty1 root=PARTUUID=74bfbfa1-02 rootfstype=ext4 fsck.repair=yes rootwait systemd.run=/boot/firstrun.sh systemd.run_success_action=reboot systemd.unit=kernel-command-line.target \ No newline at end of file diff --git a/optional_boot_config/cmdline.txt_wlan0 b/optional_boot_config/cmdline.txt_wlan0 deleted file mode 100644 index 8e905db..0000000 --- a/optional_boot_config/cmdline.txt_wlan0 +++ /dev/null @@ -1 +0,0 @@ -console=serial0,115200 console=tty1 root=PARTUUID=74bfbfa1-02 rootfstype=ext4 fsck.repair=yes rootwait ip=192.168.2.20::192.168.2.1:255.255.255.0:wachalarm:wlan0:off:192.168.2.1 \ No newline at end of file diff --git a/optional_boot_config/firstrun.sh b/optional_boot_config/firstrun.sh new file mode 100644 index 0000000..162f328 --- /dev/null +++ b/optional_boot_config/firstrun.sh @@ -0,0 +1,56 @@ +#!/bin/bash +set +e +# feste IP-Adressen fuer LAN und WLAN hinterlegen +cat > /etc/dhcpcd.conf <<'DHCPCDEOF' +# configuration for dhcpcd. +# See dhcpcd.conf(5) for details. + +# Inform the DHCP server of our hostname for DDNS. +hostname + +# Use the hardware address of the interface for the Client ID. +clientid +# or +# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361. +# Some non-RFC compliant DHCP servers do not reply with this set. +# In this case, comment out duid and enable clientid above. +#duid + +# Persist interface configuration when dhcpcd exits. +persistent + +# Rapid commit support. +# Safe to enable by default because it requires the equivalent option set +# on the server to actually work. +option rapid_commit + +# A list of options to request from the DHCP server. +option domain_name_servers, domain_name, domain_search, host_name +option classless_static_routes +# Respect the network MTU. This is applied to DHCP routes. +option interface_mtu + +# Most distributions have NTP support. +#option ntp_servers + +# A ServerID is required by RFC2131. +require dhcp_server_identifier + +# Generate SLAAC address using the Hardware Address of the interface +#slaac hwaddr +# OR generate Stable Private IPv6 Addresses based from the DUID +slaac private + +# static IP configuration: + +interface wlan0 +static ip_address=192.168.179.123/24 +static routers=192.168.179.8 +static domain_name_servers=1.1.1.1 + +DHCPCDEOF +rm -f /boot/firstrun.sh +sed -i 's| systemd.run.*||g' /boot/cmdline.txt +# Passwort des Benutzers pi aendern +echo "pi:ganz_geheim" | sudo chpasswd +exit 0 \ No newline at end of file