Compare commits

...

156 Commits

Author SHA1 Message Date
Liangbin Lian
99075b24e3 target/rockchip: add hinlink rk3568 series
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
2025-04-09 18:12:43 +08:00
Liangbin Lian
832a7c598f package/uboot-rockchip: rockchip-saradc: supports rk3568's 8 channels ADC
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-04-09 17:03:44 +08:00
Liangbin Lian
fef4ac8e30 package/kernel: kmod-ata-achi-dwc enable sata pmp support 2025-04-09 14:53:17 +08:00
Liangbin Lian
29898666f1 target/rockchip: easepi r1 fix eth_order in linux 6.6 2025-04-08 15:28:44 +08:00
Liangbin Lian
ed1d630310 target/rockchip: fix iface order
PCIe address changed on linux 6.6

previous:
```
0000:01:00.0
0001:11:00.0
0002:21:00.0
...
```

current:
```
0000:01:00.0
0001:01:00.0
0002:01:00.0
...
```
2025-04-08 15:27:33 +08:00
Liangbin Lian
155b840287 istoreos: fix kmod clean on post upgrade
grep -f with empty file will pass all input.

Fix ("istoreos: improve kmod clean on post upgrade")
2025-04-07 22:04:39 +08:00
Liangbin Lian
9cad938c38 package/r8168: update patches 2025-04-07 21:14:23 +08:00
Liangbin Lian
907f6b9219 package/r8125: update patches 2025-04-07 21:13:43 +08:00
Liangbin Lian
2ba8cdcda3 target/rockchip: rtl8211f led config by dts 2025-04-07 20:23:15 +08:00
Liangbin Lian
d93c4d1c0f target/rockchip: easepi r1 network config 2025-04-07 14:24:06 +08:00
Liangbin Lian
5de53900b5 target/rockchip: add easepi r1 2025-04-07 14:23:55 +08:00
Liangbin Lian
2f634e7883 package/kernel: kmod-drm-udl fix depends 2025-04-07 14:23:25 +08:00
Liangbin Lian
3b882dda2e base-files: default set lan ip6class to wan6 and wan_6
Accept wan_6 PD address on PPPoE

Fix ("base-files: default set lan ip6class to wan6")
2025-04-07 14:23:18 +08:00
Liangbin Lian
cd959beab8 target/rockchip: update network config 2025-04-07 14:23:06 +08:00
Liangbin Lian
43cece663d target/rockchip: move net smp affinity script to board init 2025-04-03 14:56:08 +08:00
Liangbin Lian
b48a1a22f0 target/rockchip: fix DEVICE_PACKAGES 2025-04-03 14:09:02 +08:00
Liangbin Lian
2ac2270d53 target/rockchip: add rk3568 rk3588 legacy bootscripts 2025-04-03 14:03:57 +08:00
Liangbin Lian
a15aefd8d1 package/rockchip-drivers: ignore devfreq init failed 2025-04-02 13:06:58 +08:00
Liangbin Lian
717b7f7999 target/rockchip: fix rk3568 iommu 2025-04-01 23:48:35 +08:00
Liangbin Lian
b201c1a062 target/rockchip: check rk3588 dts interrupt cells 2025-04-01 18:46:25 +08:00
Liangbin Lian
c3bbca7d80 istoreos: improve kmod clean on post upgrade
keep metadata so that user can install later
2025-04-01 18:27:53 +08:00
Liangbin Lian
8738984c4c base-files: default set lan ip6class to wan6
Before this, lan will be assigned ULA-prefix address,
when lan send Neighbor Solicitation to other lan area hosts with ULA-prefix address as source,
some hosts may not respond (macOS, etc.).

https://openwrt.org/docs/guide-user/network/ipv6/configuration#downstream_configuration_for_lan_interfaces
2025-03-31 18:08:16 +08:00
Liangbin Lian
3602c4d85a target/rockchip: add fastrhino r66s/r68s support 2025-03-27 20:15:25 +08:00
Liangbin Lian
ed5ec70571 target/rockchip: add friendlyarm r5s/r5c series support 2025-03-27 20:13:57 +08:00
Liangbin Lian
35f6894adf target/rockchip: add rk3568 common make rules 2025-03-27 20:11:14 +08:00
Liangbin Lian
c928b4e60b target/rockchip: add rk3568 common dts 2025-03-27 20:08:07 +08:00
Liangbin Lian
9983f915ee target/rockchip: refactor image makefile 2025-03-27 20:06:52 +08:00
Liangbin Lian
07422b2fa2 uboot-rockchip: add generic RK3568 uboot 2025-03-27 14:27:53 +08:00
Liangbin Lian
0ec9323e0d target/rockchip: rockchip-iommu porting flush_iotlb_all from vendor driver
fix MPP AV1 decoding crash:
```
[  217.355974] mpp_av1dec fdc70000.av1d: resetting...
[  219.804008] rockchip-pm-domain fd8d8000.power-management:power-controller: failed to set idle on domain 'av1', val=0
[  222.250403] rockchip-pm-domain fd8d8000.power-management:power-controller: failed to get ack on domain 'av1', val=0xbfeff
[  222.251358] SError Interrupt on CPU7, code 0x00000000be000411 -- SError
[  222.251361] CPU: 7 PID: 553 Comm: mpp_worker_11 Tainted: G           O       6.6.67 #0
[  222.251364] Hardware name: FriendlyElec NanoPi R6C (DT)
[  222.251365] pstate: 804000c9 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  222.251367] pc : _raw_spin_trylock+0x28/0x8c
[  222.251373] lr : clk_enable_lock+0x30/0xc0
[  222.251376] sp : ffff80008314bc70
[  222.251377] x29: ffff80008314bc70 x28: 0000000000000000 x27: 0000000000000000
[  222.251379] x26: 0000000000000000 x25: ffff80007985f000 x24: ffff0001067a2c88
[  222.251382] x23: ffff0001067a2c80 x22: ffff000101b26400 x21: 0000000000000000
[  222.251384] x20: ffff800081161c30 x19: ffff800081161c10 x18: 000000000000025d
[  222.251386] x17: 66203a72656c6c6f x16: 72746e6f632d7265 x15: ffff800080e83b70
[  222.251389] x14: 0000000000000717 x13: 000000000000025d x12: 00000000ffffffea
[  222.251391] x11: 00000000ffffbfff x10: ffff800080fe3b70 x9 : ffff800080e83b18
[  222.251393] x8 : 0000000000000002 x7 : 000000000000ba7d x6 : 000000000769ea37
[  222.251395] x5 : 0000000001000000 x4 : 0000000000000000 x3 : 0000000000000000
[  222.251397] x2 : 0000000000000000 x1 : 0000000000000001 x0 : ffff800081161c30
[  222.251400] Kernel panic - not syncing: Asynchronous SError Interrupt
[  222.251401] CPU: 7 PID: 553 Comm: mpp_worker_11 Tainted: G           O       6.6.67 #0
[  222.251403] Hardware name: FriendlyElec NanoPi R6C (DT)
[  222.251404] Call trace:
[  222.251405]  dump_backtrace+0xa0/0xe0
[  222.251409]  show_stack+0x18/0x24
[  222.251411]  dump_stack_lvl+0x48/0x60
[  222.251414]  dump_stack+0x18/0x24
[  222.251417]  panic+0x2ec/0x348
[  222.251420]  nmi_panic+0x70/0x74
[  222.251421]  arm64_serror_panic+0x6c/0x78
[  222.251425]  do_serror+0x3c/0x70
[  222.251428]  el1h_64_error_handler+0x30/0x48
[  222.251431]  el1h_64_error+0x68/0x6c
[  222.251432]  _raw_spin_trylock+0x28/0x8c
[  222.251434]  clk_disable+0x24/0x4c
[  222.251436]  clk_bulk_disable+0x3c/0x58
[  222.251440]  av1d_iommu_disable+0x68/0x80
[  222.251443]  av1_iommu_disable+0x1c/0x34
[  222.251445]  rockchip_iommu_disable+0x48/0x70
[  222.251448]  mpp_iommu_refresh+0x20/0x54 [rk_vcodec]
[  222.251470]  mpp_dev_reset+0xb0/0x168 [rk_vcodec]
[  222.251477]  mpp_task_finish+0x60/0x154 [rk_vcodec]
[  222.251485]  rkvdec2_hard_ccu_worker+0x144c4/0x15c88 [rk_vcodec]
[  222.251492]  mpp_session_cleanup_detach+0x1c8/0x694 [rk_vcodec]
[  222.251500]  kthread_worker_fn+0xc8/0x140
[  222.251503]  kthread+0x110/0x114
[  222.251505]  ret_from_fork+0x10/0x20
[  222.251507] SMP: stopping secondary CPUs
[  222.251565] Kernel Offset: disabled
[  222.251566] CPU features: 0x0,c0000000,70028141,1000700b
[  222.251567] Memory Limit: none
```
2025-03-25 16:45:08 +08:00
Liangbin Lian
2e5a5d405b Revert "target/rockchip: disable iommu passthrough via kernel command line"
This reverts commit b53dc2e14b.
2025-03-25 11:50:34 +08:00
Liangbin Lian
d9e3c2cb13 target/rockchip: rockchip_iommu no passthrough for platform devices 2025-03-25 11:50:13 +08:00
Liangbin Lian
9c21acba06 target/rockchip: rk3588 enable RNG 2025-03-24 19:03:05 +08:00
Liangbin Lian
819445e446 target/rockchip: use vendor RNG driver 2025-03-24 19:01:48 +08:00
Liangbin Lian
bee149c530 target/rockchip: kernel add rockchip_dmc.h 2025-03-21 19:06:12 +08:00
Liangbin Lian
d53da56687 package/mali-drivers: skip building mali400 on csf variant 2025-03-21 18:23:33 +08:00
Liangbin Lian
f0c1ab22bf package/mali-drivers: remove rockchip pvtm dependency 2025-03-21 18:22:33 +08:00
Liangbin Lian
b53dc2e14b target/rockchip: disable iommu passthrough via kernel command line
Currently vpu and npu do not work in iommu passthrough mode.
2025-03-20 19:55:06 +08:00
Liangbin Lian
9a6ad6e89e package/rockchip-drivers: tips for iova error 2025-03-20 19:47:56 +08:00
Liangbin Lian
cc9205a98e target/rockchip: add av1d iommu 2025-03-20 19:46:45 +08:00
Liangbin Lian
9ab57f7bf7 target/rockchip: patches rockchip's dma heaps 2025-03-19 13:39:06 +08:00
Liangbin Lian
b7739e4eda target/rockchip: add rockchip's dma heaps 2025-03-19 13:38:37 +08:00
Liangbin Lian
722032a1e0 package/rockchip-drivers: remove iommu-av1d driver
iommu_device_register does not support multiple iommu drivers
2025-03-18 23:31:55 +08:00
Liangbin Lian
d37c21fed2 package/rockchip-drivers: register iommu-av1d driver
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-18 22:29:04 +08:00
Liangbin Lian
5510821042 package/mali-drivers: csf overlay supports upstream dts
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-17 18:40:31 +08:00
Liangbin Lian
8055e36fac target/rockchip: drivers compatible with rockchip,rk3588s now
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-17 18:19:29 +08:00
Liangbin Lian
62df8e1ac3 package/mali-drivers: supports upstream dts
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-17 18:16:13 +08:00
Liangbin Lian
98418cf2bc package/rockchip-drivers: supports upstream dts
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-17 18:15:43 +08:00
Liangbin Lian
fa9d5011f2 target/rockchip: ip core dts add author info
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-14 23:48:45 +08:00
Liangbin Lian
8f43e223a3 target/rockchip: friendlyarm nanopi r6s/r6c use extended dts
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-14 23:08:44 +08:00
Liangbin Lian
3882ed92ba target/rockchip: friendlyarm nanopi r6s/r6c add ip cores drivers
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-14 23:07:35 +08:00
Liangbin Lian
cd74d7a444 target/rockchip: friendlyarm nanopi r6s/r6c add ip cores dts
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-14 23:04:04 +08:00
Liangbin Lian
0b0caf4813 target/rockchip: add soc ip cores dts
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-14 23:01:48 +08:00
Liangbin Lian
a64d066980 package/mali-drivers,rockchip-drivers: config supported cpus
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-14 22:59:31 +08:00
Liangbin Lian
9e76e42d9e package: add mali-drivers
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-03-11 19:14:37 +08:00
Liangbin Lian
d1d3c521ea rockchip-drivers: add iommu-av1d
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-02-25 18:37:44 +08:00
Liangbin Lian
94b62e52c9 package: add rockchip-drivers
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-02-25 15:52:40 +08:00
Liangbin Lian
fb37aa4118 target/rockchip: exports iommu apis 2025-02-25 15:50:57 +08:00
Liangbin Lian
a9287e6e5f target/rockchip: exports pm-domains apis 2025-02-25 15:50:24 +08:00
Liangbin Lian
965cc7166d target/rockchip: enable dma-buf heaps 2025-02-07 20:35:05 +08:00
Liangbin Lian
8369665ccd kernel: fix dma-buf build into kernel 2025-02-07 20:34:04 +08:00
Liangbin Lian
eee1f80c38 target/rockchip: bootscript adc command changed on uboot 2024.10
Fixes: ff7754c8af ("target/rockchip: supports boot from legacy uboot")
2025-02-06 17:43:16 +08:00
Liangbin Lian
3496079d3e target/rockchip: r6s firmware supports r6c
Fixes: 193e2ebda0 ("target/rockchip: r6s firmware supports r6c")
2025-02-06 17:08:34 +08:00
Liangbin Lian
ac2afcff65 uboot-rockchip: add dummy regulator for saradc
Fixes: 21cede76d1 ("uboot-rockchip: add generic RK3588 uboot")
2025-02-06 17:07:16 +08:00
Liangbin Lian
193e2ebda0 target/rockchip: r6s firmware supports r6c 2025-02-05 19:37:32 +08:00
Liangbin Lian
e1c4e8b899 target/rockchip: fix legacy dts coping to boot
Fixes: ff7754c8af ('target/rockchip: supports boot from legacy uboot')
2025-02-05 19:36:01 +08:00
Liangbin Lian
78072c02f6 uboot-rockchip: default build generic rk3588 uboot
Fixes: 21cede76d1 ("uboot-rockchip: add generic RK3588 uboot")
2025-02-05 16:59:24 +08:00
Liangbin Lian
9b5268d1cc target/rockchip: r6s use generic uboot 2025-02-05 16:47:36 +08:00
Liangbin Lian
21cede76d1 uboot-rockchip: add generic RK3588 uboot 2025-02-05 16:47:03 +08:00
Liangbin Lian
ff7754c8af target/rockchip: supports boot from legacy uboot 2025-02-05 16:45:14 +08:00
Liangbin Lian
9743247d2a kernel: fix SATA PMP LED trigger
Fixes: e3263dd951 ("kernel: supports LED trigger by SATA Port Multiplier port")
2025-01-24 15:33:26 +08:00
ntlf9t
bf7bd4cc67 Bypassing the HH3K up to 2.5Gbps using a BCM578xx
https://www.dslreports.com/forum/r32230041-Internet-Bypassing-the-HH3K-up-to-2-5Gbps-using-a-BCM57810S-NIC
2025-01-22 16:49:07 +08:00
Liangbin Lian
f207e8d42f target/armsr: auto unload kmods 2025-01-20 13:44:22 +08:00
Liangbin Lian
890371759b target/x86: auto unload kmods 2025-01-20 13:44:22 +08:00
Liangbin Lian
58f2080660 package/mac80211: auto unload rtw89 iwlwifi 2025-01-20 13:44:12 +08:00
Liangbin Lian
3098ea6c68 package/dkml: auto unload common drivers 2025-01-20 13:35:54 +08:00
Liangbin Lian
6d7dd6cb1a package/dkml: show only existed kmods 2025-01-20 11:00:12 +08:00
Liangbin Lian
73532caa94 target/armsr/armv8: opkg compatible with cortex-a53 source 2025-01-20 10:48:00 +08:00
Liangbin Lian
368486c0cc target/armsr: update console settings 2025-01-17 17:51:02 +08:00
Liangbin Lian
77972429d9 target/x86: disable rootfs.img[.gz] 2025-01-17 13:16:03 +08:00
Liangbin Lian
ecbaf4faab target/armsr: disable rootfs.img[.gz] 2025-01-17 13:15:50 +08:00
Liangbin Lian
ac9269b9a6 target/armsr: enable UAS in kernel 2025-01-17 13:14:34 +08:00
Liangbin Lian
d20111faac target/x86: add missing kernel config 2025-01-17 13:14:00 +08:00
Liangbin Lian
77647fc1b6 target/armsr: istoreos patches 2025-01-17 11:48:27 +08:00
Liangbin Lian
b152aed759 linux: module.h: move tracing and bpf to the end of struct 2025-01-16 18:16:21 +08:00
Liangbin Lian
6532b23b74 linux: net_namespace.h: move XDP to the end of struct 2025-01-14 18:25:49 +08:00
Liangbin Lian
26256b8811 target/x86: add USB UAS support in kernel 2025-01-14 15:43:58 +08:00
Liangbin Lian
ac754a104f linux: initramfs.c: workaround GRUB initrd bugs
rework Ventoy boot
2025-01-14 14:40:37 +08:00
Liangbin Lian
14e8b73a76 package/linux: kmod-i915 enable GuC 2025-01-13 15:34:16 +08:00
Liangbin Lian
f20bee3ec4 linux-firmware: i915-firmware only select firmwares required by i915 driver 2025-01-13 15:26:39 +08:00
Liangbin Lian
940ad2e534 x86: i915: supports Intel ADL-N Refresh (N150/N250/N355) iGPU 2025-01-13 11:17:04 +08:00
Liangbin Lian
ff271f8e38 base-files: fix ucitrack not working 2025-01-10 20:53:23 +08:00
Liangbin Lian
64711eb397 package/linux: vfio No-IOMMU support 2025-01-10 17:26:07 +08:00
Liangbin Lian
15da100aad package/linux: vfio-pci support passthrough VGA devices 2025-01-10 17:25:32 +08:00
Liangbin Lian
e200f39338 istoreos: feeds.conf.default use istoreos branches 2025-01-09 13:11:24 +08:00
Liangbin Lian
f6f2727fbf linux: netdevice.h: move FCOE members to the struct end for better compatibility 2025-01-08 18:24:04 +08:00
Liangbin Lian
084a66221f istoreos: fix boot done message on multiple ttys 2025-01-08 18:23:17 +08:00
Liangbin Lian
24ab14b78e target.mk: enable luci-app-store on aarch64,x86_64 platforms by default 2025-01-08 15:46:04 +08:00
Liangbin Lian
2d65221a52 package/mdadm: set priority to fstab
and hold the package
2025-01-08 15:25:44 +08:00
Liangbin Lian
a720f636ef package/zram-swap: support enabled flag 2025-01-08 15:22:56 +08:00
Liangbin Lian
25c8839a00 package/rpcd: recovery from a failed uci commit
If uci commit failed, recovery uci, then return a error.

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
(cherry picked from commit 46ac9ad595fd492d2477e45bcbe9f4bebc13e013)
2025-01-08 15:18:38 +08:00
Liangbin Lian
a228b256f7 package/uci: prevent writing empty configuration files when disk is full
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
(cherry picked from commit 2408c5fdeead2d77529a6306a5d1b5a6c2fcf663)
2025-01-08 15:17:51 +08:00
Liangbin Lian
cc5541096d opkg: selects curl
fix "opkg: use curl as downloader"
2025-01-08 15:13:53 +08:00
Liangbin Lian
8a8087adbc package/fstools: fstab essential mount point hook 2025-01-08 15:10:27 +08:00
Liangbin Lian
52c5c7ce3b package/fstools: fstab supports waiting essential mount point on boot 2025-01-08 15:10:10 +08:00
Liangbin Lian
66d749f2a6 package/uhttpd: stop on system shutdown 2025-01-08 15:05:57 +08:00
Liangbin Lian
a64906dd8b package/dnsmasq: default filter AAAA 2025-01-08 15:03:18 +08:00
Liangbin Lian
5119be09f9 package/openssl: enable optimize by default 2025-01-08 14:57:41 +08:00
Liangbin Lian
714790757e package/r8101,r8125,r8126,r8168: change ethernet drivers loading priority 2025-01-08 14:48:59 +08:00
Liangbin Lian
1d3055c689 package/r8125: rework 2.5G on [10ec:8162] 2025-01-08 14:46:36 +08:00
Liangbin Lian
81273716b5 package/linux: add drm-udl driver 2025-01-08 14:38:25 +08:00
Liangbin Lian
eb69f8fc43 package/linux: change ethernet drivers loading priority 2025-01-08 14:03:28 +08:00
Liangbin Lian
34296ea0a1 package/linux: add fs-binfmt-misc module 2025-01-08 13:39:14 +08:00
Liangbin Lian
8742c9dabe kernel: add QLogic QED drivers 2025-01-08 13:36:44 +08:00
Liangbin Lian
d07557601a package/linux: add mpt3sas driver
support LSI MPT Fusion 3.0 and 2.0,
SAS2008/SAS2308/SAS3008/SAS3108, etc.
2025-01-08 13:28:40 +08:00
Liangbin Lian
aea8460983 istoreos: kernel and kernel modules default mark as hold 2025-01-08 13:21:24 +08:00
Liangbin Lian
539dde1adb target/rockchip: drivers: thermal: step_wise: add support for hysteresis
copy from target/linux/bcm27xx/patches-6.6/950-0887-drivers-thermal-step_wise-add-support-for-hysteresis.patch
2025-01-08 12:58:24 +08:00
Liangbin Lian
c792d1c1ee kernel: fix rtl8366_smi CE on debugfs enabled 2025-01-07 20:32:35 +08:00
Liangbin Lian
a2e266f7ee package/nftables: fix patches failed
nftables source has a `tests/shell/run-tests.sh.rej`, makes openwrt patch-kernel.sh confused

