Compare commits
156 Commits
master
...
istoreos-2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99075b24e3 | ||
|
|
832a7c598f | ||
|
|
fef4ac8e30 | ||
|
|
29898666f1 | ||
|
|
ed1d630310 | ||
|
|
155b840287 | ||
|
|
9cad938c38 | ||
|
|
907f6b9219 | ||
|
|
2ba8cdcda3 | ||
|
|
d93c4d1c0f | ||
|
|
5de53900b5 | ||
|
|
2f634e7883 | ||
|
|
3b882dda2e | ||
|
|
cd959beab8 | ||
|
|
43cece663d | ||
|
|
b48a1a22f0 | ||
|
|
2ac2270d53 | ||
|
|
a15aefd8d1 | ||
|
|
717b7f7999 | ||
|
|
b201c1a062 | ||
|
|
c3bbca7d80 | ||
|
|
8738984c4c | ||
|
|
3602c4d85a | ||
|
|
ed5ec70571 | ||
|
|
35f6894adf | ||
|
|
c928b4e60b | ||
|
|
9983f915ee | ||
|
|
07422b2fa2 | ||
|
|
0ec9323e0d | ||
|
|
2e5a5d405b | ||
|
|
d9e3c2cb13 | ||
|
|
9c21acba06 | ||
|
|
819445e446 | ||
|
|
bee149c530 | ||
|
|
d53da56687 | ||
|
|
f0c1ab22bf | ||
|
|
b53dc2e14b | ||
|
|
9a6ad6e89e | ||
|
|
cc9205a98e | ||
|
|
9ab57f7bf7 | ||
|
|
b7739e4eda | ||
|
|
722032a1e0 | ||
|
|
d37c21fed2 | ||
|
|
5510821042 | ||
|
|
8055e36fac | ||
|
|
62df8e1ac3 | ||
|
|
98418cf2bc | ||
|
|
fa9d5011f2 | ||
|
|
8f43e223a3 | ||
|
|
3882ed92ba | ||
|
|
cd74d7a444 | ||
|
|
0b0caf4813 | ||
|
|
a64d066980 | ||
|
|
9e76e42d9e | ||
|
|
d1d3c521ea | ||
|
|
94b62e52c9 | ||
|
|
fb37aa4118 | ||
|
|
a9287e6e5f | ||
|
|
965cc7166d | ||
|
|
8369665ccd | ||
|
|
eee1f80c38 | ||
|
|
3496079d3e | ||
|
|
ac2afcff65 | ||
|
|
193e2ebda0 | ||
|
|
e1c4e8b899 | ||
|
|
78072c02f6 | ||
|
|
9b5268d1cc | ||
|
|
21cede76d1 | ||
|
|
ff7754c8af | ||
|
|
9743247d2a | ||
|
|
bf7bd4cc67 | ||
|
|
f207e8d42f | ||
|
|
890371759b | ||
|
|
58f2080660 | ||
|
|
3098ea6c68 | ||
|
|
6d7dd6cb1a | ||
|
|
73532caa94 | ||
|
|
368486c0cc | ||
|
|
77972429d9 | ||
|
|
ecbaf4faab | ||
|
|
ac9269b9a6 | ||
|
|
d20111faac | ||
|
|
77647fc1b6 | ||
|
|
b152aed759 | ||
|
|
6532b23b74 | ||
|
|
26256b8811 | ||
|
|
ac754a104f | ||
|
|
14e8b73a76 | ||
|
|
f20bee3ec4 | ||
|
|
940ad2e534 | ||
|
|
ff271f8e38 | ||
|
|
64711eb397 | ||
|
|
15da100aad | ||
|
|
e200f39338 | ||
|
|
f6f2727fbf | ||
|
|
084a66221f | ||
|
|
24ab14b78e | ||
|
|
2d65221a52 | ||
|
|
a720f636ef | ||
|
|
25c8839a00 | ||
|
|
a228b256f7 | ||
|
|
cc5541096d | ||
|
|
8a8087adbc | ||
|
|
52c5c7ce3b | ||
|
|
66d749f2a6 | ||
|
|
a64906dd8b | ||
|
|
5119be09f9 | ||
|
|
714790757e | ||
|
|
1d3055c689 | ||
|
|
81273716b5 | ||
|
|
eb69f8fc43 | ||
|
|
34296ea0a1 | ||
|
|
8742c9dabe | ||
|
|
d07557601a | ||
|
|
aea8460983 | ||
|
|
539dde1adb | ||
|
|
c792d1c1ee | ||
|
|
a2e266f7ee | ||
|
|
c859e491d8 | ||
|
|
384ea8af4c | ||
|
|
a3a7beacad | ||
|
|
6c33c261c8 | ||
|
|
e9dd297684 | ||
|
|
1648cbd2de | ||
|
|
075ec41af2 | ||
|
|
3556ce6811 | ||
|
|
03b6c945c1 | ||
|
|
749ef0cd74 | ||
|
|
0e8c395643 | ||
|
|
21e285bb5b | ||
|
|
e3263dd951 | ||
|
|
a0f8ed1334 | ||
|
|
f778584050 | ||
|
|
e5f44ce74f | ||
|
|
aec65ccc2c | ||
|
|
e20df57360 | ||
|
|
a68f09ae43 | ||
|
|
c956349da7 | ||
|
|
74213075fb | ||
|
|
af02f432ff | ||
|
|
7770e69654 | ||
|
|
7eb71946e9 | ||
|
|
4236c721b6 | ||
|
|
f826da5be6 | ||
|
|
d565847d61 | ||
|
|
e886ba8500 | ||
|
|
2233b7e594 | ||
|
|
dd6af5561e | ||
|
|
136f0a11e0 | ||
|
|
2c1468d7dc | ||
|
|
0338019c90 | ||
|
|
8e030bb595 | ||
|
|
f3c4c31bbc | ||
|
|
3e2badb38a | ||
|
|
4deb3e6a84 | ||
|
|
e644e0248e |
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@ -1 +0,0 @@
|
||||
custom: [ 'https://openwrt.org/donate' ]
|
||||
8
.github/pull_request_template
vendored
8
.github/pull_request_template
vendored
@ -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
1
.gitignore
vendored
@ -20,6 +20,7 @@
|
||||
/package/openwrt-packages
|
||||
/*.patch
|
||||
/llvm-bpf*
|
||||
/.vermagic
|
||||
key-build*
|
||||
private-key.pem
|
||||
public-key.pem
|
||||
|
||||
@ -1,3 +1,12 @@
|
||||
iStoreOS 是入门级的路由系统,也是入门级的 NAS 系统,
|
||||
基于原版 OpenWRT,在 ARS2 上经过长期迭代,最终开放适配到多个硬件平台
|
||||
|
||||
更多信息请参阅 https://github.com/istoreos
|
||||
|
||||
|
||||
以下是 OpenWRT 原始的 README
|
||||
--------
|
||||
|
||||

|
||||
|
||||
OpenWrt Project is a Linux operating system targeting embedded devices. Instead
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)), \
|
||||
|
||||
@ -184,4 +184,6 @@ define BuildKernel
|
||||
|
||||
prereq: image-prereq
|
||||
|
||||
image: $(LINUX_DIR)/.image
|
||||
|
||||
endef
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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 `-`.
|
||||
#
|
||||
|
||||
@ -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 || { \
|
||||
|
||||
@ -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/)
|
||||
|
||||
@ -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 \
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
_______ ________ __
|
||||
| |.-----.-----.-----.| | | |.----.| |_
|
||||
| - || _ | -__| || | | || _|| _|
|
||||
|_______|| __|_____|__|__||________||__| |____|
|
||||
|__| W I R E L E S S F R E E D O M
|
||||
-----------------------------------------------------
|
||||
|
||||
[0;1;34;94m▀[0m [0;34m▄▄▄▄[0m [0;34m▄[0m [0;1;30;90m▄▄▄▄[0m [0;1;30;90m▄▄▄▄[0m
|
||||
[0;34m▄▄▄[0m [0;34m█▀[0m [0;34m▀[0m [0;34m▄[0;37m▄█▄▄[0m [0;37m▄▄▄[0m [0;37m▄[0m [0;1;30;90m▄▄[0m [0;1;30;90m▄▄▄[0m [0;1;30;90m▄▀[0m [0;1;30;90m▀[0;1;34;94m▄[0m [0;1;34;94m█▀[0m [0;1;34;94m▀[0m
|
||||
[0;34m█[0m [0;37m▀█▄▄▄[0m [0;37m█[0m [0;37m█▀[0m [0;1;30;90m▀█[0m [0;1;30;90m█▀[0m [0;1;30;90m▀[0m [0;1;30;90m█▀[0m [0;1;34;94m█[0m [0;1;34;94m█[0m [0;1;34;94m█[0m [0;1;34;94m▀█▄▄▄[0m
|
||||
[0;37m█[0m [0;37m▀█[0m [0;1;30;90m█[0m [0;1;30;90m█[0m [0;1;30;90m█[0m [0;1;30;90m█[0m [0;1;34;94m█▀▀▀▀[0m [0;1;34;94m█[0m [0;34m█[0m [0;34m▀█[0m
|
||||
[0;37m▄▄█▄▄[0m [0;1;30;90m▀▄▄▄█▀[0m [0;1;30;90m▀▄▄[0m [0;1;30;90m▀█[0;1;34;94m▄█▀[0m [0;1;34;94m█[0m [0;1;34;94m▀█▄▄[0;34m▀[0m [0;34m█▄▄█[0m [0;34m▀▄▄▄█▀[0m
|
||||
|
||||
Powered by OpenWRT
|
||||
-------------------------------------------------------
|
||||
%D %V, %C
|
||||
-----------------------------------------------------
|
||||
-------------------------------------------------------
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"
|
||||
}
|
||||
|
||||
57
package/base-files/files/etc/init.d/ucitrack_compat
Executable file
57
package/base-files/files/etc/init.d/ucitrack_compat
Executable 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
|
||||
}
|
||||
@ -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
|
||||
|
||||
16
package/base-files/files/etc/uci-defaults/13_lan-ip6class
Normal file
16
package/base-files/files/etc/uci-defaults/13_lan-ip6class
Normal 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
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
118
package/base-files/files/lib/functions/istoreos-boot.sh
Normal file
118
package/base-files/files/lib/functions/istoreos-boot.sh
Normal 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
|
||||
}
|
||||
@ -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
|
||||
done
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
@ -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..."
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
425
package/base-files/files/usr/sbin/mount_root
Executable file
425
package/base-files/files/usr/sbin/mount_root
Executable 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 )
|
||||
69
package/base-files/files/usr/sbin/sandbox
Executable file
69
package/base-files/files/usr/sbin/sandbox
Executable 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
|
||||
@ -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:
|
||||
|
||||
@ -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 \
|
||||
|
||||
@ -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 \
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
|
||||
#include "rk3568-u-boot.dtsi"
|
||||
@ -0,0 +1,3 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
|
||||
#include "rk3588s-u-boot.dtsi"
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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";
|
||||
};
|
||||
@ -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
40
package/diy/dkml/Makefile
Normal 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))
|
||||
45
package/diy/dkml/files/kmods-unload.init
Executable file
45
package/diy/dkml/files/kmods-unload.init
Executable 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
|
||||
}
|
||||
35
package/diy/dkml/files/kmods.config
Normal file
35
package/diy/dkml/files/kmods.config
Normal 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 ''
|
||||
36
package/diy/dkml/files/kmods.init
Executable file
36
package/diy/dkml/files/kmods.init
Executable 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
|
||||
}
|
||||
58
package/diy/grub-conf/Makefile
Normal file
58
package/diy/grub-conf/Makefile
Normal 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))
|
||||
1
package/diy/grub-conf/files/cmdline.grubcfg
Normal file
1
package/diy/grub-conf/files/cmdline.grubcfg
Normal file
@ -0,0 +1 @@
|
||||
set cmdline_ext="$cmdline_ext $CUSTOM_CMDLINE"
|
||||
8
package/diy/grub-conf/files/grub.config
Normal file
8
package/diy/grub-conf/files/grub.config
Normal 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'
|
||||
10
package/diy/grub-conf/files/grub.default
Normal file
10
package/diy/grub-conf/files/grub.default
Normal 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
|
||||
48
package/diy/grub-conf/files/grub.init
Executable file
48
package/diy/grub-conf/files/grub.init
Executable 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
|
||||
}
|
||||
1
package/diy/grub-conf/files/iommu.grubcfg
Normal file
1
package/diy/grub-conf/files/iommu.grubcfg
Normal file
@ -0,0 +1 @@
|
||||
set cmdline_ext="$cmdline_ext $IOMMU_CMDLINE"
|
||||
13
package/diy/luci-app-ota/Makefile
Normal file
13
package/diy/luci-app-ota/Makefile
Normal 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
|
||||
177
package/diy/luci-app-ota/luasrc/controller/admin/ota.lua
Normal file
177
package/diy/luci-app-ota/luasrc/controller/admin/ota.lua
Normal 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
|
||||
240
package/diy/luci-app-ota/luasrc/view/admin_system/ota.htm
Normal file
240
package/diy/luci-app-ota/luasrc/view/admin_system/ota.htm
Normal 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%>
|
||||
@ -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>
|
||||
 
|
||||
<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>
|
||||
62
package/diy/luci-app-ota/po/en/ota.po
Normal file
62
package/diy/luci-app-ota/po/en/ota.po
Normal 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 ""
|
||||
62
package/diy/luci-app-ota/po/templates/ota.pot
Normal file
62
package/diy/luci-app-ota/po/templates/ota.pot
Normal 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 ""
|
||||
62
package/diy/luci-app-ota/po/zh-cn/ota.po
Normal file
62
package/diy/luci-app-ota/po/zh-cn/ota.po
Normal 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 "发现下载中的固件,将显示当前进度"
|
||||
242
package/diy/luci-app-ota/root/bin/ota
Executable file
242
package/diy/luci-app-ota/root/bin/ota
Executable 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
|
||||
45
package/diy/ntfs3-mount/Makefile
Normal file
45
package/diy/ntfs3-mount/Makefile
Normal 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))
|
||||
2
package/diy/ntfs3-mount/files/mount.ntfs
Executable file
2
package/diy/ntfs3-mount/files/mount.ntfs
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
mount -t ntfs3 -o iocharset=utf8,force "$@" || mount -t ntfs3 -o iocharset=utf8,ro "$@"
|
||||
88
package/diy/ntfsprogs/Makefile
Normal file
88
package/diy/ntfsprogs/Makefile
Normal 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)))
|
||||
@ -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))
|
||||
|
||||
|
||||
8
package/firmware/linux-firmware/qlogic.mk
Normal file
8
package/firmware/linux-firmware/qlogic.mk
Normal 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))
|
||||
39
package/firmware/mali-csf-firmware/Makefile
Normal file
39
package/firmware/mali-csf-firmware/Makefile
Normal 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))
|
||||
94
package/istoreos-files/Makefile
Normal file
94
package/istoreos-files/Makefile
Normal 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))
|
||||
18
package/istoreos-files/files/etc/board.d/10_system
Executable file
18
package/istoreos-files/files/etc/board.d/10_system
Executable 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
|
||||
1
package/istoreos-files/files/etc/crontabs/root
Normal file
1
package/istoreos-files/files/etc/crontabs/root
Normal file
@ -0,0 +1 @@
|
||||
# see https://man7.org/linux/man-pages/man5/crontab.5.html
|
||||
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
if [ "$ACTION" = "add" ]; then
|
||||
[ "`uci -q get fstab.@global[0].port_mount`" = "1" ] && /usr/libexec/blockmount.sh
|
||||
fi
|
||||
@ -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
|
||||
27
package/istoreos-files/files/etc/init.d/blockmount
Executable file
27
package/istoreos-files/files/etc/init.d/blockmount
Executable 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
|
||||
}
|
||||
23
package/istoreos-files/files/etc/init.d/debug
Executable file
23
package/istoreos-files/files/etc/init.d/debug
Executable 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
|
||||
}
|
||||
}
|
||||
22
package/istoreos-files/files/etc/init.d/fix_luci_lang
Executable file
22
package/istoreos-files/files/etc/init.d/fix_luci_lang
Executable 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
|
||||
}
|
||||
32
package/istoreos-files/files/etc/init.d/io_uring
Executable file
32
package/istoreos-files/files/etc/init.d/io_uring
Executable 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
|
||||
}
|
||||
13
package/istoreos-files/files/etc/init.d/isos_stop
Executable file
13
package/istoreos-files/files/etc/init.d/isos_stop
Executable 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
|
||||
}
|
||||
108
package/istoreos-files/files/etc/init.d/isos_upgrade
Executable file
108
package/istoreos-files/files/etc/init.d/isos_upgrade
Executable 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
|
||||
}
|
||||
26
package/istoreos-files/files/etc/init.d/wan_drop
Executable file
26
package/istoreos-files/files/etc/init.d/wan_drop
Executable 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"
|
||||
}
|
||||
20
package/istoreos-files/files/etc/init.d/zprintk
Executable file
20
package/istoreos-files/files/etc/init.d/zprintk
Executable 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
|
||||
}
|
||||
@ -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
|
||||
87
package/istoreos-files/files/etc/uci-defaults/09_istoreos
Normal file
87
package/istoreos-files/files/etc/uci-defaults/09_istoreos
Normal 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
|
||||
10
package/istoreos-files/files/etc/uci-defaults/41_upnp_force
Normal file
10
package/istoreos-files/files/etc/uci-defaults/41_upnp_force
Normal 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
|
||||
@ -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
|
||||
24
package/istoreos-files/files/etc/uci-defaults/99_theme
Normal file
24
package/istoreos-files/files/etc/uci-defaults/99_theme
Normal 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
|
||||
@ -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
|
||||
}
|
||||
45
package/istoreos-files/files/usr/bin/luci18n2name
Executable file
45
package/istoreos-files/files/usr/bin/luci18n2name
Executable 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
|
||||
@ -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
|
||||
117
package/istoreos-files/files/usr/libexec/blockmount.sh
Executable file
117
package/istoreos-files/files/usr/libexec/blockmount.sh
Executable 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
|
||||
82
package/istoreos-files/files/usr/libexec/blockphy.sh
Executable file
82
package/istoreos-files/files/usr/libexec/blockphy.sh
Executable 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
|
||||
7
package/istoreos-files/files/usr/sbin/curl
Executable file
7
package/istoreos-files/files/usr/sbin/curl
Executable 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 "$@"
|
||||
@ -0,0 +1,9 @@
|
||||
{
|
||||
"admin/system/fstab": {
|
||||
"action": {
|
||||
"type": "call",
|
||||
"module": "luci.controller.admin.compat",
|
||||
"function": "action_fatab"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
30
package/istoreos-files/image-config.in
Normal file
30
package/istoreos-files/image-config.in
Normal 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
|
||||
1
package/istoreos-files/intl/etc/.istoreos-intl
Normal file
1
package/istoreos-files/intl/etc/.istoreos-intl
Normal file
@ -0,0 +1 @@
|
||||
# dummy 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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
Loading…
Reference in New Issue
Block a user