diff --git a/UpdateRootfs.sh.in b/UpdateRootfs.sh.in index 2ee5587dc8..a4456bf836 100644 --- a/UpdateRootfs.sh.in +++ b/UpdateRootfs.sh.in @@ -52,13 +52,32 @@ cp $TMP_PATH/u-boot.img /mnt cp $TMP_PATH/uImage /mnt cp $TMP_PATH/*.dtb /mnt +mkdir -p $TMP_PATH/bu_cfg + +if [ -e /etc/network/interfaces ] +then + cp /etc/network/interfaces $TMP_PATH/bu_cfg + rm /etc/network/interfaces +fi + +if [ -e /etc/wpa_supplicant.conf ] +then + cp /etc/wpa_supplicant.conf $TMP_PATH/bu_cfg/wpa_supplicant.conf_old + rm /etc/wpa_supplicant.conf +fi + +if [ -e /etc/wpa_supplicant/wpa_supplicant.conf ] +then + cp /etc/wpa_supplicant/wpa_supplicant.conf $TMP_PATH/bu_cfg + rm /etc/wpa_supplicant/wpa_supplicant.conf +fi + #rootfs auspacken tar -C / --exclude=./tmp --exclude=./etc/inittab \ - --exclude=./etc/network/interfaces \ --exclude=./etc/hosts --exclude=./etc/hostname \ --exclude=./etc/passwd --exclude=./etc/shadow \ --exclude=./etc/vncpwd --exclude=./etc/init.d/S99tincd \ - --exclude=./etc/hostapd.conf --exclude=./etc/wpa_supplicant.conf \ + --exclude=./etc/hostapd.conf \ --exclude=./etc/init.d/M99tincd \ --exclude=./var/GfA/Display_GSM.ini \ --exclude=./var/cron/crontabs/root \ @@ -67,6 +86,35 @@ tar -C / --exclude=./tmp --exclude=./etc/inittab \ echo "sync mmc be patient ...." sync sync +# --- copy old eth0 configuration +INTERFACE="eth0" +IFCONFIG=$TMP_PATH/bu_cfg/interfaces + +(\ +cat << EOF +# Configure Loopback +auto lo +iface lo inet loopback + +EOF +) > /etc/network/interfaces + +awk -v par=$INTERFACE '/^iface/ && $2==par {f=1}/^iface/ && $2!=par {f=0}f && !/^\s*#/d && !/^\s*$/d {print $0 }' $TMP_PATH/bu_cfg/interfaces \ +>> /etc/network/interfaces + +(\ +cat << EOF +iface eth1 inet dhcp +#--- +iface usb0 inet static + address 192.168.7.2 + netmask 255.255.255.252 +#--- +iface wlan0 inet dhcp + wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf +# +EOF +) >> /etc/network/interfaces if [ -e /etc/init.d/S98usb_g_ether ] then @@ -74,12 +122,21 @@ then rm /etc/init.d/S98usb_g_ether fi - if [ -e /etc/init.d/S80ti-sgx ] then rm /etc/init.d/S80ti-sgx fi +if [ -e /etc/init.d/M99_wlan_usb ] +then + rm /etc/init.d/M99_wlan_usb +fi + +if [ -e /etc/init.d/S99_wlan_usb ] +then + rm /etc/init.d/S99_wlan_usb +fi + #echo "Update Firmware" #echo "." #/root/spi_tivia /root/btm43_0107.bin >/dev/null