```
Aborting.  Reject files found.
```
2025-01-07 17:15:16 +08:00
Liangbin Lian
c859e491d8 fw4: supports brcm fullcone-nat 2025-01-07 17:15:05 +08:00
Liangbin Lian
384ea8af4c linux: netfilter: nft_masq: supports brcm fullcone flag 2025-01-07 17:13:59 +08:00
Liangbin Lian
a3a7beacad package/iptables: fix bcm fullcone-nat patch
fix "network: add brcm fullcone support from ASUS Merlin kernel 4.19"
2025-01-07 17:12:55 +08:00
Liangbin Lian
6c33c261c8 network: add brcm fullcone support from ASUS Merlin kernel 4.19 2025-01-03 13:55:54 +08:00
Liangbin Lian
e9dd297684 opkg: use curl as downloader 2025-01-03 13:15:31 +08:00
Liangbin Lian
1648cbd2de imagebuilder: append "unofficial" to release description 2025-01-03 12:58:27 +08:00
Liangbin Lian
075ec41af2 imagebuilder: fix repeated generation of package index when signing is enabled
`$(MAKE) package_index` will generate Packages.sig if signing is enabled, and Packages.sig is always newer than Packages.gz, cause repeated generation of package index on next build. So we should ignore Packages.sig.

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-01-03 12:56:52 +08:00
Liangbin Lian
3556ce6811 rockchip: enable sata pmp leds 2025-01-03 12:49:07 +08:00
Liangbin Lian
03b6c945c1 istoreos: write system shutdown message to consoles 2025-01-03 12:44:34 +08:00
Liangbin Lian
749ef0cd74 istoreos: fix docker NAT with fw4
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-01-03 11:46:34 +08:00
Liangbin Lian
0e8c395643 kernel: ledtrig-netdev: fix carrier status check
Referring to carrier_show in net/core/net-sysfs.c,
we can see that netif_carrier_ok is only meaningful on netif_running.

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-01-02 19:45:46 +08:00
Liangbin Lian
21e285bb5b kernel: ledtrig-netdev: we only care about new devices init namespace
The eth0 in the Docker container affects the led status,
but I don't think anyone cares about the eth0 status of the Docker container,
and currently ledtrig-netdev does not support net namespace.

So filter out all non-init namespace new device events.

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-01-02 19:44:10 +08:00
Liangbin Lian
e3263dd951 kernel: supports LED trigger by SATA Port Multiplier port 2025-01-02 19:40:53 +08:00
Liangbin Lian
a0f8ed1334 linux: compatible modules without kallsyms on KALLSYMS enabled kernel
linux/module.h: move kallsyms to the end of struct
2025-01-02 19:36:18 +08:00
Liangbin Lian
f778584050 target/x86: kernel integrated USB serial devices 2025-01-02 12:59:52 +08:00
Liangbin Lian
e5f44ce74f x86 & rockchip: enable SATA PMP 2025-01-02 12:58:01 +08:00
Liangbin Lian
aec65ccc2c x86: set default network 2024-12-31 16:04:11 +08:00
Liangbin Lian
e20df57360 istoreos: set default zonename 2024-12-31 16:00:22 +08:00
Liangbin Lian
a68f09ae43 istoreos: add istoreos system packages 2024-12-31 14:42:45 +08:00
Liangbin Lian
c956349da7 target/x86: support custom grub hook 2024-12-31 14:31:33 +08:00
Liangbin Lian
74213075fb x86: fix grub stuck on some boards 2024-12-31 14:28:30 +08:00
Liangbin Lian
af02f432ff grub2: supports for x86 custom cmdline 2024-12-31 14:27:50 +08:00
Liangbin Lian
7770e69654 istoreos: write boot done message to process fd/1 instead of /dev/console
/dev/console may invalid on 24.10

```
root@OpenWrt:~# echo hello > /dev/console
ash: write error: I/O error
root@OpenWrt:~#
```
2024-12-31 13:40:12 +08:00
Liangbin Lian
7eb71946e9 add istoreos-files 2024-12-31 12:01:13 +08:00
Liangbin Lian
4236c721b6 base-files: istoreos patches 2024-12-31 11:45:46 +08:00
Liangbin Lian
f826da5be6 istoreos: fix mount_root 2024-12-30 20:52:03 +08:00
Liangbin Lian
d565847d61 istoreos: add official kmods repo to distfeeds 2024-12-30 19:35:13 +08:00
Liangbin Lian
e886ba8500 target/bcm27xx: supports istoreos upgrade 2024-12-30 19:33:30 +08:00
Liangbin Lian
2233b7e594 target/rockchip: supports istoreos upgrade 2024-12-30 19:32:48 +08:00
Liangbin Lian
dd6af5561e feeds change to github source 2024-12-30 17:26:56 +08:00
Liangbin Lian
136f0a11e0 istoreos: supports ventoy boot 2024-12-30 17:06:41 +08:00
Liangbin Lian
2c1468d7dc target/x86: supports istoreos upgrade 2024-12-30 17:06:20 +08:00
Liangbin Lian
0338019c90 istoreos: use dedicated overlay partition and support sandbox 2024-12-30 16:56:14 +08:00
Liangbin Lian
8e030bb595 istoreos: update project info 2024-12-30 15:49:42 +08:00
Liangbin Lian
f3c4c31bbc istoreos: supports build kernel image only 2024-12-30 15:47:31 +08:00
Liangbin Lian
3e2badb38a istoreos: supports predefined kernel vermagic 2024-12-30 15:43:32 +08:00
Liangbin Lian
4deb3e6a84 istoreos: change brand to iStoreOS 2024-12-30 15:41:30 +08:00
Liangbin Lian
e644e0248e change repo to current release 2024-12-30 15:19:56 +08:00
283 changed files with 19082 additions and 286 deletions

1
.github/FUNDING.yml vendored
View File

@ -1 +0,0 @@
custom: [ 'https://openwrt.org/donate' ]

View File

@ -1,8 +0,0 @@
Thanks for your contribution to OpenWrt!
To help keep the codebase consistent and readable,
and to help people review your contribution,
we ask you to follow the rules you find in the wiki at this link
https://openwrt.org/submitting-patches
Please remove this message before posting the pull request.

1
.gitignore vendored
View File

