forked from stupidloud/nanopi-openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-nanopi-patch.patch
20371 lines (20360 loc) · 944 KB
/
0001-nanopi-patch.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From 563f82df52cc63b977b8a2251b368285c2a6265b Mon Sep 17 00:00:00 2001
From: klever1988 <klever1988@protonmail.com>
Date: Mon, 20 Jan 2020 16:57:12 -0500
Subject: [PATCH] nanopi patch
---
friendlyelec/.gitignore | 3 +
friendlyelec/build.sh | 63 +
friendlyelec/config_nanopi-h3.seed | 128 +
friendlyelec/config_nanopi-h5.seed | 114 +
friendlyelec/config_nanopi-h6.seed | 1 +
package/base-files/files/bin/config_generate | 4 +-
package/base-files/files/etc/.gitignore | 1 +
package/base-files/files/etc/banner | 12 +-
package/base-files/files/etc/enable-swap.sh | 51 +
.../etc/hotplug.d/ieee80211/09-wireless-bcm4356 | 22 +
.../files/etc/hotplug.d/usb/30-usb_wifi_huawei | 42 +
.../base-files/files/etc/hotplug.d/usb/31-usb_wifi | 75 +
package/base-files/files/etc/init.d/fa-wifiap | 13 +
package/base-files/files/etc/modules.d/10-8152 | 1 +
package/base-files/files/etc/modules.d/90-8189es | 1 +
package/base-files/files/etc/modules.d/90-8821cu | 1 +
.../base-files/files/etc/modules.d/90-cdc_ether | 1 +
package/base-files/files/etc/modules.d/xradio_wlan | 1 +
package/base-files/files/etc/rc.d/S11fa-wifiap | 1 +
package/base-files/files/etc/rc.local | 10 +
package/base-files/files/etc/sysctl.conf | 3 +
package/base-files/files/root/setup.sh | 114 +
package/base-files/files/usr/bin/fix_wifi_ap.sh | 43 +
package/base-files/files/usr/bin/lcd2usb_echo | Bin 0 -> 1579032 bytes
.../mac80211/files/lib/netifd/wireless/mac80211.sh | 6 +-
package/utils/usbmode/Makefile | 3 +-
package/utils/usbmode/files/usb-mode.json | 3144 ++++++++++++++++++++
target/linux/allwinner-h5/Makefile | 26 +
.../allwinner-h5/base-files/etc/board.d/01_leds | 20 +
.../allwinner-h5/base-files/etc/board.d/02_network | 55 +
target/linux/allwinner-h5/base-files/etc/inittab | 5 +
.../lib/firmware/brcm/brcmfmac4329-sdio.txt | 57 +
.../lib/firmware/brcm/brcmfmac43362-sdio.txt | 51 +
.../lib/firmware/brcm/brcmfmac43430-sdio.txt | 53 +
.../lib/firmware/brcm/brcmfmac43430a0-sdio.txt | 1 +
.../base-files/lib/preinit/03_b53_hack.sh | 18 +
.../base-files/lib/preinit/79_move_config | 20 +
.../base-files/lib/upgrade/platform.sh | 88 +
.../linux/allwinner-h5/base-files/usr/bin/cpu_freq | 120 +
target/linux/allwinner-h5/config-4.14 | 546 ++++
target/linux/allwinner-h5/image/Makefile | 21 +
...x-add-support-for-rgmii-internal-delay-mo.patch | 139 +
...hunderx-workaround-BGX-TX-Underflow-issue.patch | 110 +
target/linux/allwinner-h5/profiles/00-default.mk | 17 +
target/linux/nexell-s5p4418/Makefile | 30 +
.../nexell-s5p4418/base-files/etc/board.d/01_leds | 16 +
.../base-files/etc/board.d/02_network | 27 +
target/linux/nexell-s5p4418/base-files/etc/inittab | 5 +
.../base-files/etc/modules.d/10-bcmdhd | 1 +
.../base-files/lib/upgrade/platform.sh | 89 +
target/linux/nexell-s5p4418/config-4.14 | 523 ++++
target/linux/nexell-s5p4418/config-4.19 | 538 ++++
target/linux/nexell-s5p4418/image/Makefile | 10 +
.../nexell-s5p4418/patches-4.14/100-bootargs.patch | 11 +
.../patches-4.14/200-disable-msi.patch | 18 +
.../patches-4.14/301-apalis-ixora-dts-leds.patch | 86 +
.../302-apalis-ixora-dts-reset-button.patch | 76 +
.../nexell-s5p4418/patches-4.19/100-bootargs.patch | 11 +
.../patches-4.19/301-apalis-ixora-dts-leds.patch | 86 +
.../302-apalis-ixora-dts-reset-button.patch | 76 +
target/linux/nexell-s5p4418/profiles/00-default.mk | 19 +
target/linux/nexell-s5p6818/Makefile | 26 +
.../nexell-s5p6818/base-files/etc/board.d/01_leds | 16 +
.../base-files/etc/board.d/02_network | 26 +
target/linux/nexell-s5p6818/base-files/etc/inittab | 5 +
.../base-files/etc/modules.d/10-bcmdhd | 1 +
target/linux/nexell-s5p6818/config-4.14 | 546 ++++
target/linux/nexell-s5p6818/image/Makefile | 21 +
...x-add-support-for-rgmii-internal-delay-mo.patch | 139 +
...hunderx-workaround-BGX-TX-Underflow-issue.patch | 110 +
target/linux/nexell-s5p6818/profiles/00-default.mk | 17 +
target/linux/rockchip-rk3399/Makefile | 26 +
.../rockchip-rk3399/base-files/etc/board.d/01_leds | 16 +
.../base-files/etc/board.d/02_network | 24 +
.../iface/12-disable-rk3399-eth-offloading | 22 +
.../base-files/etc/init.d/fa-rk3399-pwmfan | 9 +
.../linux/rockchip-rk3399/base-files/etc/inittab | 5 +
.../base-files/etc/modules.d/10-bcmdhd | 1 +
.../base-files/etc/rc.d/S96fa-rk3399-pwmfan | 1 +
.../base-files/usr/bin/start-rk3399-pwm-fan.sh | 59 +
target/linux/rockchip-rk3399/config-4.14 | 546 ++++
target/linux/rockchip-rk3399/image/Makefile | 21 +
...x-add-support-for-rgmii-internal-delay-mo.patch | 139 +
...hunderx-workaround-BGX-TX-Underflow-issue.patch | 110 +
.../linux/rockchip-rk3399/profiles/00-default.mk | 17 +
target/linux/sunxi/base-files/etc/board.d/01_leds | 20 +
.../linux/sunxi/base-files/etc/board.d/02_network | 27 +
target/linux/sunxi/base-files/usr/bin/cpu_freq | 120 +
target/linux/sunxi/image/cortex-a53.mk | 3 +
89 files changed, 8890 insertions(+), 10 deletions(-)
create mode 100644 friendlyelec/.gitignore
create mode 100755 friendlyelec/build.sh
create mode 100644 friendlyelec/config_nanopi-h3.seed
create mode 100644 friendlyelec/config_nanopi-h5.seed
create mode 120000 friendlyelec/config_nanopi-h6.seed
create mode 100644 package/base-files/files/etc/.gitignore
create mode 100755 package/base-files/files/etc/enable-swap.sh
create mode 100755 package/base-files/files/etc/hotplug.d/ieee80211/09-wireless-bcm4356
create mode 100755 package/base-files/files/etc/hotplug.d/usb/30-usb_wifi_huawei
create mode 100755 package/base-files/files/etc/hotplug.d/usb/31-usb_wifi
create mode 100755 package/base-files/files/etc/init.d/fa-wifiap
create mode 100644 package/base-files/files/etc/modules.d/10-8152
create mode 100644 package/base-files/files/etc/modules.d/90-8189es
create mode 100644 package/base-files/files/etc/modules.d/90-8821cu
create mode 100644 package/base-files/files/etc/modules.d/90-cdc_ether
create mode 100644 package/base-files/files/etc/modules.d/xradio_wlan
create mode 120000 package/base-files/files/etc/rc.d/S11fa-wifiap
create mode 100755 package/base-files/files/root/setup.sh
create mode 100755 package/base-files/files/usr/bin/fix_wifi_ap.sh
create mode 100755 package/base-files/files/usr/bin/lcd2usb_echo
create mode 100644 package/utils/usbmode/files/usb-mode.json
create mode 100644 target/linux/allwinner-h5/Makefile
create mode 100755 target/linux/allwinner-h5/base-files/etc/board.d/01_leds
create mode 100755 target/linux/allwinner-h5/base-files/etc/board.d/02_network
create mode 100644 target/linux/allwinner-h5/base-files/etc/inittab
create mode 100644 target/linux/allwinner-h5/base-files/lib/firmware/brcm/brcmfmac4329-sdio.txt
create mode 100644 target/linux/allwinner-h5/base-files/lib/firmware/brcm/brcmfmac43362-sdio.txt
create mode 100644 target/linux/allwinner-h5/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt
create mode 120000 target/linux/allwinner-h5/base-files/lib/firmware/brcm/brcmfmac43430a0-sdio.txt
create mode 100644 target/linux/allwinner-h5/base-files/lib/preinit/03_b53_hack.sh
create mode 100644 target/linux/allwinner-h5/base-files/lib/preinit/79_move_config
create mode 100644 target/linux/allwinner-h5/base-files/lib/upgrade/platform.sh
create mode 100755 target/linux/allwinner-h5/base-files/usr/bin/cpu_freq
create mode 100644 target/linux/allwinner-h5/config-4.14
create mode 100644 target/linux/allwinner-h5/image/Makefile
create mode 100644 target/linux/allwinner-h5/patches-4.14/0001-net-thunderx-add-support-for-rgmii-internal-delay-mo.patch
create mode 100644 target/linux/allwinner-h5/patches-4.14/0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch
create mode 100644 target/linux/allwinner-h5/profiles/00-default.mk
create mode 100644 target/linux/nexell-s5p4418/Makefile
create mode 100755 target/linux/nexell-s5p4418/base-files/etc/board.d/01_leds
create mode 100755 target/linux/nexell-s5p4418/base-files/etc/board.d/02_network
create mode 100644 target/linux/nexell-s5p4418/base-files/etc/inittab
create mode 100644 target/linux/nexell-s5p4418/base-files/etc/modules.d/10-bcmdhd
create mode 100644 target/linux/nexell-s5p4418/base-files/lib/upgrade/platform.sh
create mode 100644 target/linux/nexell-s5p4418/config-4.14
create mode 100644 target/linux/nexell-s5p4418/config-4.19
create mode 100644 target/linux/nexell-s5p4418/image/Makefile
create mode 100644 target/linux/nexell-s5p4418/patches-4.14/100-bootargs.patch
create mode 100644 target/linux/nexell-s5p4418/patches-4.14/200-disable-msi.patch
create mode 100644 target/linux/nexell-s5p4418/patches-4.14/301-apalis-ixora-dts-leds.patch
create mode 100644 target/linux/nexell-s5p4418/patches-4.14/302-apalis-ixora-dts-reset-button.patch
create mode 100644 target/linux/nexell-s5p4418/patches-4.19/100-bootargs.patch
create mode 100644 target/linux/nexell-s5p4418/patches-4.19/301-apalis-ixora-dts-leds.patch
create mode 100644 target/linux/nexell-s5p4418/patches-4.19/302-apalis-ixora-dts-reset-button.patch
create mode 100644 target/linux/nexell-s5p4418/profiles/00-default.mk
create mode 100644 target/linux/nexell-s5p6818/Makefile
create mode 100755 target/linux/nexell-s5p6818/base-files/etc/board.d/01_leds
create mode 100755 target/linux/nexell-s5p6818/base-files/etc/board.d/02_network
create mode 100644 target/linux/nexell-s5p6818/base-files/etc/inittab
create mode 100644 target/linux/nexell-s5p6818/base-files/etc/modules.d/10-bcmdhd
create mode 100644 target/linux/nexell-s5p6818/config-4.14
create mode 100644 target/linux/nexell-s5p6818/image/Makefile
create mode 100644 target/linux/nexell-s5p6818/patches-4.14/0001-net-thunderx-add-support-for-rgmii-internal-delay-mo.patch
create mode 100644 target/linux/nexell-s5p6818/patches-4.14/0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch
create mode 100644 target/linux/nexell-s5p6818/profiles/00-default.mk
create mode 100644 target/linux/rockchip-rk3399/Makefile
create mode 100755 target/linux/rockchip-rk3399/base-files/etc/board.d/01_leds
create mode 100755 target/linux/rockchip-rk3399/base-files/etc/board.d/02_network
create mode 100644 target/linux/rockchip-rk3399/base-files/etc/hotplug.d/iface/12-disable-rk3399-eth-offloading
create mode 100755 target/linux/rockchip-rk3399/base-files/etc/init.d/fa-rk3399-pwmfan
create mode 100644 target/linux/rockchip-rk3399/base-files/etc/inittab
create mode 100644 target/linux/rockchip-rk3399/base-files/etc/modules.d/10-bcmdhd
create mode 120000 target/linux/rockchip-rk3399/base-files/etc/rc.d/S96fa-rk3399-pwmfan
create mode 100755 target/linux/rockchip-rk3399/base-files/usr/bin/start-rk3399-pwm-fan.sh
create mode 100644 target/linux/rockchip-rk3399/config-4.14
create mode 100644 target/linux/rockchip-rk3399/image/Makefile
create mode 100644 target/linux/rockchip-rk3399/patches-4.14/0001-net-thunderx-add-support-for-rgmii-internal-delay-mo.patch
create mode 100644 target/linux/rockchip-rk3399/patches-4.14/0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch
create mode 100644 target/linux/rockchip-rk3399/profiles/00-default.mk
create mode 100755 target/linux/sunxi/base-files/etc/board.d/01_leds
create mode 100755 target/linux/sunxi/base-files/usr/bin/cpu_freq
diff --git a/friendlyelec/.gitignore b/friendlyelec/.gitignore
new file mode 100644
index 0000000..1c37a4d
--- /dev/null
+++ b/friendlyelec/.gitignore
@@ -0,0 +1,3 @@
+rootfs-*.tgz
+/rootfs
+1.sh
diff --git a/friendlyelec/build.sh b/friendlyelec/build.sh
new file mode 100755
index 0000000..6402568
--- /dev/null
+++ b/friendlyelec/build.sh
@@ -0,0 +1,63 @@
+#!/bin/bash -eu
+
+function usage()
+{
+ echo "$0 [nanopi-h3|nanopi-h5|nanopi-h6]"
+ exit 1
+}
+
+function create_rootfs_tgz()
+{
+ echo "creating base rootfs tarball(can not use directly)..."
+
+ cd ./friendlyelec
+ rm -rf ./rootfs ./rootfs-friendlywrt.tgz
+
+ case ${BOARD} in
+ nanopi-h3)
+ rootfs_dir=`readlink -f ../build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/root-sunxi`
+ ;;
+ nanopi-h5|nanopi-h6)
+ rootfs_dir=`readlink -f ../build_dir/target-aarch64_cortex-a53_musl/root-sunxi`
+ ;;
+ *)
+ echo "unsupported board: ${BOARD}"
+ exit 1
+ ;;
+ esac
+
+ cp -rdf ${rootfs_dir} ./rootfs
+ rm ./rootfs/lib/modules/* -rf
+ tar czf rootfs-friendlywrt.tgz rootfs
+ ls -l ./rootfs-friendlywrt.tgz
+ echo "done"
+ cd ->/dev/null
+}
+
+if [ $# -ne 1 ]; then
+ usage
+fi
+
+BOARD=$1
+USING_DATE=$(date +%Y%m%d)
+if [ ! -e "config_${BOARD}.seed" ];then
+ usage
+fi
+
+CPU_CORES=`cat /proc/cpuinfo | grep "processor" | wc -l`
+VER=18.06.1
+
+cd ..
+./scripts/feeds update -a
+./scripts/feeds install -a
+
+cp friendlyelec/config_${BOARD}.seed .config
+make defconfig
+
+if [ ! -d dl ]; then
+ echo "dl directory not exist. Will make download full package from openwrt site."
+fi
+make download -j${CPU_CORES}
+make -j${CPU_CORES} #V=s
+
+create_rootfs_tgz
diff --git a/friendlyelec/config_nanopi-h3.seed b/friendlyelec/config_nanopi-h3.seed
new file mode 100644
index 0000000..736dce4
--- /dev/null
+++ b/friendlyelec/config_nanopi-h3.seed
@@ -0,0 +1,128 @@
+CONFIG_TARGET_sunxi=y
+CONFIG_TARGET_sunxi_cortexa7=y
+CONFIG_TARGET_MULTI_PROFILE=y
+CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun8i-h3-nanopi-m1-plus=y
+CONFIG_TARGET_DEVICE_PACKAGES_sunxi_cortexa7_DEVICE_sun8i-h3-nanopi-m1-plus=""
+CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun8i-h3-nanopi-neo=y
+CONFIG_TARGET_DEVICE_PACKAGES_sunxi_cortexa7_DEVICE_sun8i-h3-nanopi-neo=""
+CONFIG_ALL_KMODS=y
+CONFIG_ALL_NONSHARED=y
+CONFIG_DEVEL=y
+CONFIG_TARGET_PER_DEVICE_ROOTFS=y
+CONFIG_AUTOREMOVE=y
+CONFIG_BUILDBOT=y
+CONFIG_IB=y
+CONFIG_IMAGEOPT=y
+# CONFIG_KERNEL_KALLSYMS is not set
+CONFIG_PACKAGE_ar3k-firmware=y
+CONFIG_PACKAGE_ath6k-firmware=y
+CONFIG_PACKAGE_ath9k-htc-firmware=y
+CONFIG_PACKAGE_brcmfmac-firmware-43430-sdio=y
+CONFIG_PACKAGE_brcmfmac-firmware-usb=y
+CONFIG_PACKAGE_carl9170-firmware=y
+CONFIG_PACKAGE_collectd=y
+CONFIG_PACKAGE_collectd-mod-cpu=y
+CONFIG_PACKAGE_collectd-mod-interface=y
+CONFIG_PACKAGE_collectd-mod-iwinfo=y
+CONFIG_PACKAGE_collectd-mod-load=y
+CONFIG_PACKAGE_collectd-mod-memory=y
+CONFIG_PACKAGE_collectd-mod-network=y
+CONFIG_PACKAGE_collectd-mod-rrdtool=y
+CONFIG_PACKAGE_collectd-mod-thermal=y
+CONFIG_PACKAGE_collectd-mod-uptime=y
+CONFIG_PACKAGE_collectd-mod-wireless=y
+CONFIG_PACKAGE_edgeport-firmware=y
+CONFIG_PACKAGE_hostapd-common=y
+CONFIG_PACKAGE_iperf=y
+CONFIG_PACKAGE_iw=y
+CONFIG_PACKAGE_iwinfo=y
+CONFIG_PACKAGE_kmod-brcmfmac=y
+CONFIG_PACKAGE_kmod-brcmutil=y
+CONFIG_PACKAGE_kmod-cfg80211=y
+CONFIG_PACKAGE_kmod-mmc=y
+CONFIG_PACKAGE_kmod-nls-base=y
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_libertas-spi-firmware=y
+CONFIG_PACKAGE_libertas-usb-firmware=y
+CONFIG_PACKAGE_libiwinfo=y
+CONFIG_PACKAGE_libiwinfo-lua=y
+CONFIG_PACKAGE_libltdl=y
+CONFIG_PACKAGE_liblua=y
+CONFIG_PACKAGE_liblucihttp=y
+CONFIG_PACKAGE_liblucihttp-lua=y
+CONFIG_PACKAGE_librrd1=y
+CONFIG_PACKAGE_libubus-lua=y
+CONFIG_PACKAGE_libusb-1.0=y
+CONFIG_PACKAGE_lua=y
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-app-firewall=y
+CONFIG_PACKAGE_luci-app-statistics=y
+CONFIG_PACKAGE_luci-base=y
+CONFIG_PACKAGE_luci-lib-ip=y
+CONFIG_PACKAGE_luci-lib-jsonc=y
+CONFIG_PACKAGE_luci-lib-nixio=y
+CONFIG_PACKAGE_luci-mod-admin-full=y
+CONFIG_PACKAGE_luci-proto-ipv6=y
+CONFIG_PACKAGE_luci-proto-ppp=y
+CONFIG_PACKAGE_luci-theme-bootstrap=y
+CONFIG_PACKAGE_mt7601u-firmware=y
+CONFIG_PACKAGE_mwl8k-firmware=y
+CONFIG_PACKAGE_p54-usb-firmware=y
+CONFIG_PACKAGE_prism54-firmware=y
+CONFIG_PACKAGE_r8169-firmware=y
+CONFIG_PACKAGE_rpcd=y
+CONFIG_PACKAGE_rpcd-mod-rrdns=y
+CONFIG_PACKAGE_rrdtool1=y
+CONFIG_PACKAGE_rs9113-firmware=y
+CONFIG_PACKAGE_rt2800-usb-firmware=y
+CONFIG_PACKAGE_rt73-usb-firmware=y
+CONFIG_PACKAGE_rtl8188eu-firmware=y
+CONFIG_PACKAGE_rtl8192ce-firmware=y
+CONFIG_PACKAGE_rtl8192cu-firmware=y
+CONFIG_PACKAGE_rtl8192de-firmware=y
+CONFIG_PACKAGE_rtl8192se-firmware=y
+CONFIG_PACKAGE_rtl8192su-firmware=y
+CONFIG_PACKAGE_rtl8821ae-firmware=y
+CONFIG_PACKAGE_swconfig=m
+CONFIG_PACKAGE_ti-3410-firmware=y
+CONFIG_PACKAGE_ti-5052-firmware=y
+CONFIG_PACKAGE_triggerhappy=y
+CONFIG_PACKAGE_uclibcxx=y
+CONFIG_PACKAGE_uhttpd=y
+CONFIG_PACKAGE_usb-modeswitch=y
+CONFIG_PACKAGE_usbutils=y
+CONFIG_PACKAGE_wireless-regdb=y
+CONFIG_PACKAGE_wl12xx-firmware=y
+CONFIG_PACKAGE_wl18xx-firmware=y
+CONFIG_PACKAGE_wpad-mini=y
+CONFIG_PACKAGE_zlib=y
+CONFIG_SDK=y
+CONFIG_TARGET_ALL_PROFILES=y
+CONFIG_VERSIONOPT=y
+CONFIG_VERSION_BUG_URL=""
+CONFIG_VERSION_CODE=""
+CONFIG_VERSION_DIST="OpenWrt"
+CONFIG_VERSION_FILENAMES=y
+CONFIG_VERSION_HWREV=""
+CONFIG_VERSION_MANUFACTURER=""
+CONFIG_VERSION_MANUFACTURER_URL=""
+CONFIG_VERSION_NUMBER=""
+CONFIG_VERSION_PRODUCT=""
+CONFIG_VERSION_REPO="http://downloads.openwrt.org/releases/18.06.1"
+CONFIG_VERSION_SUPPORT_URL=""
+# CONFIG_COLLECT_KERNEL_DEBUG is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun6i-a31-m9 is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun7i-a20-bananapi is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun7i-a20-bananapro is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun7i-a20-cubieboard2 is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun7i-a20-cubietruck is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun7i-a20-lamobo-r1 is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun7i-a20-olinuxino-lime is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun7i-a20-olinuxino-lime2 is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun7i-a20-olinuxino-lime2-emmc is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun7i-a20-olinuxino-micro is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun7i-a20-pcduino3 is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun8i-h2-plus-orangepi-r1 is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun8i-h3-orangepi-2 is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun8i-h3-orangepi-pc is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sun8i-h3-orangepi-plus is not set
diff --git a/friendlyelec/config_nanopi-h5.seed b/friendlyelec/config_nanopi-h5.seed
new file mode 100644
index 0000000..0060800
--- /dev/null
+++ b/friendlyelec/config_nanopi-h5.seed
@@ -0,0 +1,114 @@
+CONFIG_TARGET_sunxi=y
+CONFIG_TARGET_sunxi_cortexa53=y
+CONFIG_TARGET_MULTI_PROFILE=y
+CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_sun50i-h5-nanopi-neo-plus2=y
+CONFIG_TARGET_DEVICE_PACKAGES_sunxi_cortexa53_DEVICE_sun50i-h5-nanopi-neo-plus2=""
+CONFIG_ALL_KMODS=y
+CONFIG_ALL_NONSHARED=y
+CONFIG_DEVEL=y
+CONFIG_TARGET_PER_DEVICE_ROOTFS=y
+CONFIG_AUTOREMOVE=y
+CONFIG_BUILDBOT=y
+CONFIG_IB=y
+CONFIG_IMAGEOPT=y
+# CONFIG_KERNEL_KALLSYMS is not set
+CONFIG_PACKAGE_ar3k-firmware=y
+CONFIG_PACKAGE_ath6k-firmware=y
+CONFIG_PACKAGE_ath9k-htc-firmware=y
+CONFIG_PACKAGE_brcmfmac-firmware-43430-sdio=y
+CONFIG_PACKAGE_brcmfmac-firmware-usb=y
+CONFIG_PACKAGE_carl9170-firmware=y
+CONFIG_PACKAGE_collectd=y
+CONFIG_PACKAGE_collectd-mod-cpu=y
+CONFIG_PACKAGE_collectd-mod-interface=y
+CONFIG_PACKAGE_collectd-mod-iwinfo=y
+CONFIG_PACKAGE_collectd-mod-load=y
+CONFIG_PACKAGE_collectd-mod-memory=y
+CONFIG_PACKAGE_collectd-mod-network=y
+CONFIG_PACKAGE_collectd-mod-rrdtool=y
+CONFIG_PACKAGE_collectd-mod-thermal=y
+CONFIG_PACKAGE_collectd-mod-uptime=y
+CONFIG_PACKAGE_collectd-mod-wireless=y
+CONFIG_PACKAGE_edgeport-firmware=y
+CONFIG_PACKAGE_hostapd-common=y
+CONFIG_PACKAGE_iperf=y
+CONFIG_PACKAGE_iw=y
+CONFIG_PACKAGE_iwinfo=y
+CONFIG_PACKAGE_kmod-brcmfmac=y
+CONFIG_PACKAGE_kmod-brcmutil=y
+CONFIG_PACKAGE_kmod-cfg80211=y
+CONFIG_PACKAGE_kmod-mmc=y
+CONFIG_PACKAGE_kmod-nls-base=y
+CONFIG_PACKAGE_kmod-usb-core=y
+CONFIG_PACKAGE_libertas-spi-firmware=y
+CONFIG_PACKAGE_libertas-usb-firmware=y
+CONFIG_PACKAGE_libiwinfo=y
+CONFIG_PACKAGE_libiwinfo-lua=y
+CONFIG_PACKAGE_libltdl=y
+CONFIG_PACKAGE_liblua=y
+CONFIG_PACKAGE_liblucihttp=y
+CONFIG_PACKAGE_liblucihttp-lua=y
+CONFIG_PACKAGE_librrd1=y
+CONFIG_PACKAGE_libubus-lua=y
+CONFIG_PACKAGE_libusb-1.0=y
+CONFIG_PACKAGE_lua=y
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-app-firewall=y
+CONFIG_PACKAGE_luci-app-statistics=y
+CONFIG_PACKAGE_luci-base=y
+CONFIG_PACKAGE_luci-lib-ip=y
+CONFIG_PACKAGE_luci-lib-jsonc=y
+CONFIG_PACKAGE_luci-lib-nixio=y
+CONFIG_PACKAGE_luci-mod-admin-full=y
+CONFIG_PACKAGE_luci-proto-ipv6=y
+CONFIG_PACKAGE_luci-proto-ppp=y
+CONFIG_PACKAGE_luci-theme-bootstrap=y
+CONFIG_PACKAGE_mt7601u-firmware=y
+CONFIG_PACKAGE_mwl8k-firmware=y
+CONFIG_PACKAGE_p54-usb-firmware=y
+CONFIG_PACKAGE_prism54-firmware=y
+CONFIG_PACKAGE_r8169-firmware=y
+CONFIG_PACKAGE_rpcd=y
+CONFIG_PACKAGE_rpcd-mod-rrdns=y
+CONFIG_PACKAGE_rrdtool1=y
+CONFIG_PACKAGE_rs9113-firmware=y
+CONFIG_PACKAGE_rt2800-usb-firmware=y
+CONFIG_PACKAGE_rt73-usb-firmware=y
+CONFIG_PACKAGE_rtl8188eu-firmware=y
+CONFIG_PACKAGE_rtl8192ce-firmware=y
+CONFIG_PACKAGE_rtl8192cu-firmware=y
+CONFIG_PACKAGE_rtl8192de-firmware=y
+CONFIG_PACKAGE_rtl8192se-firmware=y
+CONFIG_PACKAGE_rtl8192su-firmware=y
+CONFIG_PACKAGE_rtl8821ae-firmware=y
+CONFIG_PACKAGE_swconfig=m
+CONFIG_PACKAGE_ti-3410-firmware=y
+CONFIG_PACKAGE_ti-5052-firmware=y
+CONFIG_PACKAGE_triggerhappy=y
+CONFIG_PACKAGE_uclibcxx=y
+CONFIG_PACKAGE_uhttpd=y
+CONFIG_PACKAGE_usb-modeswitch=y
+CONFIG_PACKAGE_usbutils=y
+CONFIG_PACKAGE_wireless-regdb=y
+CONFIG_PACKAGE_wl12xx-firmware=y
+CONFIG_PACKAGE_wl18xx-firmware=y
+CONFIG_PACKAGE_wpad-mini=y
+CONFIG_PACKAGE_zlib=y
+CONFIG_SDK=y
+CONFIG_TARGET_ALL_PROFILES=y
+CONFIG_VERSIONOPT=y
+CONFIG_VERSION_BUG_URL=""
+CONFIG_VERSION_CODE=""
+CONFIG_VERSION_DIST="OpenWrt"
+CONFIG_VERSION_FILENAMES=y
+CONFIG_VERSION_HWREV=""
+CONFIG_VERSION_MANUFACTURER=""
+CONFIG_VERSION_MANUFACTURER_URL=""
+CONFIG_VERSION_NUMBER=""
+CONFIG_VERSION_PRODUCT=""
+CONFIG_VERSION_REPO="http://downloads.openwrt.org/releases/18.06.1"
+CONFIG_VERSION_SUPPORT_URL=""
+# CONFIG_COLLECT_KERNEL_DEBUG is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_sun50i-a64-pine64-plus is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_sun50i-a64-sopine-baseboard is not set
+# CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_sun50i-h5-orangepi-zero-plus is not set
diff --git a/friendlyelec/config_nanopi-h6.seed b/friendlyelec/config_nanopi-h6.seed
new file mode 120000
index 0000000..af92920
--- /dev/null
+++ b/friendlyelec/config_nanopi-h6.seed
@@ -0,0 +1 @@
+config_nanopi-h5.seed
\ No newline at end of file
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 3bf48d7..eedc869 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -100,7 +100,7 @@ generate_network() {
static)
local ipad
case "$1" in
- lan) ipad=${ipaddr:-"192.168.1.1"} ;;
+ lan) ipad=${ipaddr:-"192.168.2.1"} ;;
*) ipad=${ipaddr:-"192.168.$((addr_offset++)).1"} ;;
esac
@@ -241,7 +241,7 @@ generate_static_system() {
uci -q batch <<-EOF
delete system.@system[0]
add system system
- set system.@system[-1].hostname='OpenWrt'
+ set system.@system[-1].hostname='FriendlyWrt'
set system.@system[-1].timezone='UTC'
set system.@system[-1].ttylogin='0'
set system.@system[-1].log_size='64'
diff --git a/package/base-files/files/etc/.gitignore b/package/base-files/files/etc/.gitignore
new file mode 100644
index 0000000..577f99e
--- /dev/null
+++ b/package/base-files/files/etc/.gitignore
@@ -0,0 +1 @@
+/rom-version
diff --git a/package/base-files/files/etc/banner b/package/base-files/files/etc/banner
index f3af3c0..facdce0 100644
--- a/package/base-files/files/etc/banner
+++ b/package/base-files/files/etc/banner
@@ -1,8 +1,8 @@
- _______ ________ __
- | |.-----.-----.-----.| | | |.----.| |_
- | - || _ | -__| || | | || _|| _|
- |_______|| __|_____|__|__||________||__| |____|
- |__| W I R E L E S S F R E E D O M
+ ___ _ _ _ __ _____ _____
+ | __| _(_)___ _ _ __| | |_ \ \ / / _ \_ _|
+ | _| '_| / -_) ' \/ _` | | || \ \/\/ /| / | |
+ |_||_| |_\___|_||_\__,_|_|\_, |\_/\_/ |_|_\ |_|
+ |__/
-----------------------------------------------------
- %D %V, %C
+ FriendlyWRT %V, %C
-----------------------------------------------------
diff --git a/package/base-files/files/etc/enable-swap.sh b/package/base-files/files/etc/enable-swap.sh
new file mode 100755
index 0000000..e7bc6de
--- /dev/null
+++ b/package/base-files/files/etc/enable-swap.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+enable_swap() {
+ if [ -e /swapfile ]; then
+ rm -f /swapfile
+ fi
+
+ DFRESULT=`df / | awk '$3 ~ /[0-9]+/ { print $4 }'`
+ SWAPSIZE=1048576
+ if [ $DFRESULT -gt 2500000 ]; then
+ # 2G
+ SWAPSIZE=2097152
+ elif [ $DFRESULT -gt 2000000 ]; then
+ # 1.5G
+ SWAPSIZE=1572864
+ elif [ $DFRESULT -gt 1500000 ]; then
+ # 1G
+ SWAPSIZE=1048576
+ elif [ $DFRESULT -gt 800000 ]; then
+ # 512M
+ SWAPSIZE=524288
+ else
+ echo "Fail to enable swap: No space left on device (${DFRESULT})"
+ exit 0
+ fi
+
+ dd if=/dev/zero of=/swapfile bs=1024 count=$SWAPSIZE
+ chmod 600 /swapfile
+ mkswap /swapfile
+ swapon /swapfile
+
+ sed -i '/^vm.swappiness=.*/d' /etc/sysctl.conf
+ echo "vm.swappiness=10" >> /etc/sysctl.conf
+ sysctl -p
+
+ while uci -q delete fstab.@swap[-1]; do :; done
+ uci add fstab swap
+ uci set fstab.@swap[-1].enabled='1'
+ uci set fstab.@swap[-1].device='/swapfile'
+ uci set fstab.@swap[-1].label='foo'
+ uci commit fstab
+ echo "done"
+}
+
+HASSWAP=`swapon -s`
+if [ "x$HASSWAP" = "x" ]; then
+ enable_swap
+else
+ echo "swap has been enabled."
+fi
+
diff --git a/package/base-files/files/etc/hotplug.d/ieee80211/09-wireless-bcm4356 b/package/base-files/files/etc/hotplug.d/ieee80211/09-wireless-bcm4356
new file mode 100755
index 0000000..92f2b7d
--- /dev/null
+++ b/package/base-files/files/etc/hotplug.d/ieee80211/09-wireless-bcm4356
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+[ "${ACTION}" = "add" ] || exit 0
+
+FA_VID=`cat /sys/class/${SUBSYSTEM}/${DEVICENAME}/device/vendor`
+FA_PID=`cat /sys/class/${SUBSYSTEM}/${DEVICENAME}/device/device`
+[ ${FA_VID} = "0x02d0" ] || exit 0
+[ ${FA_PID} = "0x4356" ] || exit 0
+
+sleep 1
+FA_RETRY=0
+FA_MAX=10
+while [ ${FA_RETRY} -lt ${FA_MAX} ]; do
+ /usr/sbin/iw phy ${DEVICENAME} interface add wlan1 type station
+ if [ $? -eq 0 ]; then
+ break;
+ fi
+ let FA_RETRY=FA_RETRY+1
+ sleep 1
+done
+
+exit 0
diff --git a/package/base-files/files/etc/hotplug.d/usb/30-usb_wifi_huawei b/package/base-files/files/etc/hotplug.d/usb/30-usb_wifi_huawei
new file mode 100755
index 0000000..60b82a6
--- /dev/null
+++ b/package/base-files/files/etc/hotplug.d/usb/30-usb_wifi_huawei
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+#logger ACTION=$ACTION DEVPATH=$DEVPATH SUBSYSTEM=$SUBSYSTEM DEVTYPE=$DEVTYPE PRODUCT=$PRODUCT MODALIAS=$MODALIAS
+
+PLATFORM='sun8iw7p1|sun50iw2p1'
+if ! grep -E $PLATFORM /sys/class/sunxi_info/sys_info -q; then
+ logger "only support $PLATFORM. exiting..."
+ exit 0
+fi
+
+CONFIG=/etc/config/network
+MODULE=e8372h
+TARGET=eth_$MODULE
+if [ "$DEVTYPE" = usb_device -a "$PRODUCT" = "12d1/14db/102" ]; then
+ if [ "$ACTION" = bind ]; then
+ logger "Huawei WiFi 2 mini(E8372h) insert"
+ NEW=`find /sys/$DEVPATH -name eth*`
+ NEW=`basename $NEW`
+ logger "rename $NEW to $TARGET"
+ ip link set $NEW name $TARGET
+
+ logger "$CONFIG update"
+ mkdir -p /root/.friendlyelec/$MODULE
+ cp $CONFIG /root/.friendlyelec/$MODULE/network
+ if grep eth0 $CONFIG -q; then
+ sed -i "s/eth0/$TARGET/g" $CONFIG
+ else
+ cat << EOF >> $CONFIG
+config interface 'wan'
+ option proto 'dhcp'
+ option ifname 'eth_$MODULE'
+ option dns '8.8.8.8'
+EOF
+ fi
+ /etc/init.d/network reload
+ elif [ "$ACTION" = unbind ]; then
+ logger "Huawei WiFi 2 mini(E8372h) eject"
+ logger "/etc/config/network restore"
+ cp /root/.friendlyelec/$MODULE/network $CONFIG
+ /etc/init.d/network reload
+ fi
+fi
diff --git a/package/base-files/files/etc/hotplug.d/usb/31-usb_wifi b/package/base-files/files/etc/hotplug.d/usb/31-usb_wifi
new file mode 100755
index 0000000..19910823
--- /dev/null
+++ b/package/base-files/files/etc/hotplug.d/usb/31-usb_wifi
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+#logger ACTION=$ACTION DEVPATH=$DEVPATH SUBSYSTEM=$SUBSYSTEM DEVTYPE=$DEVTYPE PRODUCT=$PRODUCT MODALIAS=$MODALIAS
+
+PLATFORM='sun8iw7p1|sun50iw2p1'
+if ! grep -E $PLATFORM /sys/class/sunxi_info/sys_info -q; then
+ logger "only support $PLATFORM. exiting..."
+ exit 0
+fi
+
+FE_DIR=/root/.friendlyelec/
+if [ "${DEVTYPE}" = usb_device -a "${PRODUCT}" = "bda/c811/200" ]; then
+ MODULE=rtl8821cu
+ TARGET=wlan${MODULE}
+
+ WIFI_PATH=`echo ${DEVPATH} | cut -d/ -f 3-`
+ RADIO=`uci show wireless | grep ${WIFI_PATH} | cut -d. -f 2`
+ #logger "${MODULE}: ${WIFI_PATH} ${RADIO}"
+
+ if [ "${ACTION}" = bind ]; then
+ logger "${MODULE}: insert"
+
+ # Rename physical dev
+ # Unimplement(cause error), please FIX ME
+ FULL_PATH=`find /sys/${DEVPATH} -name wlan*`
+ ADDRESS=`cat ${FULL_PATH}/address`
+ WLAN=`basename ${FULL_PATH}`
+ # logger "rename ${WLAN} to $TARGET"
+ # ip link set ${WLAN} name $TARGET
+
+ mkdir -p ${FE_DIR}
+ if [ -e ${FE_DIR}/first_insert_${MODULE} ]; then
+ logger "not first init for ${MODULE}"
+ else
+ touch ${FE_DIR}/first_insert_${MODULE}
+ logger "first init for ${MODULE}"
+
+ # Enable wifi and change ssid
+ if [ -n "`uci get wireless.${RADIO}`" ]; then
+ uci batch <<EOF
+set wireless.${RADIO}.disabled=0
+set wireless.default_${RADIO}.ssid=${MODULE}-${ADDRESS}
+set wireless.default_${RADIO}.encryption=psk2
+set wireless.default_${RADIO}.key=password
+EOF
+ fi
+
+ # add lan interface if not exist. dnsmasq need this
+ if [ -z "`uci get network.lan`" ]; then
+ uci batch <<EOF
+set network.lan='interface'
+set network.lan.type='bridge'
+set network.lan.proto='static'
+set network.lan.ipaddr='192.168.2.1'
+set network.lan.netmask='255.255.255.0'
+set network.lan.ip6assign='60'
+EOF
+ fi
+
+ uci commit
+ fi
+
+ wifi reload
+ sleep 1
+ /etc/init.d/network restart
+ elif [ "${ACTION}" = unbind ]; then
+ logger "${MODULE}: eject"
+
+ # User may change ${RADIO}'s config. So we don't modify it when eject.
+ #uci delete wireless.${RADIO}
+ #uci delete wireless.default_${RADIO}
+ #uci commit
+ #wifi reload
+ fi
+fi
diff --git a/package/base-files/files/etc/init.d/fa-wifiap b/package/base-files/files/etc/init.d/fa-wifiap
new file mode 100755
index 0000000..20f226f
--- /dev/null
+++ b/package/base-files/files/etc/init.d/fa-wifiap
@@ -0,0 +1,13 @@
+#!/bin/sh /etc/rc.common
+
+START=11
+STOP=15
+
+start() {
+ echo "fa-wifiap started"
+ /bin/sh /usr/bin/fix_wifi_ap.sh > /dev/null&
+}
+
+stop() {
+ echo "fa-wifiap: do nothing"
+}
diff --git a/package/base-files/files/etc/modules.d/10-8152 b/package/base-files/files/etc/modules.d/10-8152
new file mode 100644
index 0000000..261be14
--- /dev/null
+++ b/package/base-files/files/etc/modules.d/10-8152
@@ -0,0 +1 @@
+r8152
diff --git a/package/base-files/files/etc/modules.d/90-8189es b/package/base-files/files/etc/modules.d/90-8189es
new file mode 100644
index 0000000..5157d88
--- /dev/null
+++ b/package/base-files/files/etc/modules.d/90-8189es
@@ -0,0 +1 @@
+8189es
diff --git a/package/base-files/files/etc/modules.d/90-8821cu b/package/base-files/files/etc/modules.d/90-8821cu
new file mode 100644
index 0000000..ba36e9b
--- /dev/null
+++ b/package/base-files/files/etc/modules.d/90-8821cu
@@ -0,0 +1 @@
+8821cu
diff --git a/package/base-files/files/etc/modules.d/90-cdc_ether b/package/base-files/files/etc/modules.d/90-cdc_ether
new file mode 100644
index 0000000..de6e227
--- /dev/null
+++ b/package/base-files/files/etc/modules.d/90-cdc_ether
@@ -0,0 +1 @@
+cdc_ether
diff --git a/package/base-files/files/etc/modules.d/xradio_wlan b/package/base-files/files/etc/modules.d/xradio_wlan
new file mode 100644
index 0000000..20db7ac
--- /dev/null
+++ b/package/base-files/files/etc/modules.d/xradio_wlan
@@ -0,0 +1 @@
+xradio_wlan
diff --git a/package/base-files/files/etc/rc.d/S11fa-wifiap b/package/base-files/files/etc/rc.d/S11fa-wifiap
new file mode 120000
index 0000000..de59c87
--- /dev/null
+++ b/package/base-files/files/etc/rc.d/S11fa-wifiap
@@ -0,0 +1 @@
+../init.d/fa-wifiap
\ No newline at end of file
diff --git a/package/base-files/files/etc/rc.local b/package/base-files/files/etc/rc.local
index 5639477..a07d8a4 100644
--- a/package/base-files/files/etc/rc.local
+++ b/package/base-files/files/etc/rc.local
@@ -1,4 +1,14 @@
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
+/usr/bin/lcd2usb_echo &
+
+board=$(cat /tmp/sysinfo/board_name | cut -d , -f2)
+if [ ! -e /etc/firstboot_${board} ]; then
+ /root/setup.sh
+ touch /etc/firstboot_${board}
+fi
+/bin/mount -a
+
+#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
exit 0
diff --git a/package/base-files/files/etc/sysctl.conf b/package/base-files/files/etc/sysctl.conf
index ae04212..7c3ae6f 100644
--- a/package/base-files/files/etc/sysctl.conf
+++ b/package/base-files/files/etc/sysctl.conf
@@ -1 +1,4 @@
# Defaults are configured in /etc/sysctl.d/* and can be customized in this file
+
+net.bridge.bridge-nf-call-ip6tables=1
+net.bridge.bridge-nf-call-iptables=1
diff --git a/package/base-files/files/root/setup.sh b/package/base-files/files/root/setup.sh
new file mode 100755
index 0000000..64681ed
--- /dev/null
+++ b/package/base-files/files/root/setup.sh
@@ -0,0 +1,114 @@
+#!/bin/sh
+
+# THIS SCIPRT ONLY RUN ONCE. Base on /etc/firstboot_${board}
+
+setup_ssid()
+{
+ local r=$1
+ local chip
+
+ if ! uci show wireless.${r} >/dev/null 2>&1; then
+ return
+ fi
+
+ logger "${TAG}: setup $1's ssid"
+ wlan_path=/sys/devices/`uci get wireless.${r}.path`
+ wlan_path=`find ${wlan_path} -name wlan* | tail -n 1`
+ local mac=`cat ${wlan_path}/address`
+
+ local dev_path=/sys/devices/`uci get wireless.${r}.path`
+
+ if [ -e "${dev_path}/../idVendor" -a -e "${dev_path}/../idProduct" ]; then
+ idVendor=`cat ${dev_path}/../idVendor`
+ idProduct=`cat ${dev_path}/../idProduct`
+ if [ "x${idVendor}:${idProduct}" = "x0bda:c811" ]; then
+ chip="rtl8821cu"
+ touch ${FE_DIR}/first_insert_${chip} # for /etc/hotplug.d/usb/31-usb_wifi
+ fi
+ fi
+
+ if [ -e "${dev_path}/vendor" -a -e "${dev_path}/device" ]; then
+ idVendor=`cat ${dev_path}/vendor`
+ idProduct=`cat ${dev_path}/device`
+
+ # enable 5g wifi-ap (t4)
+ if [ "x${idVendor}:${idProduct}" = "x0x02d0:0x4356" ]; then
+ uci set wireless.${r}.hwmode='11a'
+ uci set wireless.${r}.channel='153'
+ fi
+
+ # r2
+ if [ "x${idVendor}:${idProduct}" = "x0x02d0:0xa9bf" ]; then
+ uci set wireless.${r}.hwmode='11a'
+ uci set wireless.${r}.channel='153'
+ fi
+ fi
+
+ uci set wireless.${r}.disabled=0
+ if [ -n "${chip}" ];then
+ uci set wireless.default_${r}.ssid=${chip}-${mac}
+ else
+ uci set wireless.default_${r}.ssid=FriendlyWrt-${mac}
+ fi
+ uci set wireless.default_${r}.encryption=psk2
+ uci set wireless.default_${r}.key=password
+ uci commit
+}
+
+FE_DIR=/root/.friendlyelec/
+mkdir -p ${FE_DIR}
+TAG=friendlyelec
+logger "${TAG}: /root/setup.sh running"
+
+VENDOR=$(cat /tmp/sysinfo/board_name | cut -d , -f1)
+BOARD=$(cat /tmp/sysinfo/board_name | cut -d , -f2)
+if [ x${VENDOR} != x"friendlyelec" ]; then
+ if [ x${VENDOR} != x"friendlyarm" ]; then
+ logger "only support friendlyelec boards. exiting..."
+ exit 0
+ fi
+fi
+
+if [ -f /sys/class/sunxi_info/sys_info ]; then
+ SUNXI_BOARD=`grep "board_name" /sys/class/sunxi_info/sys_info`
+ SUNXI_BOARD=${SUNXI_BOARD#*FriendlyElec }
+
+ logger "${TAG}: init for ${SUNXI_BOARD}"
+ if ls /root/board/${SUNXI_BOARD}/* >/dev/null 2>&1; then
+ cp -rf /root/board/${SUNXI_BOARD}/* /
+ fi
+fi
+
+# update /etc/config/network
+WAN_IF=`uci get network.wan.ifname`
+if [ "x${WAN_IF}" = "xeth0" ]; then
+ uci set network.wan.dns=8.8.8.8
+ uci commit
+fi
+
+WIFI_NUM=`find /sys/class/net/ -name wlan* | wc -l`
+if [ ${WIFI_NUM} -gt 0 ]; then
+
+ # make sure lan interface exist
+ if [ -z "`uci get network.lan`" ]; then
+ uci batch <<EOF
+set network.lan='interface'
+set network.lan.type='bridge'
+set network.lan.proto='static'
+set network.lan.ipaddr='192.168.2.1'
+set network.lan.netmask='255.255.255.0'
+set network.lan.ip6assign='60'
+EOF
+ fi
+
+ # update /etc/config/wireless
+ for i in `seq 0 ${WIFI_NUM}`; do
+ setup_ssid radio${i}
+ done
+fi
+
+/etc/init.d/led restart
+/etc/init.d/network restart
+/etc/init.d/dnsmasq restart
+
+logger "done"
diff --git a/package/base-files/files/usr/bin/fix_wifi_ap.sh b/package/base-files/files/usr/bin/fix_wifi_ap.sh
new file mode 100755
index 0000000..b763741
--- /dev/null
+++ b/package/base-files/files/usr/bin/fix_wifi_ap.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+#
+# Fix loss of AP mode fails