Skip to content

Commit

Permalink
Upstream sync
Browse files Browse the repository at this point in the history
  • Loading branch information
vincejv committed Jun 23, 2024
1 parent 80b41fb commit 0841bb7
Show file tree
Hide file tree
Showing 49 changed files with 3,093 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .config
Original file line number Diff line number Diff line change
Expand Up @@ -2709,7 +2709,7 @@ CONFIG_PACKAGE_kmod-tpm-tis=m
CONFIG_PACKAGE_kmod-ubootenv-nvram=m
CONFIG_PACKAGE_kmod-w83627hf-wdt=m
CONFIG_PACKAGE_kmod-wdt-sp805=m
CONFIG_PACKAGE_kmod-zram=m
CONFIG_PACKAGE_kmod-zram=y
CONFIG_ZRAM_DEF_COMP_LZORLE=y
# CONFIG_ZRAM_DEF_COMP_LZO is not set
# CONFIG_ZRAM_DEF_COMP_LZ4 is not set
Expand Down
1 change: 1 addition & 0 deletions config/Config-build.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ menu "Global build settings"
default y

config USE_APK
imply PACKAGE_apk-mbedtls
bool "Use APK instead of OPKG to build distribution (EXPERIMENTAL)"

comment "General build options"
Expand Down
2 changes: 2 additions & 0 deletions include/package-pack.mk
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ $(_endef)
rm -rf $$(IDIR_$(1))
ifeq ($$(CONFIG_USE_APK),)
$$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_package_wildcard,$(1))))
else
$$(call remove_ipkg_files,$(1),$$(call apk_package_files,$(call gen_package_wildcard,$(1))))
endif
mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1)) $(PKG_INFO_DIR)
$(call Package/$(1)/install,$$(IDIR_$(1)))
Expand Down
24 changes: 14 additions & 10 deletions include/rootfs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,27 @@ define prepare_rootfs
@( \
cd $(1); \
if [ -n "$(CONFIG_USE_APK)" ]; then \
$(STAGING_DIR_HOST)/bin/tar -xf ./lib/apk/db/scripts.tar --wildcards "*.post-install" -O > script.sh; \
chmod +x script.sh; \
IPKG_INSTROOT=$(1) $$(command -v bash) script.sh; \
IPKG_POSTINST_PATH=./lib/apk/db/*.post-install; \
$(STAGING_DIR_HOST)/bin/tar -C ./lib/apk/db/ -xf ./lib/apk/db/scripts.tar --wildcards "*.post-install"; \
else \
for script in ./usr/lib/opkg/info/*.postinst; do \
IPKG_POSTINST_PATH=./usr/lib/opkg/info/*.postinst; \
fi; \
for script in $$IPKG_POSTINST_PATH; do \
IPKG_INSTROOT=$(1) $$(command -v bash) $$script; \
ret=$$?; \
if [ $$ret -ne 0 ]; then \
echo "postinst script $$script has failed with exit code $$ret" >&2; \
exit 1; \
fi; \
[ -n "$(CONFIG_USE_APK)" ] && $(STAGING_DIR_HOST)/bin/tar --delete -f ./lib/apk/db/scripts.tar $$(basename $$script); \
done; \
$(if $(IB),,awk -i inplace \
'/^Status:/ { \
if ($$3 == "user") { $$3 = "ok" } \
else { sub(/,\<user\>|\<user\>,/, "", $$3) } \
}1' $(1)/usr/lib/opkg/status) ; \
$(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status ;) \
if [ -z "$(CONFIG_USE_APK)" ]; then \
$(if $(IB),,awk -i inplace \
'/^Status:/ { \
if ($$3 == "user") { $$3 = "ok" } \
else { sub(/,\<user\>|\<user\>,/, "", $$3) } \
}1' $(1)/usr/lib/opkg/status) ; \
$(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status ;) \
fi; \
for script in ./etc/init.d/*; do \
grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
Expand All @@ -115,6 +118,7 @@ define prepare_rootfs
rm -rf \
$(1)/boot \
$(1)/tmp/* \
$(1)/lib/apk/db/*.post-install* \
$(1)/usr/lib/opkg/info/*.postinst* \
$(1)/usr/lib/opkg/lists/* \
$(1)/var/lock/*.lock
Expand Down
4 changes: 2 additions & 2 deletions include/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ DEFAULT_PACKAGES:=\
urandom-seed \
urngd

ifdef CONFIG_USE_APK
DEFAULT_PACKAGES+=apk
ifneq ($(CONFIG_USE_APK),)
DEFAULT_PACKAGES+=apk-mbedtls
else
DEFAULT_PACKAGES+=opkg
endif
Expand Down
17 changes: 16 additions & 1 deletion include/toplevel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,22 @@ endif

_ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))

prepare-tmpinfo: FORCE
# Config that will invalidate the .targetinfo as they will affect
# DEFAULT_PACKAGES.
# Keep DYNAMIC_DEF_PKG_CONF in sync with target.mk to reflect the same configs
DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_SECCOMP
check-dynamic-def-pkg: FORCE
@+DEF_PKG_CONFS=""; \
if [ -f $(TOPDIR)/.config ]; then \
for config in $(DYNAMIC_DEF_PKG_CONF); do \
DEF_PKG_CONFS="$$DEF_PKG_CONFS "$$(grep "$$config"=y $(TOPDIR)/.config); \
done; \
fi; \
[ ! -f tmp/.packagedynamicdefault ] || OLD_DEF_PKG_CONFS=$$(cat tmp/.packagedynamicdefault); \
[ "$$DEF_PKG_CONFS" = "$$OLD_DEF_PKG_CONFS" ] || rm -rf tmp/info/.targetinfo*; \
mkdir -p tmp && echo "$$DEF_PKG_CONFS" > tmp/.packagedynamicdefault;

prepare-tmpinfo: check-dynamic-def-pkg FORCE
@+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)
mkdir -p tmp/info feeds
[ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base
Expand Down
2 changes: 1 addition & 1 deletion package/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ endif
ifndef SDK
$(curdir)//compile = $(STAGING_DIR)/.prepared $(BIN_DIR)
ifneq ($(CONFIG_USE_APK),)
$(curdir)/compile: $(curdir)/system/apk/host/compile $(BUILD_KEY_APK_SEC) $(BUILD_KEY_APK_PUB)
$(curdir)//compile += $(curdir)/system/apk/host/compile $(BUILD_KEY_APK_SEC) $(BUILD_KEY_APK_PUB)
else
$(curdir)/compile: $(curdir)/system/opkg/host/compile
endif
Expand Down
2 changes: 2 additions & 0 deletions package/base-files/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ ifneq ($(CONFIG_USE_APK),)
mkdir -p $(1)/etc/apk/
$(call FeedSourcesAppendAPK,$(1)/etc/apk/repositories)
$(VERSION_SED_SCRIPT) $(1)/etc/apk/repositories

rm -f $(1)/etc/uci-defaults/13_fix-group-user
else
$(if $(CONFIG_CLEAN_IPKG),, \
mkdir -p $(1)/etc/opkg; \
Expand Down
3 changes: 3 additions & 0 deletions package/base-files/files/etc/uci-defaults/13_fix-group-user
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
. /lib/functions.sh

# Skip if we don't have /usr/lib/opkg/info (APK installation)
[ -d /usr/lib/opkg/info ] || exit 0

for file in $(grep -sl Require-User /usr/lib/opkg/info/*.control); do
file="${file##*/}"
file="${file%.control}"
Expand Down
2 changes: 1 addition & 1 deletion package/base-files/files/lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -533,4 +533,4 @@ cmdline_get_var() {
done
}