@ -20,6 +20,7 @@
/package/openwrt-packages
/*.patch
/llvm-bpf*
/.vermagic
key-build*
private-key.pem
public-key.pem

View File

@ -1,3 +1,12 @@
iStoreOS 是入门级的路由系统,也是入门级的 NAS 系统,
基于原版 OpenWRT,在 ARS2 上经过长期迭代,最终开放适配到多个硬件平台
更多信息请参阅 https://github.com/istoreos
以下是 OpenWRT 原始的 README
--------
![OpenWrt logo](include/logo.png)
OpenWrt Project is a Linux operating system targeting embedded devices. Instead

View File

@ -247,7 +247,7 @@ menu "Target Images"
config GRUB_TITLE
string "Title for the menu entry in GRUB"
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
default "OpenWrt"
default "iStoreOS"
help
This is the title of the GRUB menu entry.
If unspecified, it defaults to OpenWrt.

View File

@ -1,4 +1,8 @@
src-git packages https://git.openwrt.org/feed/packages.git;openwrt-24.10
src-git luci https://git.openwrt.org/project/luci.git;openwrt-24.10
src-git routing https://git.openwrt.org/feed/routing.git;openwrt-24.10
src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-24.10
src-git packages https://github.com/jjm2473/packages.git;istoreos-24.10
src-git luci https://github.com/jjm2473/luci.git;istoreos-24.10
src-git routing https://github.com/openwrt/routing.git;openwrt-24.10
src-git telephony https://github.com/openwrt/telephony.git;openwrt-24.10
# istore
src-git store https://github.com/linkease/istore.git;main
# argon, etc.
src-git third https://github.com/jjm2473/openwrt-third.git;main

View File

@ -37,7 +37,7 @@ define FeedSourcesAppendOPKG
echo 'src/gz %d_core %U/targets/%S/packages'; \
$(strip $(if $(CONFIG_PER_FEED_REPO), \
echo 'src/gz %d_base %U/packages/%A/base'; \
$(if $(CONFIG_BUILDBOT), \
$(if y, \
echo 'src/gz %d_kmods %U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)';) \
$(foreach feed,$(FEEDS_AVAILABLE), \
$(if $(CONFIG_FEED_$(feed)), \
@ -51,7 +51,7 @@ define FeedSourcesAppendAPK
echo '%U/targets/%S/packages/packages.adb'; \
$(strip $(if $(CONFIG_PER_FEED_REPO), \
echo '%U/packages/%A/base/packages.adb'; \
$(if $(CONFIG_BUILDBOT), \
$(if y, \
echo '%U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)/packages.adb';) \
$(foreach feed,$(FEEDS_AVAILABLE), \
$(if $(CONFIG_FEED_$(feed)), \

View File

@ -184,4 +184,6 @@ define BuildKernel
prereq: image-prereq
image: $(LINUX_DIR)/.image
endef

View File

@ -127,7 +127,7 @@ define Kernel/Configure/Default
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev; \
}
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) $(if $(findstring uml,$(BOARD)),ARCH=$(ARCH)) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | $(MKHASH) md5 > $(LINUX_DIR)/.vermagic
[ -f $(TOPDIR)/.vermagic ] && cat $(TOPDIR)/.vermagic > $(LINUX_DIR)/.vermagic || grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | $(MKHASH) md5 > $(LINUX_DIR)/.vermagic
endef
define Kernel/Configure/Initramfs

View File

@ -216,6 +216,7 @@ define KernelPackage
EXTRA_DEPENDS:=kernel (=$(LINUX_VERSION)~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE))
VERSION:=$(LINUX_VERSION)$(if $(PKG_VERSION),.$(PKG_VERSION))-r$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE))
PKGFLAGS:=$(PKGFLAGS)
PKG_FLAGS:=hold
$(call KernelPackage/$(1))
$(call KernelPackage/$(1)/$(BOARD))
$(call KernelPackage/$(1)/$(BOARD)/$(SUBTARGET))

View File

@ -134,6 +134,10 @@ endif
# Add device specific packages (here below to allow device type set from subtarget)
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
ifneq ($(filter aarch64 x86_64,$(ARCH)),)
DEFAULT_PACKAGES += luci-app-store
endif
##@
# @brief Filter out packages, prepended with `-`.
#

View File

@ -183,6 +183,7 @@ ifneq ($(DISTRO_PKG_CONFIG),)
kernel_menuconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
kernel_nconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
kernel_xconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
kernel_image: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
endif
kernel_menuconfig: prepare_kernel_conf
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux menuconfig
@ -193,6 +194,9 @@ kernel_nconfig: prepare_kernel_conf
kernel_xconfig: prepare_kernel_conf
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux xconfig
kernel_image: prepare_kernel_conf
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux image
$(STAGING_DIR_HOST)/.prereq-build: include/prereq-build.mk
mkdir -p tmp
@$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \

View File

@ -23,16 +23,16 @@ PKG_CONFIG_DEPENDS += \
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10-SNAPSHOT)
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.0-rc4)
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10-SNAPSHOT)
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.0-rc4)
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),iStoreOS)
VERSION_DIST_SANITIZED:=$(call sanitize,$(VERSION_DIST))
VERSION_MANUFACTURER:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER))
@ -42,10 +42,10 @@ VERSION_MANUFACTURER_URL:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER_URL))
VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),https://openwrt.org/)
VERSION_BUG_URL:=$(call qstrip,$(CONFIG_VERSION_BUG_URL))
VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),https://bugs.openwrt.org/)
VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),https://github.com/istoreos/istoreos/issues)
VERSION_HOME_URL:=$(call qstrip,$(CONFIG_VERSION_HOME_URL))
VERSION_HOME_URL:=$(if $(VERSION_HOME_URL),$(VERSION_HOME_URL),https://openwrt.org/)
VERSION_HOME_URL:=$(if $(VERSION_HOME_URL),$(VERSION_HOME_URL),https://github.com/istoreos)
VERSION_SUPPORT_URL:=$(call qstrip,$(CONFIG_VERSION_SUPPORT_URL))
VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),https://forum.openwrt.org/)

View File

@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
PKG_FLAGS:=nonshared
PKG_FLAGS:=hold essential nonshared
PKG_RELEASE:=$(COMMITCOUNT)
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
@ -39,7 +39,8 @@ endif
define Package/base-files
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+netifd +libc +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool
DEPENDS:=+netifd +libc +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool \
+blkid +mount-utils +e2fsprogs +tune2fs +resize2fs +attr +block-mount
TITLE:=Base filesystem for OpenWrt
URL:=http://openwrt.org/
VERSION:=$(PKG_RELEASE)~$(lastword $(subst -, ,$(REVISION)))
@ -77,7 +78,7 @@ endef
define ImageConfigOptions
mkdir -p $(1)/lib/preinit
echo 'pi_suppress_stderr="$(CONFIG_TARGET_PREINIT_SUPPRESS_STDERR)"' >$(1)/lib/preinit/00_preinit.conf
echo 'fs_failsafe_wait_timeout=$(if $(CONFIG_TARGET_PREINIT_TIMEOUT),$(CONFIG_TARGET_PREINIT_TIMEOUT),4)' >>$(1)/lib/preinit/00_preinit.conf
echo 'fs_failsafe_wait_timeout=$(if $(CONFIG_TARGET_PREINIT_TIMEOUT),$(CONFIG_TARGET_PREINIT_TIMEOUT),2)' >>$(1)/lib/preinit/00_preinit.conf
echo 'pi_init_path="$(TARGET_INIT_PATH)"' >>$(1)/lib/preinit/00_preinit.conf
echo 'pi_init_env=$(if $(CONFIG_TARGET_INIT_ENV),$(CONFIG_TARGET_INIT_ENV),"")' >>$(1)/lib/preinit/00_preinit.conf
echo 'pi_init_cmd=$(if $(CONFIG_TARGET_INIT_CMD),$(CONFIG_TARGET_INIT_CMD),"/sbin/init")' >>$(1)/lib/preinit/00_preinit.conf
@ -211,6 +212,8 @@ define Package/base-files/install
mkdir -p -m 750 \
$(1)/root
touch $(1)/etc/config/ucitrack
$(LN) /proc/mounts $(1)/etc/mtab
$(if $(LIB_SUFFIX),-$(LN) lib $(1)/lib$(LIB_SUFFIX))
$(if $(LIB_SUFFIX),-$(LN) lib $(1)/usr/lib$(LIB_SUFFIX))
@ -227,6 +230,9 @@ endif
chmod 0600 $(1)/etc/shadow
chmod 1777 $(1)/tmp
$(LN) /tmp/run $(1)/run
mkdir -p $(1)/ext_overlay
$(call ImageConfigOptions,$(1))
$(call Package/base-files/install-target,$(1))
for conffile in $(1)/etc/config/*; do \

View File

@ -2,7 +2,7 @@
CFG=/etc/board.json
. /usr/share/libubox/jshn.sh
. /lib/functions/system.sh
[ -s $CFG ] || /bin/board_detect || exit 1
[ -s /etc/config/network -a -s /etc/config/system ] && exit 0
@ -123,6 +123,7 @@ generate_network() {
set network.@device[-1].name='$port'
set network.@device[-1].macaddr='$macaddr'
EOF
macaddr=$(macaddr_add "$macaddr" 2)
done
}
device=br-$1
@ -216,6 +217,13 @@ generate_network() {
set network.$1.pdptype='ipv4'
EOF
;;
*)
uci -q batch <<-EOF
set network.$1.proto='${protocol}'
set network.$1.auto='0'
EOF
;;
esac
}

View File

@ -1,8 +1,11 @@
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
▀ ▄▄▄▄ ▄ ▄▄▄▄ ▄▄▄▄
▄▄▄ █▀ ▀ ▄▄█▄▄ ▄▄▄ ▄ ▄▄ ▄▄▄ ▄▀ ▀▄ █▀ ▀
█ ▀█▄▄▄ █ █▀ ▀█ █▀ ▀ █▀ █ █ █ ▀█▄▄▄
█ ▀█ █ █ █ █ █▀▀▀▀ █ █ ▀█
▄▄█▄▄ ▀▄▄▄█▀ ▀▄▄ ▀█▄█▀ █ ▀█▄▄▀ █▄▄█ ▀▄▄▄█▀
Powered by OpenWRT
-------------------------------------------------------
%D %V, %C
-----------------------------------------------------
-------------------------------------------------------

View File

@ -48,6 +48,8 @@ boot() {
sleep 1
}
[ -x /lib/board/init.sh ] && /lib/board/init.sh
mkdir -p /tmp/.uci
[ -f /etc/uci-defaults/30_uboot-envtools ] && (. /etc/uci-defaults/30_uboot-envtools)
/bin/config_generate

View File

@ -26,10 +26,12 @@ stop() {
}
hwclock_load() {
[ -e "/dev/rtc" ] && RTC_DEV=/dev/rtc
[ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -s -u -f $RTC_DEV
}
hwclock_save(){
[ -e "/dev/rtc" ] && RTC_DEV=/dev/rtc
[ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -w -u -f $RTC_DEV && \
logger -t sysfixtime "saved '$(date)' to $RTC_DEV"
}

View File

@ -0,0 +1,57 @@
#!/bin/sh /etc/rc.common
START=80
USE_PROCD=1
register_init() {
local config="$1"
local init="$2"
shift; shift
if [ -x "$init" ] && "$init" enabled && ! grep -sqE 'USE_PROCD=.' "$init"; then
logger -t "ucitrack_compat" "Setting up /etc/config/$config reload trigger for non-procd $init"
procd_add_config_trigger "config.change" "$config" "$init" "$@"
fi
}
register_trigger() {
local sid="$1"
local config init exec affects affected
config_get config "$sid" TYPE
config_get init "$sid" init
config_get exec "$sid" exec
config_get affects "$sid" affects
if [ -n "$init" ]; then
register_init "$config" "/etc/init.d/$init" "reload"
fi
if [ -n "$exec" ]; then
case "$exec" in
/etc/init.d/*)
set -- $exec
register_init "$config" "$@"
;;
*)
logger -t "ucitrack_compat" "Setting up non-init /etc/config/$config reload handler: $exec"
procd_add_config_trigger "config.change" "$config" $exec
;;
esac
fi
for affected in $affects; do
logger -t "ucitrack_compat" "Setting up /etc/config/$affected reload dependency on /etc/config/$config"
procd_add_config_trigger "config.change" "$config" \
ubus call service event \
"$(printf '{"type":"config.change","data":{"package":"%s"}}' $affected)"
done
}
service_triggers() {
config_foreach register_trigger
}
start_service() {
config_load ucitrack
}

View File

@ -23,7 +23,7 @@ released)
elif [ "$SEEN" -ge 5 -a -n "$OVERLAY" ]
then
echo "FACTORY RESET" > /dev/console
jffs2reset -y && reboot &
firstboot -y && reboot &
fi
;;
esac

View File

@ -0,0 +1,16 @@
[ "$(uci -q get network.lan)" = "interface" ] || exit 0
[ -z "$(uci -q get network.lan.gateway)" ] || exit 0
[ "$(uci -q get network.wan.proto)" = "dhcp" ] || exit 0
[ "$(uci -q get network.wan6)" = "interface" ] || exit 0
uci -q batch <<-EOF >/dev/null
delete network.lan.ip6class
add_list network.lan.ip6class='wan6'
add_list network.lan.ip6class='wan_6'
add_list network.lan.ip6class='wan'
commit network
EOF
exit 0

View File

@ -346,6 +346,7 @@ default_postinst() {
local filelist="${root}/usr/lib/opkg/info/${pkgname}.list"
[ -f "$root/lib/apk/packages/${pkgname}.list" ] && filelist="$root/lib/apk/packages/${pkgname}.list"
local ret=0
local ucitrack_before
if [ -e "${root}/usr/lib/opkg/info/${pkgname}.list" ]; then
filelist="${root}/usr/lib/opkg/info/${pkgname}.list"
@ -357,6 +358,9 @@ default_postinst() {
update_alternatives install "${pkgname}"
fi
[ -z "$root" ] && grep -m1 -q -s "^/etc/uci-defaults/" "$filelist" && \
ucitrack_before=`{ md5sum /etc/config/ucitrack 2>/dev/null || echo "empty"; } | cut -d ' ' -f 1`
if [ -d "$root/rootfs-overlay" ]; then
cp -R $root/rootfs-overlay/. $root/
rm -fR $root/rootfs-overlay/
@ -371,7 +375,7 @@ default_postinst() {
/etc/init.d/sysctl restart
fi
if grep -m1 -q -s "^/etc/uci-defaults/" "$filelist"; then
if [ -n "$ucitrack_before" ]; then
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
for i in $(grep -s "^/etc/uci-defaults/" "$filelist"); do
( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i"
@ -379,7 +383,17 @@ default_postinst() {
uci commit
fi
rm -f /tmp/luci-indexcache
if grep -m1 -q -s "^/usr/share/rpcd/acl\\.d/" "$filelist"; then
/etc/init.d/rpcd reload
fi
if grep -m1 -q -s "^/usr/lib/lua/luci/" "$filelist"; then
if grep -m1 -q -s "^/usr/lib/lua/luci/i18n/" "$filelist"; then
/etc/init.d/fix_luci_lang boot
touch /tmp/luci-i18n-mtime
fi
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache /tmp/luci-indexcache.*
fi
fi
if [ -f "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ]; then
@ -399,6 +413,13 @@ default_postinst() {
fi
done
if [ -n "$ucitrack_before" ]; then
local after=`{ md5sum /etc/config/ucitrack 2>/dev/null || echo "empty"; } | cut -d ' ' -f 1`
if [ "x$after" != "x$ucitrack_before" ]; then
/etc/init.d/ucitrack_compat reload
fi
fi
return $ret
}

View File

@ -0,0 +1,118 @@
# > getbootdisk
# mmcblk0
_getbootdisk()
{
local rootpart="`grep -Fm1 ' - squashfs /dev/root ' /proc/self/mountinfo | cut -d' ' -f3`"
[ -z "$rootpart" ] && return 1
local devpath="`readlink /sys/dev/block/$rootpart`"
[ -z "$devpath" ] && return 1
rootpart="${devpath##*/}"
devpath="${devpath%%/$rootpart}"
local rootdisk="${devpath##*/}"
echo "$rootdisk"
}
# > getbootdisk_lvm
# dm-0
_getbootdisk_lvm()
{
local rootpart
if [ -e /rom/note ]; then
rootpart="`grep -Fm1 ' / / ' /proc/self/mountinfo | grep -F ' - squashfs ' | cut -d' ' -f3`"
else
rootpart="`grep -Fm1 ' / /rom ' /proc/self/mountinfo | grep -F ' - squashfs ' | cut -d' ' -f3`"
fi
[ -z "$rootpart" ] && return 1
local major=${rootpart%%:*}
local minor=${rootpart##*:}
minor="$(( $minor & 0xfffc ))"
local devpath="`readlink /sys/dev/block/$major:$minor`"
[ -z "$devpath" ] && return 1
local rootdisk="${devpath##*/}"
echo "$rootdisk"
}
# > getpartofdisk sda 3
# sda3
# > getpartofdisk mmcblk0 3
# mmcblk0p3
_getpartofdisk()
{
local disk="$1" offset="$2" part
if [[ "$offset" = 0 ]]; then
echo "$disk"
else
part="$disk"
echo "$part" | grep -q '^.*[0-9]$' && part="${part}p"
part="${part}"$(( ${offset} ))
if [ ! -b "/dev/$part" ]; then
# lvm
local line
local MAJOR MINOR DEVNAME DEVTYPE
while read line; do
export -n "$line"
done < "/sys/block/$disk/uevent"
local devpath="`readlink /sys/dev/block/$MAJOR:$(($MINOR + $offset))`"
if [ -n "$devpath" ]; then
part="${devpath##*/}"
fi
fi
echo "$part"
fi
return 0
}
_get_overlay_partition_default()
{
local bootdisk="`_getbootdisk`"
[ -z "$bootdisk" ] && {
log "getbootdisk failed, try lvm"
bootdisk="`_getbootdisk_lvm`"
}
[ -z "$bootdisk" ] && {
log "getbootdisk_lvm failed"
return 1
}
if [ ! -e "/sys/block/$bootdisk/uevent" ]; then
log "/sys/block/$bootdisk/uevent does not exist"
return 1
fi
if [ -e /rom/note ]; then
# we are in mount_root if /rom/note exists
cat "/sys/block/$bootdisk/uevent" > /tmp/.bootdisk
fi
local overlay_dev="`_getpartofdisk $bootdisk 3`"
[ -z "$overlay_dev" ] && {
log "getpartofdisk $bootdisk 3 failed"
return 1
}
OVERLAY_DEV="/dev/$overlay_dev"
return 0
}
_get_overlay_partition_fallback()
{
log "get_overlay_partition_fallback"
rm -f /tmp/.bootdisk >/dev/null 2>&1
local overlay_dev=$(
. /lib/functions.sh
. /lib/upgrade/common.sh
export_bootdevice && export_partdevice overlay_dev 3 && echo $overlay_dev
)
[ -z "$overlay_dev" ] && return 1
OVERLAY_DEV="/dev/$overlay_dev"
return 0
}
get_overlay_partition()
{
[ -e /.dockerenv ] && {
log "No overlay partition in Docker"
return 1
}
_get_overlay_partition_default || _get_overlay_partition_fallback || {
log "Unable to determine overlay partition"
return 1
}
return 0
}

View File

@ -67,6 +67,7 @@ _v() {
v() {
_v "$(date) upgrade: $@"
[ "$SAVE_LOG" = "1" ] && echo "$@" >>/overlay/upgrade.log
logger -p info -t upgrade "$@"
}
@ -168,6 +169,16 @@ part_magic_fat() {
export_bootdevice() {
local cmdline uuid blockdev uevent line class
local MAJOR MINOR DEVNAME DEVTYPE
if [ -f /tmp/.bootdisk ]; then
while read line; do
export -n "$line"
done < /tmp/.bootdisk
export BOOTDEV_MAJOR=$MAJOR
export BOOTDEV_MINOR=$MINOR
export BOOTDEV_DEVNAME=$DEVNAME
return 0
fi
local rootpart="$(cmdline_get_var root)"
case "$rootpart" in
@ -218,6 +229,7 @@ export_bootdevice() {
done < "$uevent"
export BOOTDEV_MAJOR=$MAJOR
export BOOTDEV_MINOR=$MINOR
export BOOTDEV_DEVNAME=$DEVNAME
return 0
fi
@ -225,18 +237,27 @@ export_bootdevice() {
}
export_partdevice() {
local var="$1" offset="$2"
local uevent line MAJOR MINOR DEVNAME DEVTYPE
for uevent in /sys/class/block/*/uevent; do
while read line; do
export -n "$line"
done < "$uevent"
if [ "$BOOTDEV_MAJOR" = "$MAJOR" -a $(($BOOTDEV_MINOR + $offset)) = "$MINOR" -a -b "/dev/$DEVNAME" ]; then
export "$var=$DEVNAME"
local var="$1" offset="$2" part
offset=$(( ${offset} ))
if [[ "$offset" = 0 ]]; then
export "$var=$BOOTDEV_DEVNAME"
return 0
else
part="$BOOTDEV_DEVNAME"
echo "$part" | grep -q '^.*[0-9]$' && part="${part}p"
part="${part}${offset}"
if [ -b "/dev/$part" ]; then
export "$var=$part"
return 0
else
# ventoy
local devpath="`readlink /sys/dev/block/$BOOTDEV_MAJOR:$(($BOOTDEV_MINOR + $offset))`"
[ -n "$devpath" ] && {
export "$var=${devpath##*/}"
return 0
}
fi
fi
done
return 1
}

View File

@ -16,6 +16,12 @@ if [ -n "$UPGRADE_BACKUP" ] && type 'platform_copy_config' >/dev/null 2>/dev/nul
fi
v "Upgrade completed"
grep /overlay /proc/mounts > /dev/null && {
/bin/mount -o noatime,remount,ro /overlay
/usr/bin/umount -R -d -l /overlay 2>/dev/null || /bin/umount -l /overlay
}
sleep 1
v "Rebooting system..."

View File

@ -18,17 +18,19 @@ include /lib/upgrade
supivot() { # <new_root> <old_root>
/bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1
mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \
/bin/mount -o noatime,move /proc $1/proc && \
mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay $1/ext_overlay && \
/bin/mount -o noatime,rbind /proc $1/proc && \
pivot_root $1 $1$2 || {
/bin/umount -l $1 $1
return 1
}
/bin/mount -o noatime,move $2/sys /sys
/bin/mount -o noatime,move $2/dev /dev
/bin/mount -o noatime,move $2/tmp /tmp
/bin/mount -o noatime,move $2/sys /sys || /bin/mount -o noatime,rbind $2/sys /sys
/bin/mount -o noatime,move $2/dev /dev || /bin/mount -o noatime,rbind $2/dev /dev
/bin/mount -o noatime,move $2/tmp /tmp || /bin/mount -o noatime,bind $2/tmp /tmp
/bin/mount -o noatime,move $2/overlay /overlay 2>&-
/bin/mount -o noatime,move $2/ext_overlay /ext_overlay 2>&-
/bin/umount -l $2/proc $2/sys $2/dev $2/tmp $2/overlay $2/ext_overlay 2>&-
return 0
}
@ -62,6 +64,14 @@ switch_to_ramfs() {
[ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64
# avoid shared rootfs, which makes `/bin/mount -o noatime,move * *` fail
# https://github.com/istoreos/istoreos/issues/1200
mount --make-private / 2>&-
mount --make-private /tmp 2>&-
mount --make-private /mnt 2>&-
mount --make-private /overlay 2>&-
mount --make-private /ext_overlay 2>&-
supivot $RAM_ROOT /mnt || {
v "Failed to switch over to ramfs. Please reboot."
exit 1
@ -79,11 +89,6 @@ switch_to_ramfs() {
mkdir -p /tmp/lvm/cache
$RAMFS_COPY_LVM vgchange -aln --ignorelockingfailure
}
grep /overlay /proc/mounts > /dev/null && {
/bin/mount -o noatime,remount,ro /overlay
/bin/umount -l /overlay
}
}
kill_remaining() { # [ <signal> [ <loop> ] ]
@ -132,6 +137,50 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
done
}
istoreos_pre_upgrade() {
if [ -n "$UPGRADE_BACKUP" ]; then
touch /usr/lib/opkg/.upgrading 2>/dev/null && sync /
# reset rom uuid in ext_overlay
if [ -e /ext_overlay/etc ]; then
[ -f /ext_overlay/upper/usr/lib/opkg/.upgrading ] || {
rm -f /ext_overlay/upper/usr/lib/opkg/.upgrading
mkdir -p /ext_overlay/upper/usr/lib/opkg
touch /ext_overlay/upper/usr/lib/opkg/.upgrading 2>/dev/null
}
touch /ext_overlay/.upgrading
[ -f /ext_overlay/upper/usr/lib/opkg/.upgrading ] && rm -f /ext_overlay/etc/.extroot-uuid
sync /ext_overlay
fi
[ -f /overlay/upper/usr/lib/opkg/.upgrading ] || {
rm -f /overlay/upper/usr/lib/opkg/.upgrading
mkdir -p /overlay/upper/usr/lib/opkg
touch /overlay/upper/usr/lib/opkg/.upgrading 2>/dev/null
touch /overlay/.upgrading
sync /overlay
}
fi
}
istoreos_show_new_firmware_version() {
local dist version revision
json_load "$(cat /tmp/sysupgrade.meta)" || {
return 1
}
json_select "version"
json_get_var dist "dist"
json_get_var version "version"
json_get_var revision "revision"
v "Flashing Version: '$dist $version $revision'"
}
date '+%Y-%m-%d %H:%M:%S' >/overlay/upgrade.log
export SAVE_LOG=1
v "Running Version: $(grep DISTRIB_DESCRIPTION= /etc/openwrt_release | cut -d= -f2)"
if [ -s /tmp/sysupgrade.meta ]; then
(istoreos_show_new_firmware_version)
fi
indicate_upgrade
while read -r a b c; do
@ -156,20 +205,36 @@ killall -9 ash 2>/dev/null
kill_remaining TERM
sleep 4
sync
kill_remaining KILL 1
sleep 6
echo 3 > /proc/sys/vm/drop_caches
[ -n "$IMAGE" ] && istoreos_pre_upgrade
if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
platform_pre_upgrade "$IMAGE"
fi
if [ -n "$(rootfs_type)" ]; then
ROOTFS_TYPE=$(rootfs_type)
if [ -n "$ROOTFS_TYPE" -a "$ROOTFS_TYPE" != "tmpfs" -a "$ROOTFS_TYPE" != "rootfs" ]; then
v "Switching to ramdisk..."
switch_to_ramfs
fi
grep /ext_overlay /proc/mounts > /dev/null && {
/bin/mount -o noatime,remount,ro /ext_overlay
/usr/bin/umount -R -d -l /ext_overlay 2>/dev/null || /bin/umount -l /ext_overlay
}
if [ -z "$UPGRADE_BACKUP" ]; then
grep /overlay /proc/mounts > /dev/null && {
/bin/mount -o noatime,remount,ro /overlay
/usr/bin/umount -R -d -l /overlay 2>/dev/null || /bin/umount -l /overlay
}
fi
# Exec new shell from ramfs
exec /bin/busybox ash -c "$COMMAND"

View File

@ -1,3 +1,92 @@
#!/bin/sh
# Copyright (C) 2022 jjm2473@gmail.com
/sbin/jffs2reset $@
DEFAULT_OVERLAY_FS="ext4"
OVERLAY_LABEL="etc"
OVERLAY_FS=${DEFAULT_OVERLAY_FS}
OVERLAY_DEV=
log() {
echo "$1" >&2
}
inlog() {
$@ >&2
}
. /lib/functions/istoreos-boot.sh
CONFIRM=n
REBOOT=n
confirm()
{
[ "$1" = "y" ] && return 0
echo "This will erase all settings and remove any installed packages. Are you sure? [N/y]"
read CONFIRM
[ "$CONFIRM" = "y" -o "$CONFIRM" = "Y" ] && return 0
return 1
}
do_reset_nofs()
{
get_overlay_partition || exit 1
if [ -z "$OVERLAY_DEV" ]; then
echo "Unable to determine overlay partition" >&2
return 1
fi
if [ "RESET" = "$FSTYPE" ]; then
echo "Already resetted" >&2
return 1
fi
# if ! blkid -o device -t LABEL=$OVERLAY_LABEL "$OVERLAY_DEV" >/dev/null; then
# echo "Overlay partition $OVERLAY_DEV not labeled $OVERLAY_LABEL" >&2
# return 1
# fi
echo "RESET000" | dd of="$OVERLAY_DEV" bs=512 count=1 conv=notrunc,sync,fsync 2>/dev/null
echo 3 > /proc/sys/vm/drop_caches
return 0
}
do_reset_ext_overlay()
{
[ -d /ext_overlay ] && mountpoint -q /ext_overlay || return 0
rm -f /ext_overlay/etc/.extroot-uuid
touch /ext_overlay/.reset
sync /ext_overlay
}
do_reset()
{
if [ -f /.recovery_mode ]; then
mount_root || ( echo "/overlay mount failed!" ; exit 1 )
rm -rf /overlay/upper
mkdir /overlay/upper
sync /overlay
else
do_reset_nofs
do_reset_ext_overlay
fi
if [ -f /lib/upgrade/keep.d/grub ]; then
cat /lib/upgrade/keep.d/grub | while read; do
rm -f "$REPLY"
done
fi
[ "$REBOOT" = "y" ] && reboot
exit 0
}
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-y) CONFIRM=y ;;
-r) REBOOT=y ;;
esac
shift
done
confirm $CONFIRM && do_reset
exit 0

View File

@ -0,0 +1,425 @@
#!/bin/sh
# Copyright (C) 2010 OpenWrt.org
# Copyright (C) 2020-2023 jjm2473@gmail.com
DEFAULT_OVERLAY_FS="ext4"
OVERLAY_LABEL="etc"
OVERLAY_FS=${DEFAULT_OVERLAY_FS}
OVERLAY_DEV=
log() {
echo "<1>mount_root: $1" >/dev/kmsg
}
inlog() {
$@ >/dev/kmsg 2>&1
}
. /lib/functions/istoreos-boot.sh
validate_overlay_partition()
{
log "- mount overlayfs -"
# Check device existence
[ ! -e "$OVERLAY_DEV" ] && \
log "overlay: $OVERLAY_DEV not found" && return 1
[ -n "$FSTYPE" ] && return 0
# get filesystem
if dd if="$OVERLAY_DEV" bs=5 count=1 2>/dev/null | grep -qF RESET; then
FSTYPE=RESET
log "overlay: $OVERLAY_DEV marked as RESET, format later"
return 0
elif blkid -o device -t LABEL=$OVERLAY_LABEL "$OVERLAY_DEV" >/dev/null; then
FSTYPE=`blkid -o value -s TYPE $OVERLAY_DEV`
else
FSTYPE=RESET
log "overlay: $OVERLAY_DEV not labeled, format later"
return 0
fi
if [ -z "$FSTYPE" ]; then
log "overlay: no valid filesystem"
else
log "overlay: filesystem $FSTYPE found"
fi
}
format_overlay_partition()
{
local RET
[ "$FSTYPE" = "$OVERLAY_FS" ] && return 0
log "overlay: try to format $OVERLAY_DEV as $OVERLAY_FS partition"
case "$OVERLAY_FS" in
ext4)
mkfs.ext4 -q -j -FF -L $OVERLAY_LABEL "$OVERLAY_DEV"
RET=$?
[ $RET -ne 0 ] || tune2fs -o '^user_xattr,^acl' -r 1024 "$OVERLAY_DEV"
;;
*)
log "overlay: unhandled fs type : $OVERLAY_FS"
RET=1
;;
esac
if [ $RET -ne 0 ]; then
log "overlay: format command failed ret: $RET"
else
echo 3 > /proc/sys/vm/drop_caches
FSTYPE=$OVERLAY_FS
fi
return $RET
}
check_overlay_partition()
{
case "$FSTYPE" in
ext4)
fsck.ext4 -y "$OVERLAY_DEV" >/dev/null
sync
resize2fs "$OVERLAY_DEV"
sync
;;
esac
}
mount_overlay_partition()
{
local RET
mount -t $OVERLAY_FS "$OVERLAY_DEV" /overlay
RET=$?
[ $RET -ne 0 ] && \
log "overlay: failed to mount $OVERLAY_DEV as $OVERLAY_FS partition ret: $RET" && return $RET
log 'overlay: successfully mounted'
}
OVERLAYFS_XATTR=""
is_overlayfs_use_xattr() {
# only linux 4.13 or above
[ -z "$OVERLAYFS_XATTR" ] && OVERLAYFS_XATTR=$([ "0$((`uname -r | cut -d. -f1-2 | sed 's/\./ * 100 + /'`))" -ge 413 ] && echo 1 || echo 0)
[ "$OVERLAYFS_XATTR" = "1" ]
}
ROOTFS_UUID=""
rootfs_uuid() {
if [ -z "$ROOTFS_UUID" ]; then
ROOTFS_UUID=`block info | grep -Fw 'MOUNT="/"' | sed -E 's/.* UUID="([^"]+)" .*/\1/'`
[ -z "$ROOTFS_UUID" ] && ROOTFS_UUID="UNKNOWN"
fi
echo "$ROOTFS_UUID"
}
update_overlay_lower_uuid() {
local realuuid=`rootfs_uuid`
local lastuuid="NULL"
if [ -f "$1/.rootfs-uuid" ]; then
lastuuid=`cat "$1/.rootfs-uuid"`
fi
if [ "$realuuid" != "$lastuuid" ]; then
echo "$realuuid" >"$1/.rootfs-uuid"
return 0
fi
return 1
}
clean_overlayfs_origin() {
local line
cd "$1"
getfattr -R -P -h --match='trusted.overlay.origin' . 2>/dev/null | grep '^# file: ' | cut -c9- | while read; do
line="$REPLY"
setfattr -x "trusted.overlay.origin" -h "$line" 2>/dev/null
done
cd - >/dev/null 2>&1
}
clean_overlayfs_redundant_whiteout_marker()
{
local line
cd "$1"
find upper -xdev -path 'upper/opt' -prune ! -type d -o -type c -perm 0 -user 0 -group 0 | sed 's#^upper/#/#g' | while read; do
line="$REPLY"
[ ! -e "$line" -a \( -z "$2" -o ! -e "$2/upper$line" \) ] && \
busybox ls -l "upper$line" | grep -Fq 'c--------- 1 root root 0, 0 ' && \
rm -f "upper$line"
done
cd - >/dev/null 2>&1
}
clean_overlayfs_redundant_whiteout_marker_luci()
{
local line
[ -d "$1/upper/usr/lib/lua/luci" ] || return 0
cd "$1/upper/usr/lib/lua"
find luci -xdev -type c -perm 0 -user 0 -group 0 | while read; do
line="$REPLY"
[ ! -e "/usr/lib/lua/$line" -a \( -z "$2" -o ! -e "$2/upper/usr/lib/lua/$line" \) ] && \
busybox ls -l "$line" | grep -Fq 'c--------- 1 root root 0, 0 ' && \
rm -f "$line"
done
cd - >/dev/null 2>&1
}
clean_os_version_files()
{
cd "$1"
rm -f upper/etc/openwrt_release \
upper/etc/openwrt_version \
upper/usr/lib/os-release
cd - >/dev/null 2>&1
}
clean_kmods()
{
local DUMMY_VERSION=0.0.0-r1
if [ -d "$1/upper/usr/lib/opkg/info" ]; then
local compat=`grep -m1 '^Version: ' /usr/lib/opkg/info/kernel.control | sed 's/^Version: //'`
if [ -n "$compat" ]; then
cd "$1/upper/usr/lib/opkg/info"
# ignore processed
grep -Lm1 '^Version: '$DUMMY_VERSION'$' kmod-*.control 2>/dev/null | sed 's/.control$//' > /tmp/cand_kmods.txt
if [ -s /tmp/cand_kmods.txt ]; then
grep -LFm1 "kernel (=$compat)" kmod-*.control | sed 's/.control$//' | grep -Fxf /tmp/cand_kmods.txt > /tmp/del_kmods.txt
grep -lFm1 "kernel (=$compat)" kmod-*.control | sed 's/.control$//' | grep -Fxf /tmp/cand_kmods.txt > /tmp/safe_kmods.txt
else
> /tmp/del_kmods.txt
fi
rm -f /tmp/cand_kmods.txt
# remove duplicated
if [ -s /tmp/safe_kmods.txt ]; then
( cd /usr/lib/opkg/info && ls kmod-*.control 2>/dev/null | sed 's/.control$//' ) | grep -Fxf /tmp/safe_kmods.txt >> /tmp/del_kmods.txt
fi
rm -f /tmp/safe_kmods.txt
if [ -s /tmp/del_kmods.txt ]; then
log "Clean kmods in $1: `cat /tmp/del_kmods.txt | xargs echo`"
cat /tmp/del_kmods.txt | sed 's/$/.list/' | xargs cat | sed "s#^/#$1/upper/#" | xargs -r rm -f
cat /tmp/del_kmods.txt | xargs -rn1 sh -c 'rm -f $0.list $0.prerm $0.postinst'
cat /tmp/del_kmods.txt | sed 's/$/.control/' | xargs -r sed -i 's/^Version: .*$/Version: '$DUMMY_VERSION'/g'
fi
rm -f /tmp/del_kmods.txt
cd - >/dev/null 2>&1
return 0
fi
else
return 0
fi
# rm -rf $1/upper/lib/modules $1/upper/etc/modules-boot.d \
# $1/upper/etc/modules.d $1/upper/usr/lib/opkg/info/kmod-* \
# $1/upper/usr/lib/opkg/info/kernel.* 2>/dev/null
}
prepare_primary_overlay()
{
if [ -f /overlay/.reset ]; then
rm -rf /overlay/upper /overlay/work
rm -f /overlay/.reset
sync /overlay
else
if [ -d /overlay/upper ] ; then
if update_overlay_lower_uuid /overlay || [ -f /overlay/.upgrading ] ; then
clean_os_version_files /overlay
is_overlayfs_use_xattr && clean_overlayfs_origin /overlay/upper
clean_overlayfs_redundant_whiteout_marker /overlay
else
clean_overlayfs_redundant_whiteout_marker_luci /overlay
fi
else
update_overlay_lower_uuid /overlay
fi
if [ -f /overlay/upper/usr/lib/opkg/.upgrading ]; then
clean_kmods /overlay
fi
fi
rm -f /overlay/.upgrading
mkdir -p /overlay/upper /overlay/work
}
pivot_root_to_overlayfs()
{
# pivot
mount --move /proc /mnt/proc
pivot_root /mnt /mnt/rom || return 1
mount --move /rom/dev /dev
mount --move /rom/tmp /tmp
mount --move /rom/sys /sys
mount --move /rom/overlay /overlay
}
mount_extroot()
{
[ -f /overlay/upper/etc/config/fstab ] || return 1
# let `block extroot` read /overlay/upper/etc/config/fstab
mount --bind /overlay/upper/etc/config /etc/config || return 1
block extroot
local ret=$?
umount /etc/config
return $ret
}
apply_overlayfs_opaque() {
local line
local dest="$2"
cd "$1"
if is_overlayfs_use_xattr; then
getfattr -R -P -h --match='trusted.overlay.opaque' upper 2>/dev/null | grep '^# file: ' | cut -c9- | while read; do
line="$REPLY"
rm -rf "$dest/$line"
done
fi
find upper -xdev -type c | while read; do
line="$REPLY"
rm -rf "$dest/$line"
done
cd - >/dev/null 2>&1
}
prepare_ext_overlay()
{
local newoverlaydir=$1
local overlaydir=$2
if [ -f "$newoverlaydir/.reset" ]; then
rm -rf "$newoverlaydir/upper"
rm -f "$newoverlaydir/.commit" "$newoverlaydir/.reset"
else
if [ -f "$newoverlaydir/upper/usr/lib/opkg/.upgrading" ]; then
clean_kmods "$newoverlaydir"
fi
# should change to $newoverlaydir/.upgrading
if [ -f "$newoverlaydir/upper/usr/lib/opkg/.upgrading" ]; then
clean_os_version_files "$newoverlaydir"
is_overlayfs_use_xattr && clean_overlayfs_origin "$newoverlaydir/upper"
fi
if [ -f "$newoverlaydir/.commit" ]; then
if [ -d "$newoverlaydir/upper" ]; then
apply_overlayfs_opaque "$newoverlaydir" "$overlaydir"
fi
cp -a "$newoverlaydir/upper/." "$overlaydir/upper" && {
rmdir "$overlaydir/upper/ext_overlay"
clean_overlayfs_redundant_whiteout_marker "$overlaydir"
rm -rf "$newoverlaydir/upper"
mkdir -m 0755 -p "$newoverlaydir/upper/ext_overlay"
}
rm -f "$newoverlaydir/.commit"
elif [ -d "$newoverlaydir/upper" -a \( -f "$newoverlaydir/upper/usr/lib/opkg/.upgrading" -o ! -f "$overlaydir/.sandbox" \) ]; then
clean_overlayfs_redundant_whiteout_marker "$newoverlaydir" "$overlaydir"
else
clean_overlayfs_redundant_whiteout_marker_luci "$newoverlaydir" "$overlaydir"
fi
fi
rm -f "$newoverlaydir/.upgrading"
( mkdir -m 0755 -p $newoverlaydir/upper/ext_overlay && \
mkdir -m 0755 -p $newoverlaydir/work ) || return 1
return 0
}
prepare_mnt()
{
local dir
if mount_extroot && mountpoint -q /tmp/extroot/mnt; then
for dir in proc dev tmp sys overlay rom root; do
mkdir -m 0755 /tmp/extroot/mnt/$dir
done
if mount --move /tmp/extroot/mnt /mnt; then
# writeable extroot existed, we don't need overlay
umount /tmp/extroot/overlay
return 0
fi
umount /tmp/extroot/mnt
fi
local lowerdir=/
local overlaydir=/overlay
if mountpoint -q /tmp/extroot/overlay; then
# use ext overlay as upper layer
local newoverlaydir=/tmp/extroot/overlay
if [ `mountpoint -x "$OVERLAY_DEV"` != `mountpoint -d $newoverlaydir` ] && \
prepare_ext_overlay $newoverlaydir $overlaydir && \
mount --move /tmp/extroot/overlay /ext_overlay; then
lowerdir=$overlaydir/upper:$lowerdir
overlaydir=/ext_overlay
else
umount /tmp/extroot/overlay
fi
fi
mount -o noatime,lowerdir=$lowerdir,upperdir=$overlaydir/upper,workdir=$overlaydir/work \
-t overlay "overlayfs:/overlay" /mnt \
|| return 1
if [ "$overlaydir" = "/ext_overlay" ]; then
[ -f "/overlay/.sandbox" ] || touch "/overlay/.sandbox"
else
rm -f "/overlay/.sandbox"
fi
sync
return 0
}
post_extroot()
{
mountpoint -q /rom/ext_overlay && mount --move /rom/ext_overlay /ext_overlay
mountpoint -q /tmp/extroot/overlay && umount /tmp/extroot/overlay
rmdir /tmp/extroot/overlay
mountpoint -q /tmp/extroot/mnt && umount /tmp/extroot/mnt
rmdir /tmp/extroot/mnt
rmdir /tmp/extroot
mountpoint -q /rom/dev && umount /rom/dev
}
do_mount_overlayfs()
{
[ ! -e /rom/note ] && return 0
inlog get_overlay_partition || return 1
inlog validate_overlay_partition || return 1
inlog format_overlay_partition || return 1
inlog check_overlay_partition
inlog mount_overlay_partition || return 1
# if we are in recovery mode, just skip pivot_root
if [ -f /.recovery_mode ]; then
rm -f /rom/note >/dev/null 2>&1
return 0
fi
inlog prepare_primary_overlay
inlog prepare_mnt || return 1
inlog pivot_root_to_overlayfs || return 1
post_extroot >/dev/null 2>&1
inlog mount --make-shared -t tmpfs -o size=4M tmpfs /mnt
return 0
}
[ -n "$1" -a "$1" != "start" ] || ( do_mount_overlayfs && exit 0 )

