mirror of
https://github.com/Fishwaldo/build.git
synced 2025-03-26 08:41:54 +00:00
Removed GPIO/1-Wire modules from H3 default modules, cleaned up firstrun, activated H3 autodetection
This commit is contained in:
parent
20d327549b
commit
ab8ab1cd20
3 changed files with 59 additions and 54 deletions
|
@ -1,5 +1,5 @@
|
||||||
# Wired adapter #1
|
# Wired adapter #1
|
||||||
auto eth0
|
allow-hotplug eth0
|
||||||
iface eth0 inet dhcp
|
iface eth0 inet dhcp
|
||||||
# hwaddress ether # if you want to set MAC manually
|
# hwaddress ether # if you want to set MAC manually
|
||||||
# pre-up /sbin/ifconfig eth0 mtu 3838 # setting MTU for DHCP, static just: mtu 3838
|
# pre-up /sbin/ifconfig eth0 mtu 3838 # setting MTU for DHCP, static just: mtu 3838
|
||||||
|
|
|
@ -217,7 +217,7 @@
|
||||||
#build 3wip
|
#build 3wip
|
||||||
LINUXFAMILY="sun8i"
|
LINUXFAMILY="sun8i"
|
||||||
BOOTCONFIG="orangepi_plus_defconfig"
|
BOOTCONFIG="orangepi_plus_defconfig"
|
||||||
MODULES="8189es gpio_sunxi w1-sunxi w1-gpio w1-therm"
|
MODULES="8189es"
|
||||||
MODULES_NEXT=""
|
MODULES_NEXT=""
|
||||||
CPUMIN="480000"
|
CPUMIN="480000"
|
||||||
CPUMAX="1296000"
|
CPUMAX="1296000"
|
||||||
|
@ -229,7 +229,7 @@
|
||||||
#build 3wip
|
#build 3wip
|
||||||
LINUXFAMILY="sun8i"
|
LINUXFAMILY="sun8i"
|
||||||
BOOTCONFIG="orangepi_pc_defconfig"
|
BOOTCONFIG="orangepi_pc_defconfig"
|
||||||
MODULES="8189es gpio_sunxi w1-sunxi w1-gpio w1-therm"
|
MODULES="8189es"
|
||||||
MODULES_NEXT=""
|
MODULES_NEXT=""
|
||||||
CPUMIN="480000"
|
CPUMIN="480000"
|
||||||
CPUMAX="1296000"
|
CPUMAX="1296000"
|
||||||
|
@ -241,7 +241,7 @@
|
||||||
#build 3wip
|
#build 3wip
|
||||||
LINUXFAMILY="sun8i"
|
LINUXFAMILY="sun8i"
|
||||||
BOOTCONFIG="orangepi_pc_defconfig"
|
BOOTCONFIG="orangepi_pc_defconfig"
|
||||||
MODULES="gpio_sunxi w1-sunxi w1-gpio w1-therm"
|
MODULES=""
|
||||||
MODULES_NEXT=""
|
MODULES_NEXT=""
|
||||||
CPUMIN="480000"
|
CPUMIN="480000"
|
||||||
CPUMAX="1296000"
|
CPUMAX="1296000"
|
||||||
|
@ -253,7 +253,7 @@
|
||||||
#build 3wip
|
#build 3wip
|
||||||
LINUXFAMILY="sun8i"
|
LINUXFAMILY="sun8i"
|
||||||
BOOTCONFIG="orangepi_one_defconfig"
|
BOOTCONFIG="orangepi_one_defconfig"
|
||||||
MODULES="gpio_sunxi w1-sunxi w1-gpio w1-therm"
|
MODULES=""
|
||||||
MODULES_NEXT=""
|
MODULES_NEXT=""
|
||||||
CPUMIN="648000"
|
CPUMIN="648000"
|
||||||
CPUMAX="1200000"
|
CPUMAX="1200000"
|
||||||
|
@ -265,7 +265,7 @@
|
||||||
#build 3wip
|
#build 3wip
|
||||||
LINUXFAMILY="sun8i"
|
LINUXFAMILY="sun8i"
|
||||||
BOOTCONFIG="orangepi_pc_defconfig"
|
BOOTCONFIG="orangepi_pc_defconfig"
|
||||||
MODULES="8189es gpio_sunxi w1-sunxi w1-gpio w1-therm"
|
MODULES="8189es"
|
||||||
MODULES_NEXT=""
|
MODULES_NEXT=""
|
||||||
CPUMIN="648000"
|
CPUMIN="648000"
|
||||||
CPUMAX="1200000"
|
CPUMAX="1200000"
|
||||||
|
|
|
@ -15,6 +15,15 @@
|
||||||
#
|
#
|
||||||
# Create this file to speed up boot process
|
# 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 <<EOT
|
cat > /tmp/create_swap.sh <<EOT
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
|
@ -56,13 +65,8 @@ if [ -f "/var/run/reboot" ]; then reboot; fi
|
||||||
rm -f /tmp/create_swap.sh
|
rm -f /tmp/create_swap.sh
|
||||||
EOT
|
EOT
|
||||||
chmod +x /tmp/create_swap.sh
|
chmod +x /tmp/create_swap.sh
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
|
collect_informations() {
|
||||||
#
|
|
||||||
#
|
|
||||||
# get some info about the board
|
# get some info about the board
|
||||||
CURKERNE=$(uname -r | sed 's/\([0-9]\+\.[0-9]\+\)\..*/\1/')
|
CURKERNE=$(uname -r | sed 's/\([0-9]\+\.[0-9]\+\)\..*/\1/')
|
||||||
DISTRIBUTION=$(lsb_release -cs)
|
DISTRIBUTION=$(lsb_release -cs)
|
||||||
|
@ -78,6 +82,7 @@ fi
|
||||||
done
|
done
|
||||||
rootfstype=$(blkid -s TYPE -o value $root_partition)
|
rootfstype=$(blkid -s TYPE -o value $root_partition)
|
||||||
set -e
|
set -e
|
||||||
|
} # collect_informations
|
||||||
|
|
||||||
display_alert() {
|
display_alert() {
|
||||||
if [ "$DISTRIBUTION" == "wheezy" ]; then
|
if [ "$DISTRIBUTION" == "wheezy" ]; then
|
||||||
|
@ -88,8 +93,9 @@ display_alert() {
|
||||||
}
|
}
|
||||||
|
|
||||||
autodetect_h3() {
|
autodetect_h3() {
|
||||||
# This function adjusts script.bin and cpufreq settings based on /run/machine.id so
|
# This function adjusts script.bin, hostname and cpufreq settings based on
|
||||||
# that a single OS image built for Orange Pi PC can be shipped.
|
# /run/machine.id so that two OS images (one built for Orange Pi Plus and one
|
||||||
|
# for the other H3 devices using the internal Ethernet PHY) can be shipped.
|
||||||
|
|
||||||
# wait for armhwinfo
|
# wait for armhwinfo
|
||||||
sleep 3
|
sleep 3
|
||||||
|
@ -120,10 +126,6 @@ autodetect_h3() {
|
||||||
touch /var/run/reboot
|
touch /var/run/reboot
|
||||||
} # autodetect_h3
|
} # autodetect_h3
|
||||||
|
|
||||||
#if [ "X${HARDWARE}" = "Xsun8i" ]; then
|
|
||||||
# autodetect_h3
|
|
||||||
#fi
|
|
||||||
|
|
||||||
do_expand_rootfs() {
|
do_expand_rootfs() {
|
||||||
device="/dev/"$(lsblk -idn -o NAME | grep mmcblk0)
|
device="/dev/"$(lsblk -idn -o NAME | grep mmcblk0)
|
||||||
PARTITIONS=$(($(fdisk -l $device | grep $device | wc -l)-1))
|
PARTITIONS=$(($(fdisk -l $device | grep $device | wc -l)-1))
|
||||||
|
@ -145,8 +147,8 @@ do_expand_rootfs() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
main() {
|
||||||
start)
|
collect_informations
|
||||||
display_alert "Force password change upon first login"
|
display_alert "Force password change upon first login"
|
||||||
chage -d 0 root
|
chage -d 0 root
|
||||||
|
|
||||||
|
@ -154,17 +156,20 @@ case "$1" in
|
||||||
display_alert "Expand ext4 root filesystem"
|
display_alert "Expand ext4 root filesystem"
|
||||||
do_expand_rootfs
|
do_expand_rootfs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
display_alert "Creating 128Mb emergency swap area"
|
display_alert "Creating 128Mb emergency swap area"
|
||||||
display_alert "SSH keys recreation. One moment please"
|
display_alert "SSH keys recreation. One moment please"
|
||||||
display_alert "Updating packages"
|
display_alert "Updating packages"
|
||||||
#resize2fs $root_partition
|
|
||||||
/tmp/create_swap.sh &
|
/tmp/create_swap.sh &
|
||||||
update-rc.d -f firstrun remove >/dev/null 2>&1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
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
|
exit 0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue