0011-wlan-autoconfig.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. diff --git a/UpdateRootfs.sh.in b/UpdateRootfs.sh.in
  2. index 2ee5587dc8..a4456bf836 100644
  3. --- a/UpdateRootfs.sh.in
  4. +++ b/UpdateRootfs.sh.in
  5. @@ -52,13 +52,32 @@ cp $TMP_PATH/u-boot.img /mnt
  6. cp $TMP_PATH/uImage /mnt
  7. cp $TMP_PATH/*.dtb /mnt
  8. +mkdir -p $TMP_PATH/bu_cfg
  9. +
  10. +if [ -e /etc/network/interfaces ]
  11. +then
  12. + cp /etc/network/interfaces $TMP_PATH/bu_cfg
  13. + rm /etc/network/interfaces
  14. +fi
  15. +
  16. +if [ -e /etc/wpa_supplicant.conf ]
  17. +then
  18. + cp /etc/wpa_supplicant.conf $TMP_PATH/bu_cfg/wpa_supplicant.conf_old
  19. + rm /etc/wpa_supplicant.conf
  20. +fi
  21. +
  22. +if [ -e /etc/wpa_supplicant/wpa_supplicant.conf ]
  23. +then
  24. + cp /etc/wpa_supplicant/wpa_supplicant.conf $TMP_PATH/bu_cfg
  25. + rm /etc/wpa_supplicant/wpa_supplicant.conf
  26. +fi
  27. +
  28. #rootfs auspacken
  29. tar -C / --exclude=./tmp --exclude=./etc/inittab \
  30. - --exclude=./etc/network/interfaces \
  31. --exclude=./etc/hosts --exclude=./etc/hostname \
  32. --exclude=./etc/passwd --exclude=./etc/shadow \
  33. --exclude=./etc/vncpwd --exclude=./etc/init.d/S99tincd \
  34. - --exclude=./etc/hostapd.conf --exclude=./etc/wpa_supplicant.conf \
  35. + --exclude=./etc/hostapd.conf \
  36. --exclude=./etc/init.d/M99tincd \
  37. --exclude=./var/GfA/Display_GSM.ini \
  38. --exclude=./var/cron/crontabs/root \
  39. @@ -67,6 +86,35 @@ tar -C / --exclude=./tmp --exclude=./etc/inittab \
  40. echo "sync mmc be patient ...."
  41. sync
  42. sync
  43. +# --- copy old eth0 configuration
  44. +INTERFACE="eth0"
  45. +IFCONFIG=$TMP_PATH/bu_cfg/interfaces
  46. +
  47. +(\
  48. +cat << EOF
  49. +# Configure Loopback
  50. +auto lo
  51. +iface lo inet loopback
  52. +
  53. +EOF
  54. +) > /etc/network/interfaces
  55. +
  56. +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 \
  57. +>> /etc/network/interfaces
  58. +
  59. +(\
  60. +cat << EOF
  61. +iface eth1 inet dhcp
  62. +#---
  63. +iface usb0 inet static
  64. + address 192.168.7.2
  65. + netmask 255.255.255.252
  66. +#---
  67. +iface wlan0 inet dhcp
  68. + wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  69. +#
  70. +EOF
  71. +) >> /etc/network/interfaces
  72. if [ -e /etc/init.d/S98usb_g_ether ]
  73. then
  74. @@ -74,12 +122,21 @@ then
  75. rm /etc/init.d/S98usb_g_ether
  76. fi
  77. -
  78. if [ -e /etc/init.d/S80ti-sgx ]
  79. then
  80. rm /etc/init.d/S80ti-sgx
  81. fi
  82. +if [ -e /etc/init.d/M99_wlan_usb ]
  83. +then
  84. + rm /etc/init.d/M99_wlan_usb
  85. +fi
  86. +
  87. +if [ -e /etc/init.d/S99_wlan_usb ]
  88. +then
  89. + rm /etc/init.d/S99_wlan_usb
  90. +fi
  91. +
  92. #echo "Update Firmware"
  93. #echo "."
  94. #/root/spi_tivia /root/btm43_0107.bin >/dev/null