View File

@ -0,0 +1,69 @@
#!/bin/sh
# Copyright (C) 2022 jjm2473@gmail.com
action=${1}
shift
disable_if_sandbox()
{
local enabled
local target
config_get target $1 "target" "/tmp/null"
[ "$target" = "/overlay" ] || return
config_get_bool enabled $1 "enabled" "0"
[ "$enabled" = 1 ] && uci_set fstab $1 "enabled" "0"
}
disable_all_sandbox()
{
. /lib/functions.sh
uci_load "fstab"
config_foreach disable_if_sandbox mount
uci_commit "fstab"
}
exit_sandbox()
{
UCI_CONFIG_DIR=/overlay/upper/etc/config disable_all_sandbox
}
reset_sandbox()
{
touch /ext_overlay/.reset && sync /ext_overlay
}
commit_sandbox()
{
touch /ext_overlay/.commit && sync /ext_overlay
}
usage() {
echo "Usage: sandbox sub-command"
echo "where sub-command is one of:"
echo " reset Reset sandbox"
echo " commit Commit sandbox"
echo " exit Exit sandbox"
}
if grep '^overlayfs:/overlay / ' /proc/mounts | grep -Fq 'upperdir=/ext_overlay/upper'; then
case $action in
"reset")
reset_sandbox
;;
"commit")
commit_sandbox
;;
"exit")
exit_sandbox
;;
"status")
exit 0
;;
*)
usage >&2
exit 1
;;
esac
else
echo "Not sandbox environment" >&2
exit 1
fi

View File

@ -44,7 +44,7 @@ config TARGET_PREINIT_DISABLE_FAILSAFE
config TARGET_PREINIT_TIMEOUT
int
prompt "Failsafe/Debug wait timeout" if PREINITOPT
default 4
default 2
help
How long to wait for failsafe mode to be entered or for
a debug option to be pressed before continuing with a
@ -165,7 +165,7 @@ if VERSIONOPT
config VERSION_DIST
string
prompt "Release distribution"
default "OpenWrt"
default "iStoreOS"
help
This is the name of the release distribution.
If unspecified, it defaults to OpenWrt.
@ -190,7 +190,7 @@ if VERSIONOPT
config VERSION_REPO
string
prompt "Release repository"
default "https://downloads.openwrt.org/releases/24.10-SNAPSHOT"
default "https://downloads.openwrt.org/releases/24.10.0-rc4"
help
This is the repository address embedded in the image, it defaults
to the trunk snapshot repo; the url may contain the following placeholders:

View File

@ -129,28 +129,28 @@ define Package/grub2/install
-O i386-pc \
-c $(PKG_BUILD_DIR)/grub-early.cfg \
-o $(STAGING_DIR_IMAGE)/grub2/gpt-core.img \
at_keyboard biosdisk boot chain configfile fat linux ls part_gpt reboot search serial test vga
at_keyboard biosdisk boot chain configfile echo fat linux loadenv ls part_gpt reboot search serial test vga
$(STAGING_DIR_HOST)/bin/grub-mkimage \
-d $(PKG_BUILD_DIR)/grub-core \
-p /boot/grub \
-O i386-pc \
-c ./files/grub-early.cfg \
-o $(STAGING_DIR_IMAGE)/grub2/generic-core.img \
at_keyboard biosdisk boot chain configfile ext2 linux ls part_msdos reboot search serial test vga
at_keyboard biosdisk boot chain configfile echo ext2 linux loadenv ls part_msdos reboot search serial test vga
$(STAGING_DIR_HOST)/bin/grub-mkimage \
-d $(PKG_BUILD_DIR)/grub-core \
-p /boot/grub \
-O i386-pc \
-c ./files/grub-early.cfg \
-o $(STAGING_DIR_IMAGE)/grub2/eltorito.img \
at_keyboard biosdisk boot chain configfile iso9660 linux ls part_msdos reboot search serial test vga
at_keyboard biosdisk boot chain configfile echo iso9660 linux loadenv ls part_msdos reboot search serial test vga
$(STAGING_DIR_HOST)/bin/grub-mkimage \
-d $(PKG_BUILD_DIR)/grub-core \
-p /boot/grub \
-O i386-pc \
-c ./files/grub-early.cfg \
-o $(STAGING_DIR_IMAGE)/grub2/legacy-core.img \
biosdisk boot chain configfile ext2 linux ls part_msdos reboot search serial vga
biosdisk boot chain configfile echo ext2 linux loadenv ls part_msdos reboot search serial vga
endef
define Package/grub2-efi/install
@ -161,14 +161,14 @@ define Package/grub2-efi/install
-O $(CONFIG_ARCH)-efi \
-c $(PKG_BUILD_DIR)/grub-early.cfg \
-o $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_x86_64),x64,ia32).efi \
at_keyboard boot chain configfile fat linux ls part_gpt reboot serial test efi_gop efi_uga
at_keyboard boot chain configfile echo fat linux loadenv ls part_gpt reboot search serial test efi_gop efi_uga
$(STAGING_DIR_HOST)/bin/grub-mkimage \
-d $(PKG_BUILD_DIR)/grub-core \
-p /boot/grub \
-O $(CONFIG_ARCH)-efi \
-c ./files/grub-early.cfg \
-o $(STAGING_DIR_IMAGE)/grub2/iso-boot$(if $(CONFIG_x86_64),x64,ia32).efi \
boot chain configfile fat iso9660 linux ls part_msdos part_gpt reboot serial test efi_gop efi_uga
boot chain configfile echo fat iso9660 linux loadenv ls part_msdos part_gpt reboot serial test efi_gop efi_uga
endef
define Package/grub2-efi-arm/install
@ -181,7 +181,7 @@ define Package/grub2-efi-arm/install
-c $(PKG_BUILD_DIR)/grub-early.cfg \
-o $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_aarch64),aa64,arm).efi \
boot chain configfile fat linux ls part_gpt part_msdos reboot search \
search_fs_uuid search_label serial efi_gop lsefi minicmd ext2
search_fs_uuid search_label serial test efi_gop lsefi minicmd ext2
$(STAGING_DIR_HOST)/bin/grub-mkimage \
-d $(PKG_BUILD_DIR)/grub-core \
-p /boot/grub \

View File

@ -198,6 +198,12 @@ define U-Boot/rk3568/Default
TPL:=rk3568_ddr_1560MHz_v1.21.bin
endef
define U-Boot/easepi-rk3568
$(U-Boot/rk3568/Default)
NAME:=Easepi RK3568
DEFAULT:=y
endef
define U-Boot/bpi-r2-pro-rk3568
$(U-Boot/rk3568/Default)
NAME:=Bananapi-R2 Pro
@ -252,6 +258,12 @@ define U-Boot/rk3588/Default
TPL:=rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.16.bin
endef
define U-Boot/easepi-rk3588
$(U-Boot/rk3588/Default)
NAME:=Easepi RK3588
DEFAULT:=y
endef
define U-Boot/nanopc-t6-rk3588
$(U-Boot/rk3588/Default)
NAME:=NanoPC T6
@ -316,12 +328,14 @@ UBOOT_TARGETS := \
radxa-cm3-io-rk3566 \
radxa-zero-3-rk3566 \
rock-3c-rk3566 \
easepi-rk3568 \
bpi-r2-pro-rk3568 \
nanopi-r5c-rk3568 \
nanopi-r5s-rk3568 \
radxa-e25-rk3568 \
rock-3a-rk3568 \
rock-3b-rk3568 \
easepi-rk3588 \
nanopc-t6-rk3588 \
rock5b-rk3588 \
sige7-rk3588 \

View File

@ -0,0 +1,44 @@
From a3789019ce4ac4ee5dcd5d99a5b0ce73f3bd421a Mon Sep 17 00:00:00 2001
From: Liangbin Lian <jjm2473@gmail.com>
Date: Wed, 9 Apr 2025 16:39:31 +0800
Subject: [PATCH] drivers/rockchip-saradc: supports rk3568's 8 channels ADC
Same as rk3399-saradc, except the number of channels is 8.
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
---
drivers/adc/rockchip-saradc.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/adc/rockchip-saradc.c b/drivers/adc/rockchip-saradc.c
index f6832ab3073..9432203509b 100644
--- a/drivers/adc/rockchip-saradc.c
+++ b/drivers/adc/rockchip-saradc.c
@@ -336,6 +336,15 @@ static const struct rockchip_saradc_data rk3399_saradc_data = {
.stop = rockchip_saradc_stop_v1,
};
+static const struct rockchip_saradc_data rk3568_saradc_data = {
+ .num_bits = 10,
+ .num_channels = 8,
+ .clk_rate = 1000000,
+ .channel_data = rockchip_saradc_channel_data_v1,
+ .start_channel = rockchip_saradc_start_channel_v1,
+ .stop = rockchip_saradc_stop_v1,
+};
+
static const struct rockchip_saradc_data rk3588_saradc_data = {
.num_bits = 12,
.num_channels = 8,
@@ -351,6 +360,8 @@ static const struct udevice_id rockchip_saradc_ids[] = {
.data = (ulong)&rk3066_tsadc_data },
{ .compatible = "rockchip,rk3399-saradc",
.data = (ulong)&rk3399_saradc_data },
+ { .compatible = "rockchip,rk3568-saradc",
+ .data = (ulong)&rk3568_saradc_data },
{ .compatible = "rockchip,rk3588-saradc",
.data = (ulong)&rk3588_saradc_data },
{ }
--
2.46.0

View File

@ -0,0 +1,3 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
#include "rk3568-u-boot.dtsi"

View File

@ -0,0 +1,3 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
#include "rk3588s-u-boot.dtsi"

View File

@ -0,0 +1,78 @@
CONFIG_ARM=y
CONFIG_SKIP_LOWLEVEL_INIT=y
CONFIG_SYS_HAS_NONCACHED_MEMORY=y
CONFIG_COUNTER_FREQUENCY=24000000
CONFIG_ARCH_ROCKCHIP=y
CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3568-easepi"
CONFIG_ROCKCHIP_RK3568=y
CONFIG_SPL_SERIAL=y
CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_LEGACY_IMAGE_FORMAT=y
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-easepi.dtb"
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_SPL_MAX_SIZE=0x40000
CONFIG_SPL_PAD_TO=0x7f8000
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
CONFIG_SPL_ATF=y
CONFIG_CMD_ADC=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_GPT=y
CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
CONFIG_CMD_PCI=y
CONFIG_CMD_USB=y
CONFIG_CMD_PMIC=y
CONFIG_CMD_REGULATOR=y
# CONFIG_SPL_DOS_PARTITION is not set
CONFIG_SPL_OF_CONTROL=y
CONFIG_OF_LIVE=y
CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
CONFIG_SPL_DM_SEQ_ALIAS=y
CONFIG_SPL_REGMAP=y
CONFIG_SPL_SYSCON=y
CONFIG_SPL_CLK=y
CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_MISC=y
CONFIG_SUPPORT_EMMC_RPMB=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
CONFIG_MMC_SDHCI_ROCKCHIP=y
CONFIG_PHY_REALTEK=y
CONFIG_DWC_ETH_QOS=y
CONFIG_DWC_ETH_QOS_ROCKCHIP=y
CONFIG_RTL8169=y
CONFIG_NVME_PCI=y
CONFIG_PCIE_DW_ROCKCHIP=y
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
CONFIG_SPL_PINCTRL=y
CONFIG_DM_PMIC=y
CONFIG_PMIC_RK8XX=y
CONFIG_REGULATOR_RK8XX=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_SPL_RAM=y
CONFIG_BAUDRATE=1500000
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_SYS_NS16550_MEM32=y
CONFIG_SYSRESET=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_GENERIC=y
CONFIG_ERRNO_STR=y

View File

@ -0,0 +1,63 @@
CONFIG_ARM=y
CONFIG_SKIP_LOWLEVEL_INIT=y
CONFIG_SYS_HAS_NONCACHED_MEMORY=y
CONFIG_COUNTER_FREQUENCY=24000000
CONFIG_ARCH_ROCKCHIP=y
CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3588-easepi"
CONFIG_ROCKCHIP_RK3588=y
CONFIG_SPL_SERIAL=y
CONFIG_TARGET_EVB_RK3588=y
CONFIG_DEBUG_UART_BASE=0xFEB50000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_SYS_LOAD_ADDR=0xc00800
CONFIG_DEBUG_UART=y
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_FIT_SIGNATURE=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_LEGACY_IMAGE_FORMAT=y
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-easepi.dtb"
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_SPL_MAX_SIZE=0x40000
CONFIG_SPL_PAD_TO=0x7f8000
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
CONFIG_SPL_ATF=y
CONFIG_CMD_ADC=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_PWM=y
CONFIG_CMD_GPT=y
CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_REGULATOR=y
# CONFIG_SPL_DOS_PARTITION is not set
CONFIG_SPL_OF_CONTROL=y
CONFIG_OF_LIVE=y
CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
CONFIG_SPL_DM_SEQ_ALIAS=y
CONFIG_SPL_REGMAP=y
CONFIG_SPL_SYSCON=y
CONFIG_SPL_CLK=y
# CONFIG_USB_FUNCTION_FASTBOOT is not set
CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_MISC=y
CONFIG_SUPPORT_EMMC_RPMB=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
CONFIG_MMC_SDHCI_ROCKCHIP=y
# CONFIG_SPI_FLASH is not set
CONFIG_PHY_REALTEK=y
CONFIG_DWC_ETH_QOS=y
CONFIG_DWC_ETH_QOS_ROCKCHIP=y
CONFIG_SPL_PINCTRL=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_SPL_RAM=y
CONFIG_BAUDRATE=1500000
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_SYS_NS16550_MEM32=y
CONFIG_SYSRESET=y
CONFIG_ERRNO_STR=y

View File

@ -0,0 +1,127 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include "rk3568.dtsi"
/ {
model = "Easepi RK3568 Board";
compatible = "linkease,rk3568-demo", "rockchip,rk3568";
aliases {
ethernet0 = &gmac0;
ethernet1 = &gmac1;
mmc0 = &sdmmc0;
mmc1 = &sdhci;
};
chosen {
stdout-path = "serial2:1500000n8";
};
dummy_1v8: vcc-dummy-1v8-regulator {
compatible = "regulator-fixed";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "dummy_1v8";
};
};
&gmac0 {
phy-mode = "rgmii";
clock_in_out = "output";
snps,reset-gpio = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
snps,reset-active-low;
/* Reset time is 20ms, 100ms for rtl8211f */
snps,reset-delays-us = <0 20000 100000>;
assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
assigned-clock-rates = <0>, <125000000>;
pinctrl-names = "default";
pinctrl-0 = <&gmac0_miim
&gmac0_tx_bus2
&gmac0_rx_bus2
&gmac0_rgmii_clk
&gmac0_rgmii_bus>;
tx_delay = <0x3c>;
rx_delay = <0x2f>;
phy-handle = <&rgmii_phy0>;
status = "okay";
};
&gmac1 {
phy-mode = "rgmii";
clock_in_out = "output";
snps,reset-gpio = <&gpio2 RK_PD1 GPIO_ACTIVE_LOW>;
snps,reset-active-low;
/* Reset time is 20ms, 100ms for rtl8211f */
snps,reset-delays-us = <0 20000 100000>;
assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
assigned-clock-rates = <0>, <125000000>;
pinctrl-names = "default";
pinctrl-0 = <&gmac1m1_miim
&gmac1m1_tx_bus2
&gmac1m1_rx_bus2
&gmac1m1_rgmii_clk
&gmac1m1_rgmii_bus>;
tx_delay = <0x4f>;
rx_delay = <0x26>;
phy-handle = <&rgmii_phy1>;
status = "okay";
};
&mdio0 {
rgmii_phy0: phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0x0>;
};
};
&mdio1 {
rgmii_phy1: phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0x0>;
};
};
&saradc {
vref-supply = <&dummy_1v8>;
status = "okay";
};
&sdhci {
bus-width = <8>;
max-frequency = <200000000>;
non-removable;
pinctrl-names = "default";
pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
status = "okay";
};
&sdmmc0 {
bus-width = <4>;
cap-sd-highspeed;
disable-wp;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
sd-uhs-sdr104;
status = "okay";
};
&uart2 {
status = "okay";
};

View File

