Use allow-hotplug in interfaces templates by default
Improve interfaces files update logic
This commit is contained in:
parent
ce9bb08dfe
commit
ec9e9e8f7b
@ -1,22 +1,22 @@
|
||||
# Wired adapter #1
|
||||
allow-hotplug eth0
|
||||
iface eth0 inet dhcp
|
||||
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
|
||||
#
|
||||
|
||||
# Wired adapter #2
|
||||
#auto eth1
|
||||
# iface eth1 inet dhcp
|
||||
#allow-hotplug eth1
|
||||
#iface eth1 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
|
||||
#
|
||||
|
||||
# Wireless adapter #1
|
||||
#auto wlan0
|
||||
# iface wlan0 inet dhcp
|
||||
# wpa-ssid SSID
|
||||
#allow-hotplug wlan0
|
||||
#iface wlan0 inet dhcp
|
||||
# wpa-ssid SSID
|
||||
# wpa-psk xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
# to generate proper encrypted key: wpa_passphrase yourSSID yourpassword
|
||||
#
|
||||
|
||||
# Local loopback
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
iface lo inet loopback
|
||||
|
||||
@ -52,6 +52,11 @@ create_board_package()
|
||||
#!/bin/sh
|
||||
update-rc.d armhwinfo defaults >/dev/null 2>&1
|
||||
update-rc.d -f motd remove >/dev/null 2>&1
|
||||
if [ -L "/etc/network/interfaces" ]; then
|
||||
cp /etc/network/interfaces /etc/network/interfaces.tmp
|
||||
rm /etc/network/interfaces
|
||||
mv /etc/network/interfaces.tmp /etc/network/interfaces
|
||||
fi
|
||||
[ ! -f "/etc/network/interfaces" ] && cp /etc/network/interfaces.default /etc/network/interfaces
|
||||
[ -f "/root/.nand1-allwinner.tgz" ] && rm /root/.nand1-allwinner.tgz
|
||||
[ -f "/root/nand-sata-install" ] && rm /root/nand-sata-install
|
||||
@ -124,6 +129,7 @@ create_board_package()
|
||||
# network interfaces configuration
|
||||
mkdir -p $destination/etc/network/
|
||||
cp $SRC/lib/config/network/interfaces.* $destination/etc/network/
|
||||
[[ $RELEASE = wheezy ]] && sed -i 's/allow-hotplug/auto/g' $destination/etc/network/interfaces.default
|
||||
|
||||
# apt configuration
|
||||
mkdir -p $destination/etc/apt/apt.conf.d/
|
||||
|
||||
@ -268,7 +268,7 @@ main() {
|
||||
fi
|
||||
|
||||
update-rc.d -f firstrun remove >/dev/null 2>&1
|
||||
sed -i 's/allow-hotplug\ eth0/auto eth0/' /etc/network/interfaces.default
|
||||
#sed -i 's/allow-hotplug\ eth0/auto eth0/' /etc/network/interfaces.default
|
||||
rm /tmp/firstrun_running
|
||||
} # main
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user