From ab8ab1cd2044a7da0e003e94dbfd5cd844b0dba9 Mon Sep 17 00:00:00 2001 From: Thomas Kaiser Date: Tue, 23 Feb 2016 13:10:14 +0100 Subject: [PATCH] Removed GPIO/1-Wire modules from H3 default modules, cleaned up firstrun, activated H3 autodetection --- config/interfaces.default | 4 +- configuration.sh | 10 ++-- scripts/firstrun | 99 ++++++++++++++++++++------------------- 3 files changed, 59 insertions(+), 54 deletions(-) diff --git a/config/interfaces.default b/config/interfaces.default index 5d0b4530c..e9afc1daa 100644 --- a/config/interfaces.default +++ b/config/interfaces.default @@ -1,5 +1,5 @@ # Wired adapter #1 -auto eth0 +allow-hotplug eth0 iface eth0 inet dhcp # hwaddress ether # if you want to set MAC manually # pre-up /sbin/ifconfig eth0 mtu 3838 # setting MTU for DHCP, static just: mtu 3838 @@ -19,4 +19,4 @@ auto eth0 # # Local loopback auto lo - iface lo inet loopback \ No newline at end of file + iface lo inet loopback diff --git a/configuration.sh b/configuration.sh index e51e09683..7a0f03cc9 100644 --- a/configuration.sh +++ b/configuration.sh @@ -217,7 +217,7 @@ #build 3wip LINUXFAMILY="sun8i" BOOTCONFIG="orangepi_plus_defconfig" - MODULES="8189es gpio_sunxi w1-sunxi w1-gpio w1-therm" + MODULES="8189es" MODULES_NEXT="" CPUMIN="480000" CPUMAX="1296000" @@ -229,7 +229,7 @@ #build 3wip LINUXFAMILY="sun8i" BOOTCONFIG="orangepi_pc_defconfig" - MODULES="8189es gpio_sunxi w1-sunxi w1-gpio w1-therm" + MODULES="8189es" MODULES_NEXT="" CPUMIN="480000" CPUMAX="1296000" @@ -241,7 +241,7 @@ #build 3wip LINUXFAMILY="sun8i" BOOTCONFIG="orangepi_pc_defconfig" - MODULES="gpio_sunxi w1-sunxi w1-gpio w1-therm" + MODULES="" MODULES_NEXT="" CPUMIN="480000" CPUMAX="1296000" @@ -253,7 +253,7 @@ #build 3wip LINUXFAMILY="sun8i" BOOTCONFIG="orangepi_one_defconfig" - MODULES="gpio_sunxi w1-sunxi w1-gpio w1-therm" + MODULES="" MODULES_NEXT="" CPUMIN="648000" CPUMAX="1200000" @@ -265,7 +265,7 @@ #build 3wip LINUXFAMILY="sun8i" BOOTCONFIG="orangepi_pc_defconfig" - MODULES="8189es gpio_sunxi w1-sunxi w1-gpio w1-therm" + MODULES="8189es" MODULES_NEXT="" CPUMIN="648000" CPUMAX="1200000" diff --git a/scripts/firstrun b/scripts/firstrun index c44113549..1f143d1b7 100644 --- a/scripts/firstrun +++ b/scripts/firstrun @@ -15,6 +15,15 @@ # # Create this file to speed up boot process # + +# Immediately exit if not called correctly +if [ "X$1" != "Xstart" ]; then + exit 1 +fi + +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +# create helper script to set swap settings cat > /tmp/create_swap.sh </dev/null 2>&1 fi -return 0 + return 0 } -case "$1" in - start) - display_alert "Force password change upon first login" - chage -d 0 root - - if [[ "$rootfstype" == "ext4" && ! -f "/root/.no_rootfs_resize" ]]; then - display_alert "Expand ext4 root filesystem" - do_expand_rootfs - fi - display_alert "Creating 128Mb emergency swap area" - display_alert "SSH keys recreation. One moment please" - display_alert "Updating packages" - #resize2fs $root_partition - /tmp/create_swap.sh & - update-rc.d -f firstrun remove >/dev/null 2>&1 - ;; - *) - exit 1 - ;; -esac +main() { + collect_informations + display_alert "Force password change upon first login" + chage -d 0 root + if [[ "$rootfstype" == "ext4" && ! -f "/root/.no_rootfs_resize" ]]; then + display_alert "Expand ext4 root filesystem" + do_expand_rootfs + fi + + display_alert "Creating 128Mb emergency swap area" + display_alert "SSH keys recreation. One moment please" + display_alert "Updating packages" + /tmp/create_swap.sh & + + if [ "X${HARDWARE}" = "Xsun8i" ]; then + autodetect_h3 + fi + + update-rc.d -f firstrun remove >/dev/null 2>&1 + sed -i 's/allow-hotplug\ eth0/auto eth0/' /etc/network/interfaces.default +} # main + +main exit 0