@ -0,0 +1,95 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/dts-v1/;
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/gpio/gpio.h>
#include "rk3588s.dtsi"
/ {
model = "Easepi RK3588 Board";
compatible = "linkease,rk3588-demo", "rockchip,rk3588";
aliases {
ethernet0 = &gmac1;
mmc0 = &sdmmc;
mmc1 = &sdhci;
};
chosen {
stdout-path = "serial2:1500000n8";
};
dummy_1v8: vcc-dummy-1v8-regulator {
compatible = "regulator-fixed";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-name = "dummy_1v8";
};
};
&gmac1 {
clock_in_out = "output";
phy-handle = <&rgmii_phy1>;
phy-mode = "rgmii-rxid";
pinctrl-0 = <&gmac1_miim
&gmac1_tx_bus2
&gmac1_rx_bus2
&gmac1_rgmii_clk
&gmac1_rgmii_bus>;
pinctrl-names = "default";
tx_delay = <0x42>;
status = "okay";
};
&mdio1 {
rgmii_phy1: ethernet-phy@1 {
compatible = "ethernet-phy-id001c.c916";
reg = <0x1>;
pinctrl-names = "default";
pinctrl-0 = <&rtl8211f_rst>;
reset-assert-us = <20000>;
reset-deassert-us = <100000>;
reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
};
};
&pinctrl {
rtl8211f {
rtl8211f_rst: rtl8211f-rst {
rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
};
&saradc {
vref-supply = <&dummy_1v8>;
status = "okay";
};
&sdhci {
bus-width = <8>;
no-sdio;
no-sd;
non-removable;
mmc-hs200-1_8v;
status = "okay";
};
&sdmmc {
bus-width = <4>;
cap-sd-highspeed;
disable-wp;
max-frequency = <150000000>;
no-mmc;
no-sdio;
sd-uhs-sdr104;
status = "okay";
};
&uart2 {
pinctrl-0 = <&uart2m0_xfer>;
status = "okay";
};

40
package/diy/dkml/Makefile Normal file
View File

@ -0,0 +1,40 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dkml
PKG_VERSION:=1.0.5
PKG_RELEASE:=1
PKG_FLAGS:=hold essential nonshared
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>
include $(INCLUDE_DIR)/package.mk
define Package/dkml
SECTION:=utils
CATEGORY:=Base system
TITLE:=iStoreOS DKML
DEPENDS:=+ubox
endef
define Package/dkml/description
iStoreOS dynamic kernel modules loader
endef
define Package/dkml/conffiles
/etc/config/kmods
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/dkml/install
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) ./files/kmods.init $(1)/etc/init.d/kmods
$(INSTALL_BIN) ./files/kmods-unload.init $(1)/etc/init.d/kmods-unload
$(INSTALL_DATA) ./files/kmods.config $(1)/etc/config/kmods
endef
$(eval $(call BuildPackage,dkml))

View File

@ -0,0 +1,45 @@
#!/bin/sh /etc/rc.common
START=25
check_driver_bond() {
local kmod="$1"
ls /sys/module/$kmod/drivers/*/ | grep -Fq :
}
rmmod_r() {
local kmod="$1"
local holder
for holder in `ls /sys/module/$kmod/holders/`; do
rmmod $holder
done
rmmod $kmod
}
auto_unload() {
local function support keep kmod
config_get function "$1" function
config_get support "$1" support
keep=0
if [ -n "$function" ]; then
for kmod in $function; do
if check_driver_bond $kmod; then
keep=1
elif [ -d /sys/module/$kmod ] ;then
echo "auto rmmod $kmod" >>/dev/kmsg
rmmod_r $kmod
fi
done
fi
if [ "$keep" = "0" -a -n "$support" ]; then
for kmod in $support; do
rmmod $kmod 2>/dev/null
done
fi
}
boot() {
config_load kmods
config_foreach auto_unload auto_unload
}

View File

@ -0,0 +1,35 @@
config global 'kmods'
# list enable 'r8125'
# list enable 'r8168'
config auto_unload 'common'
option function 'r8101 r8125 r8126 r8168 rtl8192de rtl8192se rtl8821ae'
option support 'rtl8192d_common rtl_pci'
# config auto_unload 'amdgpu'
# option function 'amdgpu'
# option support ''
# config auto_unload 'i915'
# option function 'i915'
# option support ''
# config auto_unload 'radeon'
# option function 'radeon'
# option support ''
# config auto_unload 'rtw89'
# option function 'rtw_8851be rtw_8852ae rtw_8852be rtw_8852ce'
# option support 'rtw_8852c rtw_8852b rtw_8852a rtw_8851b rtw89pci rtw89core'
# config auto_unload 'mwifiex'
# option function 'mwifiex_pcie'
# option support 'mwifiex'
# config auto_unload 'ath10k'
# option function 'ath10k_pci'
# option support 'ath10k_core'
# config auto_unload 'x86_others'
# option function 'bnx2x mlx5_core i40e mpt3sas ixgbe'
# option support ''

View File

@ -0,0 +1,36 @@
#!/bin/sh /etc/rc.common
START=09
enable_kmod() {
local kmod="$1"
sed -i "/^blacklist $kmod\$/d" /etc/modules.conf
}
disable_kmod() {
local kmod="$1"
grep -q "^blacklist $kmod\$" /etc/modules.conf || {
[ -n "$(tail -c1 /etc/modules.conf)" ] && echo >> /etc/modules.conf
echo "blacklist $kmod" >> /etc/modules.conf
}
}
boot() {
local info kmod action p1 ignore
local enable="$( uci -q get kmods.kmods.enable )"
ls /etc/modules-pending.d/ 2>/dev/null | while read info; do
if echo "$enable" | grep -qFw "$info" ; then
action=enable_kmod
else
action=disable_kmod
fi
echo "$action.group $info" >>/dev/kmsg
while read p1 ignore; do
kmod=$(echo "$p1" | grep -o '^[^#]*')
if [[ -n "$kmod" ]]; then
echo "$action $kmod" >>/dev/kmsg
$action $kmod
fi
done < "/etc/modules-pending.d/$info"
done
}

View File

@ -0,0 +1,58 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=grub-conf
PKG_VERSION:=1.0.0
PKG_RELEASE:=2
PKG_FLAGS:=hold nonshared
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>
include $(INCLUDE_DIR)/package.mk
define Package/grub-conf
CATEGORY:=Boot Loaders
SECTION:=boot
TITLE:=iStoreOS GRUB configure
DEPENDS:=@TARGET_x86 +grub2-editenv
endef
define Package/grub-conf/description
iStoreOS GRUB configure
endef
define Package/grub-conf/conffiles
/etc/config/grub
endef
define Package/iommu-conf
CATEGORY:=Boot Loaders
SECTION:=boot
TITLE:=iStoreOS GRUB IOMMU configure
DEPENDS:=@TARGET_x86_64 +grub-conf
endef
define Package/iommu-conf/description
iStoreOS IOMMU configure for PCI passthrough
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/grub-conf/install
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/etc/uci-defaults $(1)/etc/grub.cfg.d
$(INSTALL_BIN) ./files/grub.init $(1)/etc/init.d/grub
$(INSTALL_DATA) ./files/grub.config $(1)/etc/config/grub
$(INSTALL_DATA) ./files/grub.default $(1)/etc/uci-defaults/grub
$(INSTALL_DATA) ./files/cmdline.grubcfg $(1)/etc/grub.cfg.d/02-cmdline.cfg
endef
define Package/iommu-conf/install
$(INSTALL_DIR) $(1)/etc/grub.cfg.d
$(INSTALL_DATA) ./files/iommu.grubcfg $(1)/etc/grub.cfg.d/01-iommu.cfg
endef
$(eval $(call BuildPackage,grub-conf))
$(eval $(call BuildPackage,iommu-conf))

View File

@ -0,0 +1 @@
set cmdline_ext="$cmdline_ext $CUSTOM_CMDLINE"

View File

@ -0,0 +1,8 @@
config iommu 'iommu'
option enabled '0'
# option cmdline 'intel_iommu=on iommu=pt'
config cmdline
option enabled '0'
option cmdline 'usb-storage.quirks=0bda:9210:u,0080:a001:u'
option comment 'Disable UAS for some NVMe/SATA to USB Adapters'

View File

@ -0,0 +1,10 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@grub[-1]
add ucitrack grub
set ucitrack.@grub[-1].init=grub
commit ucitrack
EOF
exit 0

View File

@ -0,0 +1,48 @@
#!/bin/sh /etc/rc.common
START=99
boot() {
return 0
}
grub_iommu_conf() {
local enabled cmdline
config_get enabled iommu enabled 0
if [ "$enabled" = 1 ]; then
config_get cmdline iommu cmdline
if [ -z "$cmdline" ]; then
if grep -Fq Intel /proc/cpuinfo; then
cmdline="intel_iommu=on iommu=pt"
else
cmdline="amd_iommu=on iommu=pt"
fi
fi
grub-editenv - set IOMMU_CMDLINE="$cmdline"
else
grub-editenv - unset IOMMU_CMDLINE
fi
}
grub_concat_cmdlines() {
local enabled cmdline
config_get_bool enabled "$1" enabled 0
[ "$enabled" = 1 ] || return 0
config_get cmdline "$1" cmdline
[ -n "$cmdline" ] || return 0
CUSTOM_CMDLINE="$CUSTOM_CMDLINE $cmdline"
}
start() {
local enabled cmdline
config_load grub
[ -e /etc/grub.cfg.d/01-iommu.cfg ] && grub_iommu_conf
CUSTOM_CMDLINE=""
config_foreach grub_concat_cmdlines cmdline
if [ -n "$CUSTOM_CMDLINE" ]; then
grub-editenv - set CUSTOM_CMDLINE="${CUSTOM_CMDLINE## }"
else
grub-editenv - unset CUSTOM_CMDLINE
fi
update-grub || true
}

View File

@ -0,0 +1 @@
set cmdline_ext="$cmdline_ext $IOMMU_CMDLINE"

View File

@ -0,0 +1,13 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI for OTA upgrade
LUCI_DEPENDS:=+curl
LUCI_PKGARCH:=all
PKG_VERSION:=1.4.0
PKG_RELEASE:=2
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,177 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2021 jjm2473
]]--
module("luci.controller.admin.ota",package.seeall)
require "luci.util"
function index()
if luci.sys.call("ota >/dev/null 2>&1") ~= 0 then
return
end
entry({"admin", "system", "ota"}, post_on({ apply = "1" }, "action_ota"), _("OTA"), 69)
entry({"admin", "system", "ota", "check"}, post("action_check"))
entry({"admin", "system", "ota", "download"}, post("action_download"))
entry({"admin", "system", "ota", "progress"}, call("action_progress"))
entry({"admin", "system", "ota", "cancel"}, post("action_cancel"))
end
local function ota_exec(cmd)
local nixio = require "nixio"
local os = require "os"
local fs = require "nixio.fs"
local rshift = nixio.bit.rshift
local oflags = nixio.open_flags("wronly", "creat")
local lock, code, msg = nixio.open("/var/lock/ota_api.lock", oflags)
if not lock then
return 255, "", "Open stdio lock failed: " .. msg
end
-- Acquire lock
local stat, code, msg = lock:lock("tlock")
if not stat then
lock:close()
return 255, "", "Lock stdio failed: " .. msg
end
local r = os.execute(cmd .. " >/var/log/ota.stdout 2>/var/log/ota.stderr")
local e = fs.readfile("/var/log/ota.stderr")
local o = fs.readfile("/var/log/ota.stdout")
fs.unlink("/var/log/ota.stderr")
fs.unlink("/var/log/ota.stdout")
lock:lock("ulock")
lock:close()
e = e or ""
if r == 256 and e == "" then
e = "os.execute failed, is /var/log full or not existed?"
end
return rshift(r, 8), o or "", e or ""
end
local function image_supported(image)
return (os.execute("sysupgrade -T %q >/dev/null" % image) == 0)
end
function action_ota()
local image_tmp = "/tmp/firmware.img"
local http = require "luci.http"
if http.formvalue("apply") == "1" then
if not luci.dispatcher.test_post_security() then
return
end
if not image_supported(image_tmp) then
luci.template.render("admin_system/ota", {image_invalid = true})
return
end
local keep = (http.formvalue("keep") == "1") and "" or "-n"
luci.template.render("admin_system/ota_flashing", {
title = luci.i18n.translate("Flashing…"),
msg = luci.i18n.translate("The system is flashing now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
addr = (#keep > 0) and "192.168.1.1" or nil
})
fork_exec("sleep 1; killall dropbear uhttpd; sleep 1; /sbin/sysupgrade %s %q" %{ keep, image_tmp })
else
luci.template.render("admin_system/ota")
end
end
function action_check()
local r,o,e = ota_exec("ota check")
local ret = {
code = 500,
msg = "Unknown"
}
if r == 0 or r == 1 or r == 2 then
ret.code = r
ret.msg = o
else
ret.code = 500
ret.msg = e
end
luci.http.prepare_content("application/json")
luci.http.write_json(ret)
end
function action_download()
local r,o,e = ota_exec("ota download")
local ret = {
code = 500,
msg = "Unknown"
}
if r == 0 then
ret.code = 0
ret.msg = ""
else
ret.code = 500
ret.msg = e
end
luci.http.prepare_content("application/json")
luci.http.write_json(ret)
end
function action_progress()
local r,o,e = ota_exec("ota progress")
local ret = {
code = 500,
msg = "Unknown"
}
if r == 0 then
ret.code = 0
ret.msg = "done"
elseif r == 1 or r == 2 or r == 254 then
ret.code = r
ret.msg = o
else
ret.code = 500
ret.msg = e
end
luci.http.prepare_content("application/json")
luci.http.write_json(ret)
end
function action_cancel()
local r,o,e = ota_exec("ota cancel")
local ret = {
code = 500,
msg = "Unknown"
}
if r == 0 then
ret.code = 0
ret.msg = "ok"
else
ret.code = 500
ret.msg = e
end
luci.http.prepare_content("application/json")
luci.http.write_json(ret)
end
function fork_exec(command)
local pid = nixio.fork()
if pid > 0 then
return
elseif pid == 0 then
-- change to root dir
nixio.chdir("/")
-- patch stdin, out, err to /dev/null
local null = nixio.open("/dev/null", "w+")
if null then
nixio.dup(null, nixio.stderr)
nixio.dup(null, nixio.stdout)
nixio.dup(null, nixio.stdin)
if null:fileno() > 2 then
null:close()
end
end
-- replace with target command
nixio.exec("/bin/sh", "-c", command)
end
end

View File

@ -0,0 +1,240 @@
<%#
Licensed to the public under the Apache License 2.0.
-%>
<%+header%>
<%
local fs = require "nixio.fs"
-%>
<div class="cbi-map" id="cbi-ota">
<style>
#cbi-ota .state-ctl .state {
display: none !important;
padding: 0 !important;
margin: 0 !important;
border: 0 !important;
}
#cbi-ota .state-ctl.state-ctl-unchecked .state.state-unchecked,
#cbi-ota .state-ctl.state-ctl-checked .state.state-checked,
#cbi-ota .state-ctl.state-ctl-downloading .state.state-downloading,
#cbi-ota .state-ctl.state-ctl-downloaded .state.state-downloaded
{
display: inherit !important;
}
</style>
<h2 name="content"><%:OTA%></h2>
<div class="cbi-section state-ctl state-ctl-unchecked">
<div class="cbi-section-descr"><%:Check and upgrade firmware from the Internet%></div>
<% if image_invalid then %>
<div class="cbi-section-error"><%:The image file does not contain a supported format. Maybe try again later.%></div>
<% end %>
<div class="cbi-section-node">
<div class="state state-unchecked">
<form>
<div class="cbi-value">
<label class="cbi-value-title" id="check_result"></label>
<div class="cbi-value-field">
<button type="button" class="cbi-button cbi-button-reload" name="check"><%:Check update%></button>
<div class="cbi-value-description">Step 1/3: <%:Check update%></div>
</div>
</div>
</form>
</div>
<div class="state state-checked">
<form>
<div class="cbi-value">
<label class="cbi-value-title" id="download_result"><%:Found new firmware%></label>
<div class="cbi-value-field">
<button type="button" class="cbi-button cbi-button-apply" name="download"><%:Download firmware%></button>
<div class="cbi-value-description">Step 2/3: <%:Download firmware%></div>
</div>
</div>
</form>
</div>
<div class="state state-downloading">
<form>
<div class="cbi-value">
<label class="cbi-value-title" id="download_progress">0%</label>
<div class="cbi-value-field">
<button type="button" class="cbi-button cbi-button-reset" name="cancel"><%:Cancel download%></button>
<div class="cbi-value-description">Step 2/3: <%:Download firmware%></div>
</div>
</div>
</form>
</div>
<div class="state state-downloaded">
<% if fs.access("/usr/lib/lua/luci/controller/admin/system.lua") then %>
<form method="post" action="<%=url('admin/system/flashops/sysupgrade')%>" enctype="multipart/form-data">
<input type="hidden" name="token" value="<%=token%>" />
<input type="hidden" name="step" value="1" />
<div class="cbi-value">
<label class="cbi-value-title"><%:Firmware downloaded%></label>
<div class="cbi-value-field">
<input type="submit" class="cbi-button cbi-input-apply" value="<%:Flash image...%>" />
<div class="cbi-value-description">Step 3/3: <%:Flash image...%></div>
</div>
</div>
</form>
<% else %>
<form method="post" action="<%=url('admin/system/ota')%>">
<input type="hidden" name="apply" value="1" />
<input type="hidden" name="token" value="<%=token%>" />
<div class="cbi-value">
<label class="cbi-value-title" for="keep"><%:Keep settings and retain the current configuration%></label>
<div class="cbi-value-field">
<input type="checkbox" name="keep" value="1" id="keep" checked="checked" />
</div>
</div>
<div class="cbi-value cbi-value-last">
<label class="cbi-value-title"><%:Firmware downloaded%></label>
<div class="cbi-value-field">
<button type="submit" class="cbi-button cbi-input-apply"><%:Flash image%></button>
<div class="cbi-value-description">Step 3/3: <%:Flash image%></div>
</div>
</div>
</form>
<% end %>
</div>
</div>
<div class="state state-checked state-downloading state-downloaded">
<div class="cbi-section-descr">
<h2><%:The latest firmware%>:</h2>
<div id="upgrade_log"></div>
</div>
</div>
<div class="state state-unchecked">
<div class="cbi-section-descr">
<div id="history_log"></div>
</div>
</div>
</div>
<script>
(function(){
var csrfToken = "<%=token%>";
var check = document.querySelector('button[name="check"]');
var download = document.querySelector('button[name="download"]');
var cancel = document.querySelector('button[name="cancel"]');
var state_ctl = document.querySelector('.state-ctl');
var check_result = document.querySelector('#check_result');
var download_result = document.querySelector('#download_result');
var download_progress = document.querySelector('#download_progress');
var upgrade_log = document.querySelector('#upgrade_log');
var history_log = document.querySelector('#history_log');
var xhr_post = function(url, data, cb) {
data = data || {};
data.token = '<%=token%>';
new XHR().post(url, data, function(x, d){
cb && cb(x, x.status==200?JSON.parse(x.responseText):{code:500,msg:x.responseText});
});
};
var state_switch = function(from, to) {
state_ctl.classList.remove("state-ctl-" + from);
state_ctl.classList.add("state-ctl-" + to);
};
check.onclick = function(){
check.disabled = 'disabled';
check_result.innerText = "<%:Checking...%>";
xhr_post("<%=url('admin/system/ota/check')%>", {}, function(x, d){
check.disabled = undefined;
switch(d.code){
case 0:
case 2:
check_result.innerText = "";
upgrade_log.innerHTML = d.msg;
if (d.code == 0) {
state_switch("unchecked", "checked");
} else {
alert("<%:Found downloading firmware, will show progress%>");
download_progress.innerText = "<%:Downloading%>: ...";
cancel.disabled = 'disabled';
state_switch("unchecked", "downloading");
refresh_download_progress_timer = setTimeout(refresh_download_progress, 500);
}
break;
case 1:
check_result.innerText = "<%:Already the latest firmware%>";
history_log.innerHTML = '<h2><%:History Log%>:</h2>' + d.msg;
break;
default:
check_result.innerText = "<%:Check failed%>";
alert("<%:Check failed%>:\n"+d.msg);
}
});
};
var refresh_download_progress_paused = false;
var refresh_download_progress_timer = null;
var refresh_download_progress = function() {
if (refresh_download_progress_paused) {
refresh_download_progress_timer = setTimeout(refresh_download_progress, 500);
return;
}
XHR.get("<%=url('admin/system/ota/progress')%>", {}, function(x, d){
refresh_download_progress_timer = null;
switch(d.code){
case 0:
download_progress.innerText = "";
state_switch("downloading", "downloaded");
break;
case 1:
if (d.msg.startsWith('#') || d.msg.startsWith(' ') || d.msg.startsWith('-')) {
if (!refresh_download_progress_paused)
cancel.disabled = undefined;
if (d.msg.endsWith('%'))
download_progress.innerText = "<%:Downloading%>: "+d.msg.replaceAll(/[# ]/g, '');
else
download_progress.innerText = "<%:Downloading%>";
} else {
if (!refresh_download_progress_paused)
cancel.disabled = 'disabled';
download_progress.innerText = d.msg;
}
refresh_download_progress_timer = setTimeout(refresh_download_progress, 500);
break;
case 2:
download_result.innerText = "<%:Download canceled%>";
state_switch("downloading", "checked");
break;
case 254:
state_switch("downloading", "unchecked");
break;
default:
download_result.innerText = "<%:Download failed%>";
state_switch("downloading", "checked");
alert("<%:Download failed%>:"+d.msg);
}
});
};
download.onclick = function(){
download.disabled = 'disabled';
xhr_post("<%=url('admin/system/ota/download')%>", {}, function(x, d){
download.disabled = undefined;
switch(d.code){
case 0:
download_progress.innerText = "<%:Downloading%>: ...";
cancel.disabled = 'disabled';
state_switch("checked", "downloading");
refresh_download_progress_timer = setTimeout(refresh_download_progress, 500);
break;
default:
alert("<%:Download failed%>:"+d.msg);
}
});
};
cancel.onclick = function() {
cancel.disabled = 'disabled';
refresh_download_progress_paused = true;
xhr_post("<%=url('admin/system/ota/cancel')%>", {}, function(x, d){
refresh_download_progress_paused = false;
});
};
})();
</script>
</div>
<%+footer%>

View File

@ -0,0 +1,52 @@
<%#
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
Licensed to the public under the Apache License 2.0.
-%>
<html>
<head>
<title><%=luci.sys.hostname()%> - <%= title or translate("Rebooting...") %></title>
<link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
<script type="text/javascript">//<![CDATA[
var interval = window.setInterval(function() {
var img = new Image();
var target = ('https:' == document.location.protocol ? 'https://' : 'http://') + <%=addr and "'%s'" % addr or "window.location.host"%>;
img.onload = function() {
window.clearInterval(interval);
window.location.replace(target);
};
img.src = target + '<%=resource%>/icons/loading.gif?' + Math.random();
}, 5000);
//]]></script>
</head>
<body>
<header>
<div class="fill">
<div class="container">
<p class="brand"><%=luci.sys.hostname() or "?"%></p>
</div>
</div>
</header>
&#160;
<div class="main">
<div id="maincontainer">
<div id="maincontent" class="container">
<h2 name="content" id="applyreboot-container" ><%:System%> - <%= title or translate("Rebooting...") %></h2>
<div class="cbi-section" id="applyreboot-section">
<div>
<%= msg or translate("Changes applied.") %>
</div>
<div>
<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" />
<%:Waiting for device...%>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,62 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "OTA"
msgstr ""
msgid "Already the latest firmware"
msgstr ""
msgid "Check update"
msgstr ""
msgid "Found new firmware"
msgstr ""
msgid "Download firmware"
msgstr ""
msgid "Cancel download"
msgstr ""
msgid "Firmware downloaded"
msgstr ""
msgid "Flash image..."
msgstr ""
msgid "Flash image"
msgstr ""
msgid "Checking..."
msgstr ""
msgid "Check failed"
msgstr ""
msgid "Downloading"
msgstr ""
msgid "Download canceled"
msgstr ""
msgid "Download failed"
msgstr ""
msgid "Upgrade firmware On the Air"
msgstr ""
msgid "Check and upgrade firmware from the Internet"
msgstr ""
msgid "The latest firmware"
msgstr ""
msgid "The image file does not contain a supported format. Maybe try again later."
msgstr ""
msgid "History Log"
msgstr ""
msgid "Found downloading firmware, will show progress"
msgstr ""

View File

@ -0,0 +1,62 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "OTA"
msgstr ""
msgid "Already the latest firmware"
msgstr ""
msgid "Check update"
msgstr ""
msgid "Found new firmware"
msgstr ""
msgid "Download firmware"
msgstr ""
msgid "Cancel download"
msgstr ""
msgid "Firmware downloaded"
msgstr ""
msgid "Flash image..."
msgstr ""
msgid "Flash image"
msgstr ""
msgid "Checking..."
msgstr ""
msgid "Check failed"
msgstr ""
msgid "Downloading"
msgstr ""
msgid "Download canceled"
msgstr ""
msgid "Download failed"
msgstr ""
msgid "Upgrade firmware On the Air"
msgstr ""
msgid "Check and upgrade firmware from the Internet"
msgstr ""
msgid "The latest firmware"
msgstr ""
msgid "The image file does not contain a supported format. Maybe try again later."
msgstr ""
msgid "History Log"
msgstr ""
msgid "Found downloading firmware, will show progress"
msgstr ""

View File

@ -0,0 +1,62 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "OTA"
msgstr "在线升级"
msgid "Already the latest firmware"
msgstr "已经是最新固件"
msgid "Check update"
msgstr "检查更新"
msgid "Found new firmware"
msgstr "发现新固件"
msgid "Download firmware"
msgstr "下载固件"
msgid "Cancel download"
msgstr "取消下载"
msgid "Firmware downloaded"
msgstr "固件已下载"
msgid "Flash image..."
msgstr "刷写固件..."
msgid "Flash image"
msgstr "刷写固件"
msgid "Checking..."
msgstr "检查中..."
msgid "Check failed"
msgstr "检查失败"
msgid "Downloading"
msgstr "下载中"
msgid "Download canceled"
msgstr "下载已取消"
msgid "Download failed"
msgstr "下载失败"
msgid "Upgrade firmware On the Air"
msgstr "在线升级固件"
msgid "Check and upgrade firmware from the Internet"
msgstr "通过网络检查和更新固件"
msgid "The latest firmware"
msgstr "最新固件"
msgid "The image file does not contain a supported format. Maybe try again later."
msgstr "镜像文件格式不支持或损坏。也许稍候再试试"
msgid "History Log"
msgstr "历史更新日志"
msgid "Found downloading firmware, will show progress"
msgstr "发现下载中的固件,将显示当前进度"

View File

@ -0,0 +1,242 @@
#!/bin/sh
# author jjm2473
mirrors() {
local url="$1"
case "$url" in
https://fw0.koolcenter.com/iStoreOS/*|\
https://fw.koolcenter.com/iStoreOS/*)
local path=$(echo "$url" | sed -E 's#^https?://[^/]+/(.*)#\1#')
# echo "https://dl2.istoreos.com/$path"
echo "https://dl.istoreos.com/$path"
;;
esac
echo "$url"
return 0
}
if [ -f /lib/upgrade/ota.sh ]; then
. /lib/upgrade/ota.sh
export_ota_url
fi
if [ -z "$OTA_URL_BASE" ]; then
echo "Unsupported device." >&2
exit 255
fi
WRLOCK=/var/lock/ota_background.lock
STLOCK=/var/lock/ota_status.lock
action=${1}
shift
sha256() {
sha256sum $1 | cut -d' ' -f1
}
alias fcurl='curl -L --fail --show-error'
download() {
local img=$1
local sum=$2
exec 300>$STLOCK
flock 300
touch /tmp/firmware.img.part
echo >/tmp/firmware.img.progress
rm -f /tmp/firmware.img.sha256sum
flock -u 300
if [ -f /tmp/firmware.img ]; then
echo "Checking existed firmware.img..." >> /tmp/firmware.img.progress
if [ "`sha256 /tmp/firmware.img`" = "$sum" ]; then
flock 300
echo $sum > /tmp/firmware.img.sha256sum;
rm -f /tmp/firmware.img.part
rm -f /tmp/firmware.img.progress
flock -u 300
return 0;
else
echo "Check failed, redownload" >> /tmp/firmware.img.progress
rm -f /tmp/firmware.img
fi
fi
local pid url
mirrors "$OTA_URL_BASE/$img" | while read; do
url="$REPLY"
echo "Try $url" >>/tmp/firmware.img.progress
flock 300
echo "#=#=#" >>/tmp/firmware.img.progress
fcurl --connect-timeout 5 --progress-bar -o /tmp/firmware.img.part "$url" 2>>/tmp/firmware.img.progress &
pid="$!"
echo "$pid" > /var/run/ota/download.pid
flock -u 300
if wait $pid; then
rm -f /var/run/ota/download.pid
echo "Checking new firmware.img.part..." > /tmp/firmware.img.progress
if [ "`sha256 /tmp/firmware.img.part`" = "$sum" ]; then
flock 300
mv /tmp/firmware.img.part /tmp/firmware.img && echo $sum > /tmp/firmware.img.sha256sum
rm -f /tmp/firmware.img.progress
flock -u 300
return 0
else
echo "Checksum failed!" >>/tmp/firmware.img.progress
fi
else
# on Terminated $? == 143, on Timeout $? == 28
local ecode=$?
echo >>/tmp/firmware.img.progress
if [ $ecode -eq 143 ]; then
echo "Canceled!" >> /tmp/firmware.img.progress
break
fi
fi
flock 300
sed -i '/\r/d' /tmp/firmware.img.progress
flock -u 300
done
rm -f /var/run/ota/download.pid
rm -f /tmp/firmware.img.part
return 1
}
lock_download() {
local lock="$WRLOCK"
exec 200>$lock
flock -n 200 || return
download $1 $2
flock -u 200
}
prepare_check() {
local line
local release=`grep 'DISTRIB_RELEASE=' /etc/openwrt_release | sed -E "s/.*'(.+)'.*/\1/"`
local revision=`grep 'DISTRIB_REVISION=' /etc/openwrt_release | sed -E "s/.*'(.+)'.*/\1/" | cut -d'-' -f1`
local current="$release-$revision"
local latest=0
cat /dev/null > /var/run/ota/ota.log
fcurl --connect-timeout 5 -o /var/run/ota/ota.latest "$OTA_URL_BASE/version.latest" || { rm -f /var/run/ota/ota.latest ; return 255; }
if head -1 /var/run/ota/ota.latest | grep -Fq "$current"; then
latest=1
current=""
fi
fcurl --connect-timeout 5 -o /var/run/ota/ota.index "$OTA_URL_BASE/version.index" || return 255;
head -5 /var/run/ota/ota.index | while read line; do
if [ -z "$line" -o "$line" = "$current" ]; then
break
fi
echo "<h3>`echo $line | sed 's/-/ /'`</h3><pre>" >> /var/run/ota/ota.log
fcurl --connect-timeout 1 "$OTA_URL_BASE/log/$line.log" >> /var/run/ota/ota.log 2>/dev/null
echo "</pre>" >> /var/run/ota/ota.log
done
[ "`wc -l /var/run/ota/ota.log | cut -d' ' -f1`" -eq 0 ] && return 1
[ "`wc -l /var/run/ota/ota.index | cut -d' ' -f1`" -gt 5 ] && echo "<a href=\"$OTA_URL_BASE/\" onclick=\"void(0)\" target=\"_blank\">More</a>" >> /var/run/ota/ota.log
fcurl --connect-timeout 1 "$OTA_URL_BASE/ota.footer.html" >> /var/run/ota/ota.log 2>/dev/null
return $latest
}
# 0: found newer fw, 1: already newest fw, 2: found running task, *: err
do_check() {
local ret=0
local lock="$WRLOCK"
exec 200>$lock
if flock -n 200; then
prepare_check
ret=$?
flock -u 200 >/dev/null 2>&1
elif [ -f /tmp/firmware.img.progress -o -f /tmp/firmware.img.sha256sum ]; then
ret=2
else
echo "lock failed!" >&2
return 255
fi
if [ "$ret" -eq 0 -o "$ret" -eq 2 ]; then
# output
echo "<pre>"
sed -E '1 s/^\[.*\]\((.+)\)\s*$/\1/' /var/run/ota/ota.latest
echo "</pre>"
echo "<br><h2>ChangeLog:</h2>"
fi
[ "$ret" -eq 0 -o "$ret" -eq 1 -o "$ret" -eq 2 ] && cat /var/run/ota/ota.log
return $ret
}
# async download
do_download(){
local img=`head -1 /var/run/ota/ota.latest | sed -E 's/.*\((.+)\).*/\1/'`
local sum=`head -3 /var/run/ota/ota.latest | grep '^SHA256: ' | cut -d' ' -f2`
[ -z "$img" -o -z "$sum" ] && { echo "do check first" >&2 ; return 254; }
lock_download $img $sum &
return 0
}
# 0: done, 1: downloading, 2: failed, 254: wrong state, *: err
do_progress() {
local sum=`head -3 /var/run/ota/ota.latest | grep '^SHA256: ' | cut -d' ' -f2`
[ -z "$sum" ] && { echo "do check first" >&2 ; return 254; }
[ -f /tmp/firmware.img.sha256sum ] && [ "`cat /tmp/firmware.img.sha256sum`" = "$sum" ] && return 0
[ -f /tmp/firmware.img.progress ] || { echo "download not in progress" >&2 ; return 254; }
[ -f /tmp/firmware.img.part ] && { cat /tmp/firmware.img.progress | tr '\r' '\n' | tail -n1; return 1; }
tail -1 /tmp/firmware.img.progress | grep -Fq 'Canceled!' && { echo "Canceled"; return 2; }
cat /tmp/firmware.img.progress | tr '\r' '\n' | grep -v '^$' | tail -n1 >&2
return 3
}
do_progress_locked() {
local ret
exec 300>$STLOCK
flock -s 300
do_progress
ret=$?
flock -u 300
return $ret
}
do_cancel() {
if [ -f /var/run/ota/download.pid ]; then
local pid=`cat /var/run/ota/download.pid`
if [ -n "$pid" ]; then
kill -TERM $pid;
while kill -0 $pid >/dev/null 2>&1; do
if ! sleep 1; then
break
fi
done
fi
fi
return 0
}
ota_init(){
mkdir -p /var/run/ota >/dev/null 2>&1 || true
}
usage() {
echo "usage: ota sub-command"
echo "where sub-command is one of:"
echo " check Check firmware upgrade"
echo " download Download latest firmware"
echo " progress Download progress"
echo " cancel Cancel download"
}
ota_init || exit 255
case $action in
"check")
do_check
;;
"download")
do_download
;;
"progress")
do_progress_locked
;;
"cancel")
do_cancel
;;
*)
usage
;;
esac