[ -z "$IPKG_INSTROOT" ] && [ -f /lib/config/uci.sh ] && . /lib/config/uci.sh
[ -z "$IPKG_INSTROOT" ] && [ -f /lib/config/uci.sh ] && . /lib/config/uci.sh || true
20 changes: 14 additions & 6 deletions package/base-files/files/sbin/sysupgrade
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,20 @@ fi


list_conffiles() {
awk '
BEGIN { conffiles = 0 }
/^Conffiles:/ { conffiles = 1; next }
!/^ / { conffiles = 0; next }
conffiles == 1 { print }
' /usr/lib/opkg/status
if [ -f /usr/lib/opkg/status ]; then
awk '
BEGIN { conffiles = 0 }
/^Conffiles:/ { conffiles = 1; next }
!/^ / { conffiles = 0; next }
conffiles == 1 { print }
' /usr/lib/opkg/status
elif [ -d /lib/apk/packages ]; then
conffiles=""
for file in /lib/apk/packages/*.conffiles_static; do
conffiles="$(echo -e "$(cat $file)\n$conffiles")"
done
echo "$conffiles"
fi
}

list_changed_conffiles() {
Expand Down
2 changes: 1 addition & 1 deletion package/boot/kexec-tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=kexec-tools
PKG_VERSION:=2.0.28
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
From 328de8e00e298f00d7ba6b25dc3950147e9642e6 Mon Sep 17 00:00:00 2001
From: Michel Lind <[email protected]>
Date: Tue, 30 Jan 2024 04:14:31 -0600
Subject: [PATCH] Fix building on x86_64 with binutils 2.41

Newer versions of the GNU assembler (observed with binutils 2.41) will
complain about the ".arch i386" in files assembled with "as --64",
with the message "Error: 64bit mode not supported on 'i386'".

Fix by moving ".arch i386" below the relevant ".code32" directive, so
that the assembler is no longer expecting 64-bit instructions to be used
by the time that the ".arch i386" directive is encountered.

Based on similar iPXE fix:
https://github.com/ipxe/ipxe/commit/6ca597eee

Signed-off-by: Michel Lind <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
---
purgatory/arch/i386/entry32-16-debug.S | 2 +-
purgatory/arch/i386/entry32-16.S | 2 +-
purgatory/arch/i386/entry32.S | 2 +-
purgatory/arch/i386/setup-x86.S | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

--- a/purgatory/arch/i386/entry32-16-debug.S
+++ b/purgatory/arch/i386/entry32-16-debug.S
@@ -25,10 +25,10 @@
.globl entry16_debug_pre32
.globl entry16_debug_first32
.globl entry16_debug_old_first32
- .arch i386
.balign 16
entry16_debug:
.code32
+ .arch i386
/* Compute where I am running at (assumes esp valid) */
call 1f
1: popl %ebx
--- a/purgatory/arch/i386/entry32-16.S
+++ b/purgatory/arch/i386/entry32-16.S
@@ -20,10 +20,10 @@
#undef i386
.text
.globl entry16, entry16_regs
- .arch i386
.balign 16
entry16:
.code32
+ .arch i386
/* Compute where I am running at (assumes esp valid) */
call 1f
1: popl %ebx
--- a/purgatory/arch/i386/entry32.S
+++ b/purgatory/arch/i386/entry32.S
@@ -20,10 +20,10 @@
#undef i386

.text
- .arch i386
.globl entry32, entry32_regs
entry32:
.code32
+ .arch i386

/* Setup a gdt that should that is generally usefully */
lgdt %cs:gdt
--- a/purgatory/arch/i386/setup-x86.S
+++ b/purgatory/arch/i386/setup-x86.S
@@ -21,10 +21,10 @@
#undef i386

.text
- .arch i386
.globl purgatory_start
purgatory_start:
.code32
+ .arch i386

/* Load a gdt so I know what the segment registers are */
lgdt %cs:gdt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 99f62f58fac57214ecc3c9aabf6bf61ac1e1201d Mon Sep 17 00:00:00 2001
From: Tony Ambardar <[email protected]>
Date: Fri, 7 Jun 2024 21:54:56 -0700
Subject: [PATCH] i386: improve basename() compatibility

Drop usage of glibc basename() in favour of a simpler implementation that
works across GNU and musl libc, and is similar to existing code in fs2dt.c.

This fixes compile errors seen building against musl.

Signed-off-by: Tony Ambardar <[email protected]>
---
kexec/arch/i386/x86-linux-setup.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -318,6 +318,7 @@ static int add_edd_entry(struct x86_linu
uint8_t devnum, version;
uint32_t mbr_sig;
struct edd_info *edd_info;
+ char *basename = strrchr(sysfs_name,'/') + 1;

if (!current_mbr || !current_edd) {
fprintf(stderr, "%s: current_edd and current_edd "
@@ -329,9 +330,9 @@ static int add_edd_entry(struct x86_linu
memset(edd_info, 0, sizeof(struct edd_info));

/* extract the device number */
- if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) {
+ if (sscanf(basename, "int13_dev%hhx", &devnum) != 1) {
fprintf(stderr, "Invalid format of int13_dev dir "
- "entry: %s\n", basename(sysfs_name));
+ "entry: %s\n", basename);
return -1;
}

4 changes: 2 additions & 2 deletions package/firmware/intel-microcode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=intel-microcode
PKG_VERSION:=20240312
PKG_VERSION:=20240531
PKG_RELEASE:=1

PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).1.tar.xz
PKG_SOURCE_URL:=@DEBIAN/pool/non-free-firmware/i/intel-microcode/
PKG_HASH:=25f53bab1bf0c84aba927a77a97a9f1147c94199fa95b5187d874f839f022808
PKG_HASH:=808cbb57a790dab7060b59b31e70e54ac47d3798d75e9784ed57a65b9f951fc4
PKG_BUILD_DIR:=$(BUILD_DIR)/intel-microcode-3.$(PKG_VERSION).1
PKG_CPE_ID:=cpe:/a:intel:microcode

Expand Down
4 changes: 4 additions & 0 deletions package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -2771,7 +2771,11 @@ static int ltq_mei_probe(struct platform_device *pdev)
IFX_MEI_DMSG("Start loopback test...\n");
DFE_Loopback_Test ();
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
dsl_class = class_create(THIS_MODULE, "ifx_mei");
#else
dsl_class = class_create("ifx_mei");
#endif
device_create(dsl_class, NULL, MKDEV(MEI_MAJOR, 0), NULL, "ifx_mei");
return 0;
}
Expand Down
6 changes: 5 additions & 1 deletion package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,16 @@
DSL_int_t i;

printk(DSL_DRV_CRLF DSL_DRV_CRLF "Infineon CPE API Driver version: %s" DSL_DRV_CRLF,
@@ -1104,7 +1119,8 @@ int __init DSL_ModuleInit(void)
@@ -1104,7 +1119,12 @@ int __init DSL_ModuleInit(void)
}

DSL_DRV_DevNodeInit();
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
+ dsl_class = class_create(THIS_MODULE, "dsl_cpe_api");
+#else
+ dsl_class = class_create("dsl_cpe_api");
+#endif
+ device_create(dsl_class, NULL, MKDEV(DRV_DSL_CPE_API_DEV_MAJOR, 0), NULL, "dsl_cpe_api");
return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions package/kernel/lantiq/ltq-adsl/patches/120-platform.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
struct class *dsl_class;
DSL_int_t i;
@@ -1124,7 +1124,7 @@ int __init DSL_ModuleInit(void)
@@ -1128,7 +1128,7 @@ int __init DSL_ModuleInit(void)
return 0;
}

Expand All @@ -27,7 +27,7 @@
{
printk("Module will be unloaded"DSL_DRV_CRLF);

@@ -1139,7 +1139,7 @@ void __exit DSL_ModuleCleanup(void)
@@ -1143,7 +1143,7 @@ void __exit DSL_ModuleCleanup(void)
(DSL_uint8_t**)&g_BndFpgaBase);
#endif /* defined(INCLUDE_DSL_CPE_API_VINAX) && defined(INCLUDE_DSL_BONDING)*/

Expand All @@ -36,7 +36,7 @@
}

#ifndef _lint
@@ -1155,8 +1155,30 @@ module_param(debug_level, byte, 0);
@@ -1159,8 +1159,30 @@ module_param(debug_level, byte, 0);
MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs");
#endif /* #ifndef DSL_DEBUG_DISABLE*/

Expand Down
4 changes: 2 additions & 2 deletions package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
&(dsl_cpe_api_version[4]));

DSL_DRV_MemSet( ifxDevices, 0, sizeof(DSL_devCtx_t) * DSL_DRV_MAX_DEVICE_NUMBER );
@@ -1124,7 +1099,7 @@ static int __devinit ltq_adsl_probe(stru
@@ -1128,7 +1103,7 @@ static int __devinit ltq_adsl_probe(stru
return 0;
}

Expand All @@ -104,7 +104,7 @@
{
printk("Module will be unloaded"DSL_DRV_CRLF);

@@ -1169,7 +1144,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match);
@@ -1173,7 +1148,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match);

static struct platform_driver ltq_adsl_driver = {
.probe = ltq_adsl_probe,
Expand Down
Loading

0 comments on commit 0841bb7

Please sign in to comment.