View File

@ -0,0 +1,45 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ntfs3-mount
PKG_RELEASE:=6
include $(INCLUDE_DIR)/package.mk
define Package/ntfs3-mount
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=Filesystem
TITLE:=NTFS mount script for Paragon NTFS3 driver
DEPENDS:=+kmod-fs-ntfs3
PKGARCH:=all
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/ntfs3-mount/install
$(INSTALL_DIR) $(1)/sbin $(1)/sbin/fs
$(INSTALL_BIN) ./files/mount.ntfs $(1)/sbin
$(LN) /sbin/mount.ntfs $(1)/sbin/fs/mount.ntfs
endef
define Package/ntfs3-mount/postinst
#!/bin/sh
FILE="$${IPKG_INSTROOT}/etc/filesystems"
ID="ntfs"
if ! [ -f $$FILE ]; then
echo "Create '$$FILE'."
touch "$$FILE"
fi
if ! grep -q -e '^'"$$ID"'$$' "$$FILE"; then
echo "Add '$$ID' to known filesystems."
echo "$$ID" >> "$$FILE"
fi
endef
$(eval $(call BuildPackage,ntfs3-mount))

View File

@ -0,0 +1,2 @@
#!/bin/sh
mount -t ntfs3 -o iocharset=utf8,force "$@" || mount -t ntfs3 -o iocharset=utf8,ro "$@"

View File

@ -0,0 +1,88 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ntfsprogs
PKG_RELEASE:=1
PKG_VERSION:=2021.8.22
PKG_SOURCE:=ntfs-3g_ntfsprogs-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://www.tuxera.com/opensource/
PKG_HASH:=55b883aa05d94b2ec746ef3966cb41e66bed6db99f22ddd41d1b8b94bb202efb
PKG_LICENSE:=GPL-2.0 LGPL-2.0
PKG_LICENSE_FILES:=COPYING COPYING.LIB
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)/description
Suite of NTFS utilities for doing neat things with NTFS.
Contains:
- mkntfs - Create an NTFS filesystem.
- ntfscat - Dump a file's content to the standard output.
- ntfsclone - Efficiently clone, backup, restore or rescue NTFS.
- ntfscluster - Locate the files which use the given sectors or clusters.
- ntfscmp - Compare two NTFS filesystems and tell the differences.
- ntfscp - Copy a file to an NTFS volume.
- ntfssecaudit - Display ownership and permissions, check consistency
- ntfsfix - Check and fix some common errors, clear the LogFile.
- ntfsinfo - Show information about NTFS or one of the files or directories within it.
- ntfslabel - Show, or set, an NTFS filesystem's volume label.
- ntfsls - List information about files in a directory residing on an NTFS.
- ntfsresize - Resize NTFS without losing data.
- ntfsundelete - Recover deleted files from NTFS.
- ntfsusermap - Define mapping of Windows accounts to Linux logins
endef
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
URL:=http://www.tuxera.com
SUBMENU:=Filesystem
TITLE:=ntfsprogs from ntfs-3g
DEPENDS+= +libgcrypt +libuuid
CONFLICTS:=ntfs-3g ntfs-3g-utils
endef
CONFIGURE_ARGS += \
--enable-ntfsprogs \
--disable-ntfs-3g \
--enable-shared \
--enable-static \
--with-uuid
CONFIGURE_ARGS += --with-fuse=internal
TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
# redefine prepare to extract to our build dir
# apply patches
define Build/Prepare
rm -rf $(PKG_BUILD_DIR)/
mkdir -p $(PKG_BUILD_DIR)/
$(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
$(Build/Patch)
endef
define Package/$(PKG_NAME)/install
[ -f $(PKG_INSTALL_DIR)/usr/sbin/mkntfs ] && [ -f $(PKG_INSTALL_DIR)/usr/bin/ntfsfix ]
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/sbin
$(LN) /usr/sbin/mkntfs $(1)/sbin/mkfs.ntfs
$(INSTALL_DIR) $(1)/usr/bin
$(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
$(INSTALL_DIR) $(1)/usr/sbin
$(FIND) $(PKG_INSTALL_DIR)/usr/sbin/ -type f ! -regex '.*[^/]mkfs\.ntfs[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/sbin/ \;
$(LN) /usr/sbin/mkntfs $(1)/usr/sbin/mkfs.ntfs
$(LN) /usr/bin/ntfsfix $(1)/usr/sbin/fsck.ntfs
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -224,40 +224,82 @@ define Package/e100-firmware/install
endef
$(eval $(call BuildPackage,e100-firmware))
i915_deps:=+i915-firmware-dmc +i915-firmware-guc +i915-firmware-huc +i915-firmware-gsc
i915_deps:=+i915-firmware-dmc +i915-firmware-guc +i915-firmware-huc
Package/i915-firmware = $(call Package/firmware-default,Intel I915 firmware \(meta package\),$(i915_deps),LICENSE.i915)
define Package/i915-firmware/install
true
endef
$(eval $(call BuildPackage,i915-firmware))
# grep -oE -e 'DMC_PATH\(.+\)$' -e 'DMC_LEGACY_PATH\(.+\)$' drivers/gpu/drm/i915/display/intel_dmc.c | sed 's/[[:space:]]\{1,\}//g' | \
sed -E -e 's/DMC_PATH\((.+)\)/\1_dmc.bin/g' \
-e 's/DMC_LEGACY_PATH\((.+),(.+),(.+)\)/\1_dmc_ver\2_\3.bin/g' | \
sort -u | xargs -rn1 sh -c 'echo " \$(INSTALL_DATA) \$(PKG_BUILD_DIR)/i915/$0 \$(1)/lib/firmware/i915/"'
Package/i915-firmware-dmc = $(call Package/firmware-default,Intel I915 DMC firmware,,LICENSE.i915)
define Package/i915-firmware-dmc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
for f in $(PKG_BUILD_DIR)/i915/*_dmc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = dmc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adlp_dmc.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adlp_dmc_ver2_16.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adls_dmc_ver2_01.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_dmc_ver1_07.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg1_dmc_ver2_02.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg2_dmc_ver2_08.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/glk_dmc_ver1_04.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_dmc_ver1_09.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_dmc_ver1_04.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/mtl_dmc.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/rkl_dmc_ver2_03.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_dmc_ver1_27.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_dmc_ver2_12.bin $(1)/lib/firmware/i915/
endef
$(eval $(call BuildPackage,i915-firmware-dmc))
# grep -oE -e 'guc_(maj|mmp)\([^)]+\)' drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | sed 's/[[:space:]]\{1,\}//g' | \
sed -E -e 's/guc_maj\(([^,]+),([^,]+),.*\)/\1_guc_\2.bin/g' \
-e 's/guc_mmp\(([^,]+),([^,]+),([^,]+),([^,]+)\)/\1_guc_\2.\3.\4.bin/g' | \
sort -u | xargs -rn1 sh -c 'echo " \$(INSTALL_DATA) \$(PKG_BUILD_DIR)/i915/$0 \$(1)/lib/firmware/i915/"'
Package/i915-firmware-guc = $(call Package/firmware-default,Intel I915 GUC firmware,,LICENSE.i915)
define Package/i915-firmware-guc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
for f in $(PKG_BUILD_DIR)/i915/*_guc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = guc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adlp_guc_69.0.3.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adlp_guc_70.1.1.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adlp_guc_70.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_guc_70.1.1.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/cml_guc_70.1.1.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg1_guc_70.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg2_guc_70.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/ehl_guc_70.1.1.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/glk_guc_70.1.1.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_guc_70.1.1.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_guc_70.1.1.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/mtl_guc_70.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_guc_70.1.1.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_guc_69.0.3.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_guc_70.1.1.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_guc_70.bin $(1)/lib/firmware/i915/
endef
$(eval $(call BuildPackage,i915-firmware-guc))
# grep -oE -e 'huc_(gsc|raw|mmp)\([^)]+\)' drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | sed 's/[[:space:]]\{1,\}//g' | \
sed -E -e 's/huc_mmp\(([^,]+),([^,]+),([^,]+),([^,]+)\)/\1_huc_\2.\3.\4.bin/g' \
-e 's/huc_gsc\(([^,]+)\)/\1_huc_gsc.bin/g' \
-e 's/huc_raw\(([^,]+)\)/\1_huc.bin/g' | \
sort -u | xargs -rn1 sh -c 'echo " \$(INSTALL_DATA) \$(PKG_BUILD_DIR)/i915/$0 \$(1)/lib/firmware/i915/"'
Package/i915-firmware-huc = $(call Package/firmware-default,Intel I915 HUC firmware,,LICENSE.i915)
define Package/i915-firmware-huc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
for f in $(PKG_BUILD_DIR)/i915/*_huc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = huc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_huc_2.0.0.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/cml_huc_4.0.0.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg1_huc.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg2_huc_gsc.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/ehl_huc_9.0.0.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/glk_huc_4.0.0.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_huc_9.0.0.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_huc_4.0.0.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/mtl_huc_gsc.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_huc_2.0.0.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_huc.bin $(1)/lib/firmware/i915/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_huc_7.9.3.bin $(1)/lib/firmware/i915/
endef
$(eval $(call BuildPackage,i915-firmware-huc))

View File

@ -0,0 +1,8 @@
Package/qed-firmware = $(call Package/firmware-default,QLogic QED firmware)
define Package/qed-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/qed
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/qed/qed_init_values_zipped-8.59.1.0.bin \
$(1)/lib/firmware/qed/
endef
$(eval $(call BuildPackage,qed-firmware))

View File

@ -0,0 +1,39 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mali-csf-firmware
PKG_VERSION:=g18p0-01eac0
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=ca33693a03b2782edc237d1d3b786f94849bed7d
PKG_HASH:=122f1ecc14d2de0fe93fc025f8c77e4531abd004fa172ffe69e40cd7d15d5c66
PKG_SOURCE_URL_FILE:=mali_csffw.bin
PKG_SOURCE:=mali_csffw-$(PKG_VERSION).bin
PKG_SOURCE_URL:=https://raw.githubusercontent.com/JeffyCN/mirrors/$(PKG_SOURCE_VERSION)/firmware/g610/
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>
include $(INCLUDE_DIR)/package.mk
define Package/mali-csf-firmware
SECTION:=firmware
CATEGORY:=Firmware
TITLE:=Mali CSF firmware
DEPENDS:=@TARGET_rockchip
HIDDEN:=1
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Compile
endef
define Package/mali-csf-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DATA) $(DL_DIR)/$(PKG_SOURCE) $(1)/lib/firmware/$(PKG_SOURCE_URL_FILE)
endef
$(eval $(call BuildPackage,mali-csf-firmware))

View File

@ -0,0 +1,94 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=istoreos-files
PKG_VERSION:=1.0
PKG_RELEASE:=$(COMMITCOUNT)
PKG_FLAGS:=hold essential nonshared
PKG_LICENSE:=CC0-1.0
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=base
CATEGORY:=Base system
TITLE:=iStoreOS files
MAINTAINER:=jjm2473 <jjm2473@gmail.com>
DEFAULT:=y
HIDDEN:=y
DEPENDS:=+luci-theme-argon
endef
define Package/$(PKG_NAME)/description
The iStoreOS.
endef
define Package/istoreos-intl
SECTION:=base
CATEGORY:=Base system
TITLE:=iStoreOS intl
MAINTAINER:=jjm2473 <jjm2473@gmail.com>
DEPENDS:=$(PKG_NAME)
endef
define Package/istoreos-intl/description
iStoreOS internationalization.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Compile/Default
endef
Build/Compile = $(Build/Compile/Default)
define Package/$(PKG_NAME)/install
$(CP) ./files/* $(1)/
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
HOST_SED="$(subst ${STAGING_DIR_HOST},$${STAGING_DIR_HOST},$(SED))"
HOST_LN="$(subst ${STAGING_DIR_HOST},$${STAGING_DIR_HOST},$(LN))"
[ -n "$${IPKG_INSTROOT}" ] && {
$${HOST_SED} 's,^src/gz istoreos_,src/gz openwrt_,g' -e '/^src\/gz openwrt_\(core\|base\|kmods\|luci\|packages\|routing\|telephony\) /!d' "$${IPKG_INSTROOT}/etc/opkg/distfeeds.conf"
$${HOST_SED} 's/"192.168.1.1"/"192.168.100.1"/' \
"$${IPKG_INSTROOT}/usr/lib/lua/luci/controller/admin/system.lua" \
"$${IPKG_INSTROOT}/usr/lib/lua/luci/controller/admin/ota.lua" \
"$${IPKG_INSTROOT}/bin/config_generate"
$${HOST_SED} "s/'192\\.168\\.1\\.1'/'192.168.100.1'/; s/'openwrt\\.lan'/window.location.host/" "$${IPKG_INSTROOT}/www/luci-static/resources/view/system/flash.js"
$${HOST_SED} 's/s\.anonymous = true/s\.anonymous = true\ns\.addremove = true/' "$${IPKG_INSTROOT}/usr/lib/lua/luci/model/cbi/hd_idle.lua"
$${HOST_SED} 's#"/opt"#"/overlay/upper/opt/docker"#' "$${IPKG_INSTROOT}/usr/lib/lua/luci/model/cbi/admin_system/fstab/mount.lua"
rm -f "$${IPKG_INSTROOT}/sbin/jffs2reset"
$${HOST_LN} /sbin/firstboot "$${IPKG_INSTROOT}/sbin/jffs2reset"
$${HOST_SED} '/<link rel="shortcut icon" href="<%=media%>\/favicon.ico">/a <link rel="stylesheet" href="<%=resource%>/easepi/easeicon.css?t=1649313193968">' \
"$${IPKG_INSTROOT}/usr/lib/lua/luci/view/themes/argon/header.htm" \
"$${IPKG_INSTROOT}/usr/lib/lua/luci/view/themes/argon_dark/header.htm" \
"$${IPKG_INSTROOT}/usr/lib/lua/luci/view/themes/argon_light/header.htm" \
"$${IPKG_INSTROOT}/usr/lib/lua/luci/view/themes/argon_dark_purple/header.htm" \
"$${IPKG_INSTROOT}/usr/lib/lua/luci/view/themes/argon_light_green/header.htm"
rm -f "$${IPKG_INSTROOT}/etc/uci-defaults/luci-argon-config"
}
true
endef
define Package/istoreos-intl/install
$(CP) ./intl/* $(1)/
endef
$(eval $(call BuildPackage,istoreos-files))
$(eval $(call BuildPackage,istoreos-intl))

View File

@ -0,0 +1,18 @@
#!/bin/sh
#
# Copyright (C) 2018 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
board_config_update
ucidef_set_hostname "iStoreOS"
ucidef_set_timezone "CST-8"
ucidef_set_ntpserver "0.cn.pool.ntp.org" "1.cn.pool.ntp.org" "2.cn.pool.ntp.org" "3.cn.pool.ntp.org"
board_config_flush
exit 0

View File

@ -0,0 +1 @@
# see https://man7.org/linux/man-pages/man5/crontab.5.html

View File

@ -0,0 +1,3 @@
if [ "$ACTION" = "add" ]; then
[ "`uci -q get fstab.@global[0].port_mount`" = "1" ] && /usr/libexec/blockmount.sh
fi

View File

@ -0,0 +1,58 @@
#!/bin/sh
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" -a -z "$IFUPDATE_DATA" ] && exit 0
[ "$INTERFACE" = wan ] || exit 0
uci -q get firewall.allow_wan_input || exit 0
is_private_ipv4() {
local ADDRESS="$1"
local MASK="$2"
local IP NETMASK BROADCAST NETWORK PREFIX
if [ "$MASK" -ge 8 ]; then
NETWORK=
eval $(ipcalc.sh "$ADDRESS/8")
[ "$NETWORK" = "10.0.0.0" ] && return 0
fi
if [ "$MASK" -ge 12 ]; then
NETWORK=
eval $(ipcalc.sh "$ADDRESS/12")
[ "$NETWORK" = "172.16.0.0" ] && return 0
fi
if [ "$MASK" -ge 16 ]; then
NETWORK=
eval $(ipcalc.sh "$ADDRESS/16")
[ "$NETWORK" = "192.168.0.0" ] && return 0
fi
return 1
}
WAN_IS_PRIVATE=false
(
ADDRESS=
MASK=
PROTO=
UP=
eval $(ifstatus wan | jsonfilter \
-e 'ADDRESS=@["ipv4-address"][0].address' \
-e 'MASK=@["ipv4-address"][0].mask' \
-e 'PROTO=@.proto' \
-e 'UP=@.up'
)
logger -t allow_wan_input "WAN up:$UP proto:$PROTO ip:$ADDRESS mask:$MASK"
[ "$PROTO" = dhcp ] || exit 1
[ -n "$ADDRESS" -a -n "$MASK" ] || exit 1
is_private_ipv4 "$ADDRESS" "$MASK"
) && WAN_IS_PRIVATE=true
if $WAN_IS_PRIVATE ; then
logger -t allow_wan_input "Enable allow_wan_input rule for private address"
uci delete firewall.allow_wan_input.enabled
else
logger -t allow_wan_input "Disable allow_wan_input rule for public address"
uci set firewall.allow_wan_input.enabled=0
fi
uci commit firewall

View File

@ -0,0 +1,27 @@
#!/bin/sh /etc/rc.common
START=11
USE_PROCD=1
auto_mount() {
[ "`uci -q get fstab.@global[0].port_mount`" = "1" ] && /usr/libexec/blockmount.sh
return 0
}
boot() {
auto_mount
start "$@"
}
service_triggers() {
procd_add_reload_trigger "fstab"
}
reload_service() {
auto_mount
}
start_service() {
return 0
}

View File

@ -0,0 +1,23 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
STOP=00
shutdown() {
local message="System Shutting Down"
logger -s -t "DEBUG" "$message"
logger -t "DEBUG" "$message"
local consoles="$(cat /sys/class/tty/console/active)"
[ -n "$consoles" ] || consoles=console
for console in $consoles; do
[ -c "/dev/$console" ] && echo "$message" >"/dev/$console"
done
# blink led
. /etc/diag.sh
[ -n "$running" ] && {
status_led="$running"
status_led_blink_preinit_regular
}
}

View File

@ -0,0 +1,22 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2016 OpenWrt.org
START=49
list_langs() {
cd /usr/lib/lua/luci/i18n
ls | sed -e 's/.*\.\([^\.]*\)\.lmo/\1/g' | sort -u
}
boot() {
local lang
local name
for lang in `list_langs`
do
if ! uci get luci.languages.${lang//-/_} >/dev/null 2>&1; then
name=`luci18n2name $lang`
uci set "luci.languages.${lang//-/_}=${name:-$lang}"
fi
done
uci changes luci | grep -Fqm1 luci 2>/dev/null && uci commit luci >/dev/null 2>&1
}

View File

@ -0,0 +1,32 @@
#!/bin/sh /etc/rc.common
START=97
check_kernel() {
local major=$1
local minor=$2
[ "$major" -gt 5 -o \( "$major" -eq 5 -a "$minor" -ge 4 \) ]
}
boot() {
if check_kernel `uname -r | grep -Eo '[0-9]+\.[0-9]+' | sed 's/\./ /g'`; then
if [ ! -f /usr/lib/samba/vfs/io_uring.so ]; then
if [ -f /usr/lib/samba/vfs/io_uring.so.bak ]; then
mv /usr/lib/samba/vfs/io_uring.so.bak /usr/lib/samba/vfs/io_uring.so
elif [ -f /rom/usr/lib/samba/vfs/io_uring.so ]; then
mkdir -p /usr/lib/samba/vfs
cp -a /rom/usr/lib/samba/vfs/io_uring.so /usr/lib/samba/vfs/io_uring.so
cat /usr/lib/samba/vfs/io_uring.so >/dev/null
rm -f /overlay/upper/usr/lib/samba/vfs/io_uring.so
fi
fi
rm -f /usr/lib/samba/vfs/io_uring.so.bak
elif [ -f /usr/lib/samba/vfs/io_uring.so ]; then
rm -f /usr/lib/samba/vfs/io_uring.so.bak
if [ ! -d /overlay/upper -o -f /overlay/upper/usr/lib/samba/vfs/io_uring.so ]; then
mv /usr/lib/samba/vfs/io_uring.so /usr/lib/samba/vfs/io_uring.so.bak
else
rm -f /usr/lib/samba/vfs/io_uring.so
fi
fi
}

View File

@ -0,0 +1,13 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
STOP=89
shutdown() {
/etc/init.d/dockerman stop 2>/dev/null
/etc/init.d/dockerd stop 2>/dev/null
/etc/init.d/netdata stop 2>/dev/null
while /usr/bin/umount -R -d /overlay/upper/opt/docker; do true; done
}

View File

@ -0,0 +1,108 @@
#!/bin/sh /etc/rc.common
# istoreos upgrade post process
# Copyright (C) 2022 jjm2473
START=14
split_opkg_status() {
local line
local gap=1
exec 3>/dev/null
rm -rf $2
mkdir -p $2
cat $1 | while read; do
line="$REPLY"
if [ -z "$line" ]; then
echo >&3
exec 3>&-
exec 3>/dev/null
gap=1
else
if [[ "x1" = "x$gap" && "$line" = "Package: *" ]]; then
exec 3>&-
exec 3>$2/${line##Package: }
gap=0
fi
echo "$line" >&3
fi
done
exec 3>&-
}
split_both_status() {
split_opkg_status /usr/lib/opkg/status /tmp/newopkgstatus &
split_opkg_status /rom/usr/lib/opkg/status /tmp/romopkgstatus &
wait
}
ls_all_pkgs() {
( cd /usr/lib/opkg/info ; find . -maxdepth 1 -name '*.control' | sed -E 's#./(.*).control#\1#g' | grep -v '^kernel$' )
}
rebuild_opkg_status() {
local DUMMY_VERSION=0.0.0-r1
local line
[ -f /tmp/romopkgstatus/kernel ] && cat /tmp/romopkgstatus/kernel
ls_all_pkgs | while read line; do
if [ -f /overlay/upper/usr/lib/opkg/info/$line.control -o -f /ext_overlay/upper/usr/lib/opkg/info/$line.control ]; then
if [[ $line = "kmod-*" ]] && \
grep -qm1 '^Version: '$DUMMY_VERSION'$' /usr/lib/opkg/info/$line.control; then
[ -e /tmp/romopkgstatus/$line ] && echo /tmp/romopkgstatus/$line
else
echo /tmp/newopkgstatus/$line
fi
else
echo /tmp/romopkgstatus/$line
fi
done | xargs cat
}
clean_tmp_files() {
rm -rf /tmp/newopkgstatus
rm -rf /tmp/romopkgstatus
}
clean_themes() {
local line
local name
local path
uci show luci.themes | tail -n +2 | sed "s/^luci.themes.//g; s/'//g" | while read; do
line="$REPLY"
name=`echo "$line" | cut -d= -f 1`
path=`echo "$line" | cut -d= -f 2`
[ "x$path" != "x" -a -d /www$path ] || uci delete "luci.themes.$name"
done
uci commit luci
}
is_overlayed() {
[ -e "/overlay/upper$1" -o -e "/ext_overlay/upper$1" ]
}
upgrade_opkg_distfeeds() {
local newrelease=$(grep -m1 '/base$' /rom/etc/opkg/distfeeds.conf | grep -Eo '/releases/[^/]+/')
local oldrelease=$(grep -m1 '/base$' /etc/opkg/distfeeds.conf | grep -Eo '/releases/[^/]+/')
[ -z "$newrelease" -o -z "$oldrelease" ] && return 0
[ "$newrelease" = "$oldrelease" ] && return 0
sed -i -e 's#'"$oldrelease"'#'"$newrelease"'#g' /etc/opkg/distfeeds.conf
}
boot() {
[ -f /.recovery_mode ] && return 0
if [ -f /usr/lib/opkg/.upgrading ]; then
rm -f /usr/lib/opkg/.upgrading
is_overlayed /usr/lib/opkg/status && {
split_both_status
rebuild_opkg_status > /usr/lib/opkg/status
clean_tmp_files
}
is_overlayed /etc/config/luci && {
clean_themes
}
is_overlayed /etc/opkg/distfeeds.conf && {
upgrade_opkg_distfeeds
}
fi
rm -f /overlay/upper/.upgrading
}

View File

@ -0,0 +1,26 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2016 OpenWrt.org
START=20
USE_PROCD=1
start_service() {
/etc/init.d/wan_drop enabled || return 0
local PROTO=`uci get network.wan.proto`
logger -t 'wan_drop' "current proto $PROTO"
if [ "$PROTO" = "pppoe" ]; then
WAN_ZONE=`uci show firewall | grep -E '^firewall\.@zone\[[0-9]+\]\.name='"'wan'" | head -n1 | head -c -12`
if [ "`uci get ${WAN_ZONE}.input`" = "ACCEPT" ]; then
logger -t 'wan_drop' "set firewall drop input from wan"
uci -q batch <<-EOF >/dev/null
set ${WAN_ZONE}.input=DROP
commit firewall
EOF
/etc/init.d/firewall reload >/dev/null
fi
fi
}
service_triggers() {
procd_add_reload_trigger "network"
}

View File

@ -0,0 +1,20 @@
#!/bin/sh /etc/rc.common
# 2022 jjm2473
START=99
boot() {
# tune printk level after success boot, avoid noise in console
echo '4 5 1 7' > /proc/sys/kernel/printk
# notify console system is ready
sleep 1
local pids=`pgrep -P 1 askfirst 2>/dev/null`
if [ -n "$pids" ]; then
local pid
for pid in $pids; do
echo "iStoreOS is ready!" >/proc/$pid/fd/1
echo "Please press Enter to activate this console." >/proc/$pid/fd/1
done
fi
}

View File

@ -0,0 +1,4 @@
net.netfilter.nf_conntrack_max=65535
net.netfilter.nf_conntrack_helper=1
net.netfilter.nf_conntrack_buckets=16384
net.netfilter.nf_conntrack_expect_max=16384

View File

@ -0,0 +1,87 @@
#!/bin/sh
# Copyright (C) 2022 jjm2473
if [ ! -f /etc/config/fstab ]; then
/usr/libexec/blockmount.sh detect 2>/dev/null
fi
uci -q batch <<-EOF >/dev/null
set system.@system[-1].zonename='Asia/Shanghai'
commit system
EOF
uci set dockerd.globals.data_root=/overlay/upper/opt/docker
if grep -qFw nas /proc/device-tree/chosen/default-firewall; then
WAN_ZONE=`uci show firewall | grep -E '^firewall\.@zone\[[0-9]+\]\.name='"'wan'" | head -n1 | head -c -12`
uci -q batch <<-EOF >/dev/null
del_list dockerd.firewall.blocked_interfaces=wan
set ${WAN_ZONE}.input=ACCEPT
commit firewall
EOF
uci -q batch <<-EOF >/dev/null
delete ucitrack.@wan_drop[-1]
add ucitrack wan_drop
set ucitrack.@wan_drop[-1].init=wan_drop
commit ucitrack
EOF
else
/etc/init.d/wan_drop disable
if grep -qFw dual /proc/device-tree/chosen/default-firewall; then
# firewall.allow_wan_input will auto enabled by /etc/hotplug.d/iface/19-fw-wan-input
uci -q batch <<-EOF >/dev/null
set firewall.allow_wan_input=rule
set firewall.allow_wan_input.name='Allow-WAN-Input'
set firewall.allow_wan_input.proto='all'
set firewall.allow_wan_input.src='wan'
set firewall.allow_wan_input.target='ACCEPT'
set firewall.allow_wan_input.enabled='0'
commit firewall
EOF
fi
fi
if ! grep -qFw router /proc/device-tree/chosen/default-firewall; then
WAN_IF=`jsonfilter -i /etc/board.json -e '@.network.wan.device'`
if [ -n "$WAN_IF" -a -e /etc/config/minidlna ]; then
uci -q batch <<-EOF >/dev/null
set minidlna.@minidlna[0].interface='br-lan,$WAN_IF'
commit minidlna
EOF
fi
if [ -e /etc/config/ttyd ]; then
uci -q batch <<-EOF >/dev/null
delete ttyd.@ttyd[0].interface
commit ttyd
EOF
fi
for samba in samba4 samba ; do
if [ -e /etc/config/$samba ]; then
uci -q batch <<-EOF >/dev/null
set $samba.@samba[0].interface='lan wan'
commit $samba
EOF
fi
done
fi
uci -q batch <<-EOF >/dev/null
commit dockerd
EOF
uci -q batch <<-EOF >/dev/null
set luci.apply.rollback=30
set luci.apply.holdoff=2
commit luci
EOF
if [ -f /etc/config/argon ]; then
uci -q batch <<-EOF >/dev/null
set argon.@global[0].mode=light
commit argon
EOF
fi
exit 0

View File

@ -0,0 +1,10 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete upnpd.config.use_stun
set upnpd.config.stun_host='stun.sipgate.net'
set upnpd.config.force_forwarding='1'
commit upnpd
EOF
exit 0

View File

@ -0,0 +1,15 @@
#!/bin/sh
uci -q batch <<-EOF
set firewall.docker_nat=nat
set firewall.docker_nat.name='DockerNAT'
set firewall.docker_nat.family='ipv4'
set firewall.docker_nat.proto='all'
set firewall.docker_nat.src='lan'
set firewall.docker_nat.target='MASQUERADE'
set firewall.docker_nat.extra='-i docker0'
set firewall.docker_nat.src_ip='172.16.0.0/12'
commit firewall
EOF
exit 0

View File

@ -0,0 +1,24 @@
#!/bin/sh
mediaurlbase=
theme=
if [ -d /www/luci-static/argon_light_green -a -e /proc/device-tree/chosen/default-password ]; then
mediaurlbase=/luci-static/argon_light_green
else
for theme in argon argon_dark material ; do
if [ -d /www/luci-static/$theme ]; then
mediaurlbase=/luci-static/$theme
break
fi
done
fi
if [ -n "$mediaurlbase" ]; then
uci -q batch <<-EOF >/dev/null
set luci.main.mediaurlbase=$mediaurlbase
commit luci
EOF
fi
exit 0

View File

@ -0,0 +1,4 @@
failsafe_dropbear () {
cp -a /etc/dropbear/dropbear_failsafe_host_key /tmp/dropbear_failsafe_host_key
dropbear -r /tmp/dropbear_failsafe_host_key <> /dev/null 2>&1
}

View File

@ -0,0 +1,45 @@
#!/bin/sh
# author: jjm2473
toname() {
local lang_ar="العربية (Arabic)"
local lang_bg="български (Bulgarian)"
local lang_bn="বাংলা (Bengali)"
local lang_ca="Català (Catalan)"
local lang_cs="Čeština (Czech)"
local lang_da="Dansk (Danish)"
local lang_de="Deutsch (German)"
local lang_el="Ελληνικά (Greek)"
local lang_en="English"
local lang_es="Español (Spanish)"
local lang_fi="Suomi (Finnish)"
local lang_fr="Français (French)"
local lang_he="עִבְרִית (Hebrew)"
local lang_hi="हिंदी (Hindi)"
local lang_hu="Magyar (Hungarian)"
local lang_it="Italiano (Italian)"
local lang_ja="日本語 (Japanese)"
local lang_ko="한국어 (Korean)"
local lang_mr="Marāṭhī (Marathi)"
local lang_ms="Bahasa Melayu (Malay)"
local lang_no="Norsk (Norwegian)"
local lang_nl="Nederlands (Dutch)"
local lang_pl="Polski (Polish)"
local lang_pt_br="Português do Brasil (Brazilian Portuguese)"
local lang_pt="Português (Portuguese)"
local lang_ro="Română (Romanian)"
local lang_ru="Русский (Russian)"
local lang_sk="Slovenčina (Slovak)"
local lang_sv="Svenska (Swedish)"
local lang_tr="Türkçe (Turkish)"
local lang_uk="Українська (Ukrainian)"
local lang_vi="Tiếng Việt (Vietnamese)"
local lang_zh_cn="简体中文 (Chinese Simplified)"
local lang_zh_tw="繁體中文 (Chinese Traditional)"
eval "[ -n \"\${lang_$1}\" ] && echo \${lang_$1}"
}
if [ -n "$1" ]; then
toname ${1//-/_}
fi

View File

@ -0,0 +1,10 @@
-- Copyright 2022 jjm2473 <jjm2473@gmail.com>
-- Licensed to the public under the Apache License 2.0.
module("luci.controller.admin.compat", package.seeall)
function action_fatab()
local dsp = require "luci.dispatcher"
luci.http.redirect(dsp.build_url("admin/system/mounts"))
end

View File

@ -0,0 +1,117 @@
#!/bin/sh
DETECT=0
if [ -z "$ACTION" ]; then
log() {
echo "$*" >&2
}
else
log() {
logger -t "blockmount" "$*"
}
fi
# uci_section UUID LABEL DEVICE MOUNTPOINT
check_mount() {
local uuid
local label
local device
local target
config_get uuid $1 uuid
config_get label $1 label
config_get device $1 device
config_get target $1 target
if [ "$DEVICE_CONFIGURED" = "0" -a \( "$uuid" = "$2" -o "$device" = "$4" -o "$target" = "$5" -o \( -n "$3" -a "$3" = "$label" \) \) ]; then
export -n DEVICE_CONFIGURED=1
[ -z "$ACTION" ] && log "found $1 ($uuid, $label, $device, $target) matches ($2, $3, $4, $5)"
fi
}
# UUID LABEL DEVICE MOUNTPOINT
check_configured() {
local DEVICE_CONFIGURED=0
config_foreach check_mount mount "$1" "$2" "$3" "$4"
return $DEVICE_CONFIGURED
}
handle_part() {
[ -z "$ACTION" ] && log "$1 UUID=$UUID TYPE=$TYPE LABEL=$LABEL MOUNT=$MOUNT"
[ -n "$1" ] || return 1
# ignore mounted device, unknown fs type, swap or raid member
[ -z "$UUID" -o -z "$TYPE" \
-o "$TYPE" = "swap" \
-o "$TYPE" = "linux_raid_member" \
] && return 0
if [ "$DETECT" = "1" ]; then
[ -z "$MOUNT" ] && return 0
# in this case, only add mounted device: boot,root,overlayfs, and disable them
log "add mount $UUID => $MOUNT"
uci -q batch <<-EOF >/dev/null
add fstab mount
set fstab.@mount[-1].uuid=$UUID
set fstab.@mount[-1].target=$MOUNT
set fstab.@mount[-1].enabled=0
EOF
elif [ -z "$MOUNT" ]; then
local DEVICENAME="${1#/dev/}"
local candidate="`/usr/libexec/blockphy.sh "$DEVICENAME"`"
[ -z "$candidate" ] && return 0
candidate="/mnt/$candidate"
# check if candidate mount point is busy
mountpoint -q "$candidate" && return 0
# check if configured
check_configured "$UUID" "$LABEL" "$1" "$candidate" || return 0
# log "add mount $UUID => $candidate"
mkdir -p "$candidate" && mount "$1" "$candidate"
fi
}
scan_all() {
local line
local dev
if [ "$DETECT" = "0" -a -n "$DEVNAME" ]; then
dev="/dev/$DEVNAME"
fi
block info $dev | while read; do
line="$REPLY"
eval "${line##*: } handle_part ${line%%: *}"
done
}
if [ "$1" = "detect" ]; then
DETECT=1
cat <<-EOF >/etc/config/fstab
config global
option anon_swap '0'
option anon_mount '0'
option port_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'
EOF
fi
. /lib/functions.sh
config_load fstab
scan_all
if [ "$DETECT" = "1" ]; then
uci -q batch <<-EOF >/dev/null
set fstab.@global[0].port_mount=1
commit fstab
EOF
fi

View File

@ -0,0 +1,82 @@
#!/bin/sh
DEVNAME=${1#/dev/}
[ -z "$DEVNAME" ] && exit 1
getdisk() {
local DISK=$1
local path=`readlink /sys/block/$DISK`
local usb=`echo "$path" | grep -oE '/usb[0-9]+/[^:]+'`
if [ -n "$usb" ]; then
usb=${usb##*/}
usb=${usb%%-1}
echo usb`echo "$usb" | sed 's/[-.]/_/g'`
return 0
fi
case "$DISK" in
mmcblk*)
echo "$path" | grep -oE '/mmc[0-9]+/'
return 0
;;
nvme*)
echo "/$DISK/"
return 0
;;
esac
# sata
local sata=`echo "$path" | grep -oE '/ata[0-9]+/host[0-9]+/target[0-9]+:[0-9]+'`
if [ -n "$sata" ]; then
sata=`echo "$sata" | sed -r 's#/ata([0-9]+)/host[0-9]+/target[0-9]+:([0-9]+)#sata\1.\2#'`
sata=${sata%%.0}
echo "/$sata/"
return 0
fi
# virtio
sata=`echo "$path" | grep -oE '/virtio[0-9]+/host[0-9]+/target[0-9]+:[0-9]+:[0-9]+'`
if [ -n "$sata" ]; then
sata=`echo "$sata" | sed -r 's#/virtio([0-9]+)/host[0-9]+/target[0-9]+:[0-9]+:([0-9]+)#vio\1.\2#'`
sata=${sata%%.0}
echo "/$sata/"
return 0
fi
# sas
sata=`echo "$path" | grep -oE '/host[0-9]+/port-[0-9]+:[0-9]+'`
if [ -n "$sata" ]; then
sata=`echo "$sata" | sed -r 's#/host([0-9]+)/port-[0-9]+:([0-9]+)#sas\1.\2#'`
sata=${sata%%.0}
echo "/$sata/"
return 0
fi
# scsi
sata=`echo "$path" | grep -oE '/host[0-9]+/target[0-9]+:[0-9]+:[0-9]+'`
if [ -n "$sata" ]; then
sata=`echo "$sata" | sed -r 's#/host([0-9]+)/target[0-9]+:[0-9]+:([0-9]+)#scsi\1.\2#'`
sata=${sata%%.0}
echo "/$sata/"
return 0
fi
echo "$path" | grep -oE '/host[0-9]+/' | sed 's/host/sata/g'
return 0
}
getphy() {
[ -e /sys/block/$1 ] || return 1
local disk=`getdisk $1`
disk=${disk#/}
echo "${disk%/}-${2:-0}"
}
# sd[a-z]+([0-9]+)?
# mmcblk[0-9]+(p[0-9]+)?
# nvme[0-9]+n[0-9]+(p[0-9]+)?
case "$DEVNAME" in
sd*)
getphy `echo "$DEVNAME" | sed -r 's/^(sd[a-z]+)([0-9]+)?$/\1 \2/g'` ;;
mmcblk*)
getphy `echo "$DEVNAME" | sed -r 's/^(mmcblk[0-9]+)(p([0-9]+))?$/\1 \3/g'` ;;
nvme*)
getphy `echo "$DEVNAME" | sed -r 's/^(nvme[0-9]+n[0-9]+)(p([0-9]+))?$/\1 \3/g'` ;;
*)
exit 1;
esac

View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ -x /rom/usr/bin/curl ]; then
/usr/bin/curl -V >/dev/null 2>&1 && exec /usr/bin/curl "$@"
exec /rom/usr/bin/curl "$@"
fi
exec /usr/bin/curl "$@"

View File

@ -0,0 +1,9 @@
{
"admin/system/fstab": {
"action": {
"type": "call",
"module": "luci.controller.admin.compat",
"function": "action_fatab"
}
}
}

View File

@ -0,0 +1,57 @@
@font-face {
font-family: "easeicon"; /* Project id 3156136 */
src: url('iconfont.woff2?t=1642756089463') format('woff2'),
url('iconfont.woff?t=1642756089463') format('woff'),
url('iconfont.ttf?t=1642756089463') format('truetype');
}
.easeicon {
font-family: "easeicon" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.eicon-store:before {
content: "\e60f";
}
.eicon-docker:before {
content: "\e659";
}
.eicon-network:before {
content: "\ecc7";
}
.eicon-dashboard:before {
content: "\e664";
}
.main>.main-left>.nav>li.slide>.menu[data-title=Docker]:before {
font-family: 'easeicon' !important;
content: "\e659" !important;
color: #0c93f3;
}
.main>.main-left>.nav>li.slide>.menu[data-title=iStore]:before,
.main>.main-left>.nav>li>a[data-title=iStore]:before {
font-family: 'easeicon' !important;
content: "\e60f" !important;
color: #8965e0;
}
.main>.main-left>.nav>li.slide>.menu[data-title=QuickStart]:before,
.main>.main-left>.nav>li>a[data-title=QuickStart]:before {
font-family: 'easeicon' !important;
content: "\e664" !important;
color: #11cdef;
}
.main>.main-left>.nav>li.slide>.menu[data-title=NetworkGuide]:before,
.main>.main-left>.nav>li>a[data-title=NetworkGuide]:before {
font-family: 'easeicon' !important;
content: "\ecc7" !important;
color: #fb6340;
}

View File

@ -0,0 +1,30 @@
if PACKAGE_istoreos-files
config PACKAGE_istoreos-files_CUSTOMIZE_SETTINGS
bool
default y
select LUCI_LANG_zh_Hans
select KERNEL_PROC_PAGE_MONITOR
select BUSYBOX_CUSTOM
select BUSYBOX_CONFIG_TOP
select BUSYBOX_CONFIG_FEATURE_TOPMEM # top -m
select BUSYBOX_CONFIG_DD
select BUSYBOX_CONFIG_FEATURE_DD_SIGNAL_HANDLING
select BUSYBOX_CONFIG_FEATURE_DD_THIRD_STATUS_LINE # dd show speed
config LUCI_LANG_zh-cn
tristate
default LUCI_LANG_zh_Hans
config LUCI_LANG_zh-tw
tristate
default LUCI_LANG_zh_Hant
config LUCI_LANG_pt-br
tristate
default LUCI_LANG_pt_BR
config LUCI_LANG_no
tristate
default LUCI_LANG_nb_NO
config LUCI_LANG_bn
tristate
default LUCI_LANG_bn_BD
endif

View File

@ -0,0 +1 @@
# dummy file

View File

@ -54,7 +54,7 @@ define Package/kernel
TITLE:=Virtual kernel package
VERSION:=$(LINUX_VERSION)~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE)
URL:=http://www.kernel.org/
PKG_FLAGS:=nonshared
PKG_FLAGS:=nonshared hold
endef
define Package/kernel/install

View File

@ -93,6 +93,8 @@ define KernelPackage/ata-ahci-dwc
TITLE:=Synopsys DWC AHCI SATA
KCONFIG:= \
CONFIG_AHCI_DWC \
CONFIG_SATA_PMP=y \
CONFIG_SATA_PMP_LEDS=y \
CONFIG_SATA_HOST=y
FILES:=$(LINUX_DIR)/drivers/ata/ahci_dwc.ko
DEPENDS:=+kmod-ata-ahci-platform
@ -205,10 +207,15 @@ $(eval $(call KernelPackage,block2mtd))
define KernelPackage/dax
SUBMENU:=$(BLOCK_MENU)
TITLE:=DAX: direct access to differentiated memory
KCONFIG:=CONFIG_DAX
KCONFIG:=CONFIG_DAX=y
FILES:=$(LINUX_DIR)/drivers/dax/dax.ko
endef
define KernelPackage/dax/install
$(INSTALL_DIR) $(1)/lib/modules/!ventoy
echo "DUMMY" >$(1)/lib/modules/!ventoy/dax.ko
endef
$(eval $(call KernelPackage,dax))
@ -231,7 +238,8 @@ define KernelPackage/dm
CONFIG_DM_SNAPSHOT=n \
CONFIG_DM_LOG_USERSPACE=n \
CONFIG_MD=y \
CONFIG_BLK_DEV_DM \
CONFIG_BLK_DEV_DM=y \
CONFIG_DM_INIT=y \
CONFIG_DM_CRYPT \
CONFIG_DM_MIRROR
FILES:= \
@ -247,6 +255,11 @@ define KernelPackage/dm/description
Kernel module necessary for LVM2 support
endef
define KernelPackage/dm/install
$(INSTALL_DIR) $(1)/lib/modules/!ventoy
echo "DUMMY" >$(1)/lib/modules/!ventoy/dm-mod.ko
endef
$(eval $(call KernelPackage,dm))
define KernelPackage/dm-raid
@ -293,6 +306,33 @@ endef
$(eval $(call KernelPackage,iscsi-initiator))
define KernelPackage/libfc
TITLE:=LibFC module
DEPENDS:=+kmod-scsi-core
KCONFIG:= \
CONFIG_LIBFC \
CONFIG_SCSI_FC_ATTRS=y
HIDDEN:=1
FILES:= \
$(LINUX_DIR)/drivers/scsi/libfc/libfc.ko
endef
$(eval $(call KernelPackage,libfc))
define KernelPackage/libfcoe
TITLE:=LibFCoE module
DEPENDS:=+kmod-libfc
KCONFIG:= \
CONFIG_LIBFCOE
HIDDEN:=1
FILES:= \
$(LINUX_DIR)/drivers/scsi/fcoe/libfcoe.ko
endef
$(eval $(call KernelPackage,libfcoe))
define KernelPackage/md-mod
SUBMENU:=$(BLOCK_MENU)
TITLE:=MD RAID
@ -472,6 +512,25 @@ endef
$(eval $(call KernelPackage,loop))
define KernelPackage/mpt3sas
SUBMENU:=$(BLOCK_MENU)
TITLE:=LSI MPT Fusion SAS 3.0 & SAS 2.0 Device Driver
DEPENDS:=@TARGET_x86 +kmod-libsas +kmod-scsi-core +kmod-scsi-raid
KCONFIG:= \
CONFIG_SCSI_MPT3SAS \
CONFIG_SCSI_MPT2SAS_MAX_SGE=128 \
CONFIG_SCSI_MPT3SAS_MAX_SGE=128
FILES:=$(LINUX_DIR)/drivers/scsi/mpt3sas/mpt3sas.ko
AUTOLOAD:=$(call AutoLoad,40,mpt3sas,1)
endef
define KernelPackage/mpt3sas/description
Kernel support for the Marvell SAS SCSI adapters
endef
$(eval $(call KernelPackage,mpt3sas))
define KernelPackage/mvsas
SUBMENU:=$(BLOCK_MENU)
TITLE:=Marvell 88SE6440 SAS/SATA driver
@ -528,6 +587,20 @@ endef
$(eval $(call KernelPackage,nvme))
define KernelPackage/qedf
SUBMENU:=$(BLOCK_MENU)
TITLE:=QLogic QEDF 25/40/100Gb FCoE Initiator Driver Support
DEPENDS:=@PCI_SUPPORT +kmod-qed +kmod-libfcoe
KCONFIG:= \
CONFIG_QEDF
FILES:= \
$(LINUX_DIR)/drivers/scsi/qedf/qedf.ko
AUTOLOAD:=$(call AutoProbe,qedf)
endef
$(eval $(call KernelPackage,qedf))
define KernelPackage/scsi-core
SUBMENU:=$(BLOCK_MENU)
TITLE:=SCSI device support
@ -559,6 +632,19 @@ endef
$(eval $(call KernelPackage,scsi-generic))
define KernelPackage/scsi-raid
SUBMENU:=$(BLOCK_MENU)
TITLE:=RAID Domain Transport Attributes
DEPENDS:=+kmod-scsi-core
KCONFIG:= \
CONFIG_RAID_ATTRS
FILES:= \
$(LINUX_DIR)/drivers/scsi/raid_class.ko
endef
$(eval $(call KernelPackage,scsi-raid))
define KernelPackage/cdrom
TITLE:=Kernel library module for CD / DVD drives
KCONFIG:=CONFIG_CDROM

View File

@ -135,6 +135,20 @@ endef
$(eval $(call KernelPackage,fs-cifs))
define KernelPackage/fs-binfmt-misc
SUBMENU:=$(FS_MENU)
TITLE:=MISC binaries support
KCONFIG:= \
CONFIG_BINFMT_MISC
FILES:=$(LINUX_DIR)/fs/binfmt_misc.ko
AUTOLOAD:=$(call AutoLoad,30,binfmt_misc)
endef
define KernelPackage/fs-binfmt-misc/description
Kernel module for MISC binaries support
endef
$(eval $(call KernelPackage,fs-binfmt-misc))
define KernelPackage/fs-configfs
SUBMENU:=$(FS_MENU)

View File

@ -958,7 +958,7 @@ define KernelPackage/r8169
CONFIG_R8169 \
CONFIG_R8169_LEDS=y
FILES:=$(LINUX_DIR)/drivers/net/ethernet/realtek/r8169.ko
AUTOLOAD:=$(call AutoProbe,r8169)
AUTOLOAD:=$(call AutoLoad,35,r8169)
endef
define KernelPackage/r8169/description
@ -992,7 +992,7 @@ define KernelPackage/e100
DEPENDS:=@PCI_SUPPORT +kmod-mii +e100-firmware
KCONFIG:=CONFIG_E100
FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/e100.ko
AUTOLOAD:=$(call AutoProbe,e100)
AUTOLOAD:=$(call AutoLoad,35,e100)
endef
define KernelPackage/e100/description
@ -1026,7 +1026,7 @@ define KernelPackage/e1000e
DEPENDS:=@PCIE_SUPPORT +kmod-ptp
KCONFIG:=CONFIG_E1000E
FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/e1000e/e1000e.ko
AUTOLOAD:=$(call AutoProbe,e1000e)
AUTOLOAD:=$(call AutoLoad,35,e1000e)
MODPARAMS.e1000e:= \
IntMode=1 \
InterruptThrottleRate=4,4,4,4,4,4,4,4
@ -1084,7 +1084,7 @@ define KernelPackage/ixgbe
CONFIG_IXGBE_HWMON=y \
CONFIG_IXGBE_DCA=n
FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/ixgbe/ixgbe.ko
AUTOLOAD:=$(call AutoLoad,35,ixgbe)
AUTOLOAD:=$(call AutoLoad,36,ixgbe)
endef
define KernelPackage/ixgbe/description
@ -1103,7 +1103,7 @@ define KernelPackage/ixgbevf
CONFIG_IXGBE_HWMON=y \
CONFIG_IXGBE_DCA=n
FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/ixgbevf/ixgbevf.ko
AUTOLOAD:=$(call AutoLoad,35,ixgbevf)
AUTOLOAD:=$(call AutoLoad,36,ixgbevf)
endef
define KernelPackage/ixgbevf/description
@ -1122,7 +1122,7 @@ define KernelPackage/i40e
CONFIG_I40E_HWMON=y \
CONFIG_I40E_DCA=n
FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/i40e/i40e.ko
AUTOLOAD:=$(call AutoProbe,i40e)
AUTOLOAD:=$(call AutoLoad,35,i40e)
endef
define KernelPackage/i40e/description
@ -1722,6 +1722,37 @@ endef
$(eval $(call KernelPackage,net-selftests))
define KernelPackage/qed
TITLE:=QLogic QED 25/40/100Gb core driver
DEPENDS:=@PCI_SUPPORT +kmod-lib-zlib-inflate +kmod-lib-crc8 +qed-firmware
KCONFIG:= \
CONFIG_QED \
CONFIG_QED_SRIOV=y
HIDDEN:=1
FILES:=$(LINUX_DIR)/drivers/net/ethernet/qlogic/qed/qed.ko
endef
$(eval $(call KernelPackage,qed))
define KernelPackage/qede
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=QLogic QED 25/40/100Gb Ethernet NIC support
DEPENDS:=@PCI_SUPPORT +kmod-qed +kmod-ptp
KCONFIG:= \
CONFIG_QEDE
FILES:=$(LINUX_DIR)/drivers/net/ethernet/qlogic/qede/qede.ko
AUTOLOAD:=$(call AutoProbe,qede)
endef
define KernelPackage/qede/description
This driver supports QLogic QED 25/40/100Gb Ethernet NIC
devices.
endef
$(eval $(call KernelPackage,qede))
define KernelPackage/qlcnic
SUBMENU:=$(NETWORK_DEVICES_MENU)
DEPENDS:=@PCI_SUPPORT +kmod-hwmon-core
@ -1798,7 +1829,7 @@ define KernelPackage/igc
DEPENDS:=@PCI_SUPPORT +kmod-ptp
KCONFIG:=CONFIG_IGC
FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/igc/igc.ko
AUTOLOAD:=$(call AutoLoad,34,igc,1)
AUTOLOAD:=$(call AutoLoad,35,igc,1)
endef
define KernelPackage/igc/description

View File

@ -465,7 +465,7 @@ define KernelPackage/drm-i915
TITLE:=Intel i915 DRM support
DEPENDS:=@(TARGET_x86_64||TARGET_x86_generic||TARGET_x86_legacy) \
@DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \
+kmod-drm-ttm-helper +kmod-drm-kms-helper +kmod-i2c-algo-bit +i915-firmware-dmc \
+kmod-drm-ttm-helper +kmod-drm-kms-helper +kmod-i2c-algo-bit +i915-firmware \
+kmod-drm-display-helper +kmod-drm-buddy +kmod-acpi-video \
+kmod-drm-exec +kmod-drm-suballoc-helper
KCONFIG:=CONFIG_DRM_I915 \
@ -495,6 +495,7 @@ define KernelPackage/drm-i915
CONFIG_FB_INTEL=n
FILES:=$(LINUX_DIR)/drivers/gpu/drm/i915/i915.ko
AUTOLOAD:=$(call AutoProbe,i915)
MODPARAMS.i915:=enable_guc=3
endef
define KernelPackage/drm-i915/description
@ -616,6 +617,41 @@ endef
$(eval $(call KernelPackage,drm-radeon))
define KernelPackage/drm-udl
SUBMENU:=$(VIDEO_MENU)
TITLE:=DisplayLink
DEPENDS:=+kmod-drm +kmod-backlight +kmod-drm-kms-helper +kmod-drm-shmem-helper
KCONFIG:=CONFIG_DRM_UDL
FILES:=$(LINUX_DIR)/drivers/gpu/drm/udl/udl.ko
AUTOLOAD:=$(call AutoProbe,udl)
$(call AddDepends/usb)
endef
define KernelPackage/drm-udl/description
This is a KMS driver for the USB displaylink video adapters.
endef
$(eval $(call KernelPackage,drm-udl))
define KernelPackage/drm-shmem-helper
SUBMENU:=$(VIDEO_MENU)
HIDDEN:=1
TITLE:=GEM shmem helper
DEPENDS:=+kmod-drm
KCONFIG:= \
CONFIG_DRM_GEM_SHMEM_HELPER
FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_shmem_helper.ko
AUTOLOAD:=$(call AutoProbe,drm_shmem_helper)
endef
define KernelPackage/drm-shmem-helper/description
GEM shmem helper
endef
$(eval $(call KernelPackage,drm-shmem-helper))
#
# Video Capture
#

Some files were not shown because too many files have changed in this diff Show More