Merge Mainline
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
c96b15cc4d
@ -5,7 +5,7 @@
|
||||
mainmenu "OpenWrt Configuration"
|
||||
|
||||
config MODULES
|
||||
option modules
|
||||
modules
|
||||
bool
|
||||
default y
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ ifneq ($(DISTRO_PKG_CONFIG),)
|
||||
scripts/config/%onf: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
|
||||
endif
|
||||
scripts/config/%onf: CFLAGS+= -O2
|
||||
scripts/config/%onf:
|
||||
scripts/config/%onf: FORCE
|
||||
@$(_SINGLE)$(SUBMAKE) $(if $(findstring s,$(OPENWRT_VERBOSE)),,-s) \
|
||||
-C scripts/config $(notdir $@)
|
||||
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gdb
|
||||
PKG_VERSION:=11.1
|
||||
PKG_VERSION:=11.2
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/gdb
|
||||
PKG_HASH:=cccfcc407b20d343fb320d4a9a2110776dd3165118ffd41f4b1b162340333f94
|
||||
PKG_HASH:=1497c36a71881b8671a9a84a0ee40faab788ca30d7ba19d8463c3cc787152e32
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=strace
|
||||
PKG_VERSION:=5.14
|
||||
PKG_VERSION:=5.16
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
|
||||
PKG_HASH:=901bee6db5e17debad4530dd9ffb4dc9a96c4a656edbe1c3141b7cb307b11e73
|
||||
PKG_HASH:=dc7db230ff3e57c249830ba94acab2b862da1fcaac55417e9b85041a833ca285
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=LGPL-2.1-or-later
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
cpu_arch="$(grep "model name" "/proc/cpuinfo" | head -n1 | awk -F ': ' '{print $2}' | xargs)"
|
||||
[ -z "${cpu_arch}" ] && cpu_arch="?"
|
||||
if grep -q "x86" "/etc/openwrt_release"; then
|
||||
cpu_cores="$(grep "core id" "/proc/cpuinfo" | uniq | wc -l)C $(grep -c "processor" "/proc/cpuinfo")T"
|
||||
cpu_cores="$(grep "core id" "/proc/cpuinfo" | sort -u | wc -l)C $(grep -c "processor" "/proc/cpuinfo")T"
|
||||
else
|
||||
cpu_cores="$(grep -c "processor" "/proc/cpuinfo")"
|
||||
fi
|
||||
|
||||
@ -729,6 +729,7 @@
|
||||
<% if has_temp then %>
|
||||
<tr><td width="33%"><%:Temperature%></td><td><%=luci.sys.exec("/sbin/tempinfo") or "?"%></td></tr>
|
||||
<% end %>
|
||||
<tr><td width="33%"><%:Target Platform%></td><td><%=pcdata(boardinfo.release.target or "?")%></td></tr>
|
||||
<tr><td width="33%"><%:Firmware Version%></td><td>
|
||||
<%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> /
|
||||
<%=pcdata(ver.luciname)%> (<%=pcdata(ver.luciversion)%>)
|
||||
|
||||
@ -23,7 +23,7 @@ define Package/default-settings
|
||||
CATEGORY:=LuCI
|
||||
TITLE:=LuCI support for Default Settings
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+luci-base +@LUCI_LANG_en
|
||||
DEPENDS:=+luci-base
|
||||
endef
|
||||
|
||||
define Package/default-settings-chn
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF
|
||||
set luci.main.lang='zh_cn'
|
||||
set system.@system[0].timezone='CST-8'
|
||||
set system.@system[0].zonename='Asia/Shanghai'
|
||||
|
||||
|
||||
@ -197,6 +197,21 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,et131x))
|
||||
|
||||
define KernelPackage/phy-microchip
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Microchip Ethernet PHY driver
|
||||
KCONFIG:=CONFIG_MICROCHIP_PHY
|
||||
DEPENDS:=+kmod-libphy
|
||||
FILES:=$(LINUX_DIR)/drivers/net/phy/microchip.ko
|
||||
AUTOLOAD:=$(call AutoLoad,18,microchip,1)
|
||||
endef
|
||||
|
||||
define KernelPackage/phy-microchip/description
|
||||
Supports the LAN88XX PHYs.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,phy-microchip))
|
||||
|
||||
|
||||
define KernelPackage/phylib-broadcom
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
|
||||
@ -1203,6 +1203,23 @@ endef
|
||||
$(eval $(call KernelPackage,usb-net-kaweth))
|
||||
|
||||
|
||||
define KernelPackage/usb-net-lan78xx
|
||||
TITLE:=USB-To-Ethernet Microchip LAN78XX convertors
|
||||
DEPENDS:=+kmod-fixed-phy +kmod-phy-microchip
|
||||
KCONFIG:=CONFIG_USB_LAN78XX
|
||||
FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/lan78xx.ko
|
||||
AUTOLOAD:=$(call AutoProbe,lan78xx)
|
||||
$(call AddDepends/usb-net)
|
||||
endef
|
||||
|
||||
define KernelPackage/usb-net-lan78xx/description
|
||||
Kernel module for Microchip LAN78XX based USB 2 & USB 3
|
||||
10/100/1000 Ethernet adapters.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,usb-net-lan78xx))
|
||||
|
||||
|
||||
define KernelPackage/usb-net-pegasus
|
||||
TITLE:=Kernel module for USB-to-Ethernet Pegasus convertors
|
||||
KCONFIG:=CONFIG_USB_PEGASUS
|
||||
|
||||
@ -7,12 +7,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=elfutils
|
||||
PKG_VERSION:=0.182
|
||||
PKG_VERSION:=0.186
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
|
||||
PKG_HASH:=ecc406914edf335f0b7fc084ebe6c460c4d6d5175bfdd6688c1c78d9146b8858
|
||||
PKG_HASH:=7f6fb9149b1673d38d9178a0d3e0fb8a1ec4f53a9f4c2ff89469609879641177
|
||||
|
||||
PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
@ -44,7 +44,7 @@ endef
|
||||
|
||||
define Package/libdw
|
||||
$(call Package/elfutils/Default)
|
||||
DEPENDS:=+libelf +libbz2
|
||||
DEPENDS:=+libelf +libbz2 +USE_MUSL:musl-fts
|
||||
TITLE+= (libdw)
|
||||
endef
|
||||
|
||||
@ -74,6 +74,12 @@ CONFIGURE_ARGS += \
|
||||
--without-lzma \
|
||||
--without-zstd
|
||||
|
||||
HOST_CONFIGURE_VARS += \
|
||||
ac_cv_search__obstack_free=yes
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
ac_cv_search__obstack_free=yes
|
||||
|
||||
TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral
|
||||
|
||||
define Build/InstallDev
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
From http://cgit.openembedded.org/openembedded-core/plain/meta/recipes-devtools/elfutils/files/0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch
|
||||
|
||||
From 2e2232d0935bf8ef6e66ebffba3be68a73b5b3e5 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sun, 8 Sep 2019 15:57:59 -0700
|
||||
Subject: [PATCH] ppc_initreg.c: Incliude asm/ptrace.h for pt_regs definition
|
||||
|
||||
Fixes
|
||||
| ../../elfutils-0.176/backends/ppc_initreg.c:79:22: error: field 'r' has incomplete type
|
||||
| struct pt_regs r;
|
||||
| ^
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
backends/ppc_initreg.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/backends/ppc_initreg.c
|
||||
+++ b/backends/ppc_initreg.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <stdlib.h>
|
||||
#if defined(__powerpc__) && defined(__linux__)
|
||||
# include <sys/ptrace.h>
|
||||
+# include <asm/ptrace.h>
|
||||
# include <sys/user.h>
|
||||
#endif
|
||||
|
||||
@ -11,9 +11,9 @@
|
||||
Requires.private: zlib
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -590,6 +590,9 @@ AC_CONFIG_FILES([config/libelf.pc config
|
||||
AC_SUBST(USE_NLS, yes)
|
||||
AM_PO_SUBDIRS
|
||||
@@ -610,6 +610,9 @@ dnl AM_GNU_GETTEXT_REQUIRE_VERSION suppo
|
||||
AM_GNU_GETTEXT_VERSION([0.19.6])
|
||||
AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6])
|
||||
|
||||
+case "$USE_NLS" in yes) intl_LDFLAGS="-lintl" ;; esac
|
||||
+AC_SUBST([intl_LDFLAGS])
|
||||
@ -21,51 +21,3 @@
|
||||
dnl Appended to the config.h file.
|
||||
dnl We hide all kinds of configuration magic in lib/eu-config.h.
|
||||
AH_BOTTOM([#include <eu-config.h>])
|
||||
--- a/libasm/libasmP.h
|
||||
+++ b/libasm/libasmP.h
|
||||
@@ -36,6 +36,9 @@
|
||||
|
||||
#include "libdwelf.h"
|
||||
|
||||
+#ifdef _ /* fix libintl-stub */
|
||||
+#undef _
|
||||
+#endif
|
||||
/* gettext helper macros. */
|
||||
#define _(Str) dgettext ("elfutils", Str)
|
||||
|
||||
--- a/libdw/libdwP.h
|
||||
+++ b/libdw/libdwP.h
|
||||
@@ -37,6 +37,9 @@
|
||||
#include <dwarf.h>
|
||||
#include "atomics.h"
|
||||
|
||||
+#ifdef _ /* fix libintl-stub */
|
||||
+#undef _
|
||||
+#endif
|
||||
|
||||
/* gettext helper macros. */
|
||||
#define _(Str) dgettext ("elfutils", Str)
|
||||
--- a/libdwfl/libdwflP.h
|
||||
+++ b/libdwfl/libdwflP.h
|
||||
@@ -47,6 +47,9 @@
|
||||
|
||||
typedef struct Dwfl_Process Dwfl_Process;
|
||||
|
||||
+#ifdef _ /* fix libintl-stub */
|
||||
+#undef _
|
||||
+#endif
|
||||
/* gettext helper macros. */
|
||||
#define _(Str) dgettext ("elfutils", Str)
|
||||
|
||||
--- a/libelf/libelfP.h
|
||||
+++ b/libelf/libelfP.h
|
||||
@@ -39,6 +39,9 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
+#ifdef _ /* fix libintl-stub */
|
||||
+#undef _
|
||||
+#endif
|
||||
/* gettext helper macros. */
|
||||
#define _(Str) dgettext ("elfutils", Str)
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
@@ -27,7 +27,7 @@ AM_MAKEFLAGS = --no-print-directory
|
||||
pkginclude_HEADERS = version.h
|
||||
|
||||
SUBDIRS = config m4 lib libelf libcpu backends libebl libdwelf libdwfl libdw \
|
||||
SUBDIRS = config lib libelf libcpu backends libebl libdwelf libdwfl libdw \
|
||||
- libasm debuginfod src po doc tests
|
||||
+ libasm
|
||||
|
||||
|
||||
@ -1,27 +1,3 @@
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=21002
|
||||
|
||||
--- a/lib/system.h
|
||||
+++ b/lib/system.h
|
||||
@@ -30,7 +30,18 @@
|
||||
#define LIB_SYSTEM_H 1
|
||||
|
||||
#include <errno.h>
|
||||
-#include <error.h>
|
||||
+#ifdef HAVE_ERROR_H
|
||||
+#include "error.h"
|
||||
+#else
|
||||
+#include "err.h"
|
||||
+#include <stdio.h>
|
||||
+#define error(status, errno, ...) \
|
||||
+ do { \
|
||||
+ fflush(stdout); \
|
||||
+ warn(__VA_ARGS__); \
|
||||
+ if (status) exit(status); \
|
||||
+ } while(0)
|
||||
+#endif
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/param.h>
|
||||
--- a/libdw/libdw_alloc.c
|
||||
+++ b/libdw/libdw_alloc.c
|
||||
@@ -152,5 +152,5 @@ __attribute ((noreturn)) attribute_hidde
|
||||
@ -33,15 +9,21 @@ https://sourceware.org/bugzilla/show_bug.cgi?id=21002
|
||||
}
|
||||
--- a/libdwfl/dwfl_error.c
|
||||
+++ b/libdwfl/dwfl_error.c
|
||||
@@ -154,7 +154,11 @@ dwfl_errmsg (int error)
|
||||
switch (error &~ 0xffff)
|
||||
{
|
||||
case OTHER_ERROR (ERRNO):
|
||||
@@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
|
||||
static const char *
|
||||
errnomsg(int error)
|
||||
{
|
||||
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
||||
return strerror_r (error & 0xffff, "bad", 0);
|
||||
/* Won't be changed by strerror_r, but not const so compiler doesn't throw warning */
|
||||
static char unknown[] = "unknown error";
|
||||
|
||||
@@ -150,6 +151,9 @@ errnomsg(int error)
|
||||
static __thread char msg[128];
|
||||
return strerror_r (error, msg, sizeof (msg)) ? unknown : msg;
|
||||
#endif
|
||||
+#else
|
||||
+ return strerror (error & 0xffff);
|
||||
+ return strerror (error & 0xffff);
|
||||
+#endif
|
||||
case OTHER_ERROR (LIBELF):
|
||||
return elf_errmsg (error & 0xffff);
|
||||
case OTHER_ERROR (LIBDW):
|
||||
}
|
||||
|
||||
const char *
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/libdwfl/argp-std.c
|
||||
+++ b/libdwfl/argp-std.c
|
||||
@@ -56,9 +56,6 @@ static const struct argp_option options[
|
||||
@@ -53,9 +53,6 @@ static const struct argp_option options[
|
||||
{ "linux-process-map", 'M', "FILE", 0,
|
||||
N_("Find addresses in files mapped as read from FILE"
|
||||
" in Linux /proc/PID/maps format"), 0 },
|
||||
@ -10,7 +10,7 @@
|
||||
{ "debuginfo-path", OPT_DEBUGINFO, "PATH", 0,
|
||||
N_("Search path for separate debuginfo files"), 0 },
|
||||
{ NULL, 0, NULL, 0, NULL, 0 }
|
||||
@@ -85,15 +82,6 @@ static const Dwfl_Callbacks proc_callbac
|
||||
@@ -82,15 +79,6 @@ static const Dwfl_Callbacks proc_callbac
|
||||
.find_elf = INTUSE(dwfl_linux_proc_find_elf),
|
||||
};
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
/* Structure held at state->HOOK. */
|
||||
struct parse_opt
|
||||
{
|
||||
@@ -226,43 +214,6 @@ parse_opt (int key, char *arg, struct ar
|
||||
@@ -223,43 +211,6 @@ parse_opt (int key, char *arg, struct ar
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
From e399540ab67ffe83ca3c4cb768a2f0f2f32a9057 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Sun, 5 Apr 2020 15:56:59 -0700
|
||||
Subject: [PATCH] libelf: remove usage of sys/cdefs
|
||||
|
||||
sys/cdefs is a deprecated glibc header that is unavailable with other
|
||||
libc implementations such as musl.
|
||||
|
||||
features.h under glibc includes sys/cdefs whereas it does not under musl.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
lib/fixedsizehash.h | 1 -
|
||||
libelf/elf.h | 10 ++++++----
|
||||
2 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/lib/fixedsizehash.h
|
||||
+++ b/lib/fixedsizehash.h
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
-#include <sys/cdefs.h>
|
||||
|
||||
#include <system.h>
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libcap
|
||||
PKG_VERSION:=2.51
|
||||
PKG_VERSION:=2.63
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
|
||||
PKG_HASH:=6609f3ab7aebcc8f9277f53a577c657d9f3056d1352ea623da7fd7c0f00890f9
|
||||
PKG_HASH:=0c637b8f44fc7d8627787e9cf57f15ac06c1ddccb53e41feec5496be3466f77f
|
||||
|
||||
PKG_MAINTAINER:=Paul Wassi <p.wassi@gmx.at>
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
@ -74,6 +74,8 @@ MAKE_FLAGS += \
|
||||
DYNAMIC="yes" \
|
||||
lib="lib"
|
||||
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_libcap-bin-capsh-shell),)
|
||||
TARGET_CFLAGS += -DSHELL='\"$(CONFIG_PACKAGE_libcap-bin-capsh-shell)\"'
|
||||
endif
|
||||
|
||||
@ -7,4 +7,4 @@
|
||||
- $(MAKE) -C tests $@
|
||||
$(MAKE) -C progs $@
|
||||
$(MAKE) -C doc $@
|
||||
$(MAKE) -C kdebug $@
|
||||
|
||||
|
||||
@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mbedtls
|
||||
PKG_VERSION:=2.16.11
|
||||
PKG_VERSION:=2.16.12
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=c18e7e9abf95e69e425260493720470021384a1728417042060a35d0b7b18b41
|
||||
PKG_HASH:=294871ab1864a65d0b74325e9219d5bcd6e91c34a3c59270c357bb9ae4d5c393
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=gpl-2.0.txt
|
||||
|
||||
@ -126,15 +126,6 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
|
||||
@@ -1690,7 +1690,7 @@
|
||||
*
|
||||
* Comment this macro to disable support for SSL session tickets
|
||||
*/
|
||||
-#define MBEDTLS_SSL_SESSION_TICKETS
|
||||
+//#define MBEDTLS_SSL_SESSION_TICKETS
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_SSL_EXPORT_KEYS
|
||||
@@ -1720,7 +1720,7 @@
|
||||
*
|
||||
* Comment this macro to disable support for truncated HMAC in SSL
|
||||
@ -216,15 +207,6 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_RSA_C
|
||||
@@ -2913,7 +2913,7 @@
|
||||
*
|
||||
* Requires: MBEDTLS_CIPHER_C
|
||||
*/
|
||||
-#define MBEDTLS_SSL_TICKET_C
|
||||
+//#define MBEDTLS_SSL_TICKET_C
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_SSL_CLI_C
|
||||
@@ -3013,7 +3013,7 @@
|
||||
*
|
||||
* This module provides run-time version information.
|
||||
|
||||
@ -11,9 +11,8 @@ PKG_NAME:=openssl
|
||||
PKG_BASE:=1.1.1
|
||||
PKG_BUGFIX:=m
|
||||
PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=3
|
||||
PKG_USE_MIPS16:=0
|
||||
ENGINES_DIR=engines-1.1
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@ -67,6 +66,7 @@ PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_OPENSSL_WITH_WHIRLPOOL
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include engine.mk
|
||||
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
HOSTCC=$(HOSTCC_NOCACHE)
|
||||
@ -130,6 +130,8 @@ endef
|
||||
|
||||
define Package/libopenssl-conf/conffiles
|
||||
/etc/ssl/openssl.cnf
|
||||
$(if CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO,/etc/ssl/engines.cnf.d/devcrypto.cnf)
|
||||
$(if CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK,/etc/ssl/engines.cnf.d/padlock.cnf)
|
||||
endef
|
||||
|
||||
define Package/libopenssl-conf/description
|
||||
@ -137,51 +139,50 @@ $(call Package/openssl/Default/description)
|
||||
This package installs the OpenSSL configuration file /etc/ssl/openssl.cnf.
|
||||
endef
|
||||
|
||||
$(eval $(call Package/openssl/add-engine,afalg))
|
||||
define Package/libopenssl-afalg
|
||||
$(call Package/openssl/Default)
|
||||
SUBMENU:=SSL
|
||||
$(call Package/openssl/engine/Default)
|
||||
TITLE:=AFALG hardware acceleration engine
|
||||
DEPENDS:=libopenssl @OPENSSL_ENGINE @KERNEL_AIO \
|
||||
+PACKAGE_libopenssl-afalg:kmod-crypto-user +libopenssl-conf @!OPENSSL_ENGINE_BUILTIN
|
||||
DEPENDS += @KERNEL_AIO +PACKAGE_libopenssl-afalg:kmod-crypto-user \
|
||||
@!OPENSSL_ENGINE_BUILTIN
|
||||
endef
|
||||
|
||||
define Package/libopenssl-afalg/description
|
||||
This package adds an engine that enables hardware acceleration
|
||||
through the AF_ALG kernel interface.
|
||||
To use it, you need to configure the engine in /etc/ssl/openssl.cnf
|
||||
See https://www.openssl.org/docs/man1.1.1/man5/config.html#Engine-Configuration-Module
|
||||
and https://openwrt.org/docs/techref/hardware/cryptographic.hardware.accelerators
|
||||
The engine_id is "afalg"
|
||||
endef
|
||||
|
||||
$(eval $(call Package/openssl/add-engine,devcrypto))
|
||||
define Package/libopenssl-devcrypto
|
||||
$(call Package/openssl/Default)
|
||||
SUBMENU:=SSL
|
||||
$(call Package/openssl/engine/Default)
|
||||
TITLE:=/dev/crypto hardware acceleration engine
|
||||
DEPENDS:=libopenssl @OPENSSL_ENGINE +PACKAGE_libopenssl-devcrypto:kmod-cryptodev +libopenssl-conf \
|
||||
@!OPENSSL_ENGINE_BUILTIN
|
||||
DEPENDS += +PACKAGE_libopenssl-devcrypto:kmod-cryptodev @!OPENSSL_ENGINE_BUILTIN
|
||||
endef
|
||||
|
||||
define Package/libopenssl-devcrypto/description
|
||||
This package adds an engine that enables hardware acceleration
|
||||
through the /dev/crypto kernel interface.
|
||||
To use it, you need to configure the engine in /etc/ssl/openssl.cnf
|
||||
See https://www.openssl.org/docs/man1.1.1/man5/config.html#Engine-Configuration-Module
|
||||
and https://openwrt.org/docs/techref/hardware/cryptographic.hardware.accelerators
|
||||
The engine_id is "devcrypto"
|
||||
endef
|
||||
|
||||
$(eval $(call Package/openssl/add-engine,padlock))
|
||||
define Package/libopenssl-padlock
|
||||
$(call Package/openssl/Default)
|
||||
SUBMENU:=SSL
|
||||
$(call Package/openssl/engine/Default)
|
||||
TITLE:=VIA Padlock hardware acceleration engine
|
||||
DEPENDS:=libopenssl @OPENSSL_ENGINE @TARGET_x86 +PACKAGE_libopenssl-padlock:kmod-crypto-hw-padlock \
|
||||
+libopenssl-conf @!OPENSSL_ENGINE_BUILTIN
|
||||
DEPENDS += @TARGET_x86 +PACKAGE_libopenssl-padlock:kmod-crypto-hw-padlock \
|
||||
@!OPENSSL_ENGINE_BUILTIN
|
||||
endef
|
||||
|
||||
define Package/libopenssl-padlock/description
|
||||
This package adds an engine that enables VIA Padlock hardware acceleration.
|
||||
To use it, you need to configure it in /etc/ssl/openssl.cnf.
|
||||
See https://www.openssl.org/docs/man1.1.1/man5/config.html#Engine-Configuration-Module
|
||||
and https://openwrt.org/docs/techref/hardware/cryptographic.hardware.accelerators
|
||||
The engine_id is "padlock"
|
||||
@ -378,8 +379,17 @@ define Package/libopenssl/install
|
||||
endef
|
||||
|
||||
define Package/libopenssl-conf/install
|
||||
$(INSTALL_DIR) $(1)/etc/ssl
|
||||
$(INSTALL_DIR) $(1)/etc/ssl/engines.cnf.d $(1)/etc/config $(1)/etc/init.d
|
||||
$(CP) $(PKG_INSTALL_DIR)/etc/ssl/openssl.cnf $(1)/etc/ssl/
|
||||
$(INSTALL_BIN) ./files/openssl.init $(1)/etc/init.d/openssl
|
||||
$(SED) 's!%ENGINES_DIR%!/usr/lib/$(ENGINES_DIR)!' $(1)/etc/init.d/openssl
|
||||
touch $(1)/etc/config/openssl
|
||||
$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO),
|
||||
$(CP) ./files/devcrypto.cnf $(1)/etc/ssl/engines.cnf.d/
|
||||
echo -e "config engine 'devcrypto'\n\toption enabled '1'" >> $(1)/etc/config/openssl)
|
||||
$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK),
|
||||
$(CP) ./files/padlock.cnf $(1)/etc/ssl/engines.cnf.d/
|
||||
echo -e "\nconfig engine 'padlock'\n\toption enabled '1'" >> $(1)/etc/config/openssl)
|
||||
endef
|
||||
|
||||
define Package/openssl-util/install
|
||||
@ -387,21 +397,6 @@ define Package/openssl-util/install
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/openssl $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
define Package/libopenssl-afalg/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/$(ENGINES_DIR)
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(ENGINES_DIR)/afalg.so $(1)/usr/lib/$(ENGINES_DIR)
|
||||
endef
|
||||
|
||||
define Package/libopenssl-devcrypto/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/$(ENGINES_DIR)
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(ENGINES_DIR)/devcrypto.so $(1)/usr/lib/$(ENGINES_DIR)
|
||||
endef
|
||||
|
||||
define Package/libopenssl-padlock/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/$(ENGINES_DIR)
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(ENGINES_DIR)/*padlock.so $(1)/usr/lib/$(ENGINES_DIR)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libopenssl))
|
||||
$(eval $(call BuildPackage,libopenssl-conf))
|
||||
$(eval $(call BuildPackage,libopenssl-afalg))
|
||||
|
||||
46
package/libs/openssl/engine.mk
Normal file
46
package/libs/openssl/engine.mk
Normal file
@ -0,0 +1,46 @@
|
||||
ENGINES_DIR=engines-1.1
|
||||
|
||||
define Package/openssl/engine/Default
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=SSL
|
||||
DEPENDS:=libopenssl @OPENSSL_ENGINE +libopenssl-conf
|
||||
endef
|
||||
|
||||
# 1 = engine name
|
||||
# 2 - package name, defaults to libopenssl-$(1)
|
||||
define Package/openssl/add-engine
|
||||
OSSL_ENG_PKG:=$(if $(2),$(2),libopenssl-$(1))
|
||||
Package/$$(OSSL_ENG_PKG)/conffiles:=/etc/ssl/engines.cnf.d/$(1).cnf
|
||||
|
||||
define Package/$$(OSSL_ENG_PKG)/install
|
||||
$$(INSTALL_DIR) $$(1)/usr/lib/$(ENGINES_DIR)
|
||||
$$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/lib/$(ENGINES_DIR)/$(1).so \
|
||||
$$(1)/usr/lib/$(ENGINES_DIR)
|
||||
$$(INSTALL_DIR) $$(1)/etc/ssl/engines.cnf.d
|
||||
$$(INSTALL_DATA) ./files/$(1).cnf $$(1)/etc/ssl/engines.cnf.d/
|
||||
endef
|
||||
|
||||
define Package/$$(OSSL_ENG_PKG)/postinst :=
|
||||
#!/bin/sh
|
||||
OPENSSL_UCI="$$$${IPKG_INSTROOT}/etc/config/openssl"
|
||||
|
||||
[ -z "$$$${IPKG_INSTROOT}" ] && uci -q get openssl.$(1) >/dev/null && exit 0
|
||||
|
||||
cat << EOF >> "$$$${OPENSSL_UCI}"
|
||||
|
||||
config engine '$(1)'
|
||||
option enabled '1'
|
||||
EOF
|
||||
|
||||
[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/openssl reload
|
||||
endef
|
||||
|
||||
define Package/$$(OSSL_ENG_PKG)/postrm :=
|
||||
#!/bin/sh
|
||||
[ -n "$$$${IPKG_INSTROOT}" ] && exit 0
|
||||
uci delete openssl.$(1)
|
||||
uci commit openssl
|
||||
/etc/init.d/openssl reload
|
||||
endef
|
||||
endef
|
||||
3
package/libs/openssl/files/afalg.cnf
Normal file
3
package/libs/openssl/files/afalg.cnf
Normal file
@ -0,0 +1,3 @@
|
||||
[afalg]
|
||||
default_algorithms = ALL
|
||||
|
||||
31
package/libs/openssl/files/devcrypto.cnf
Normal file
31
package/libs/openssl/files/devcrypto.cnf
Normal file
@ -0,0 +1,31 @@
|
||||
[devcrypto]
|
||||
# Leave this alone and configure algorithms with CIPERS/DIGESTS below
|
||||
default_algorithms = ALL
|
||||
|
||||
# Configuration commands:
|
||||
# Run 'openssl engine -t -c -vv -pre DUMP_INFO devcrypto' to see a
|
||||
# list of supported algorithms, along with their driver, whether they
|
||||
# are hw accelerated or not, and the engine's configuration commands.
|
||||
|
||||
# USE_SOFTDRIVERS: specifies whether to use software (not accelerated)
|
||||
# drivers (0=use only accelerated drivers, 1=allow all drivers, 2=use
|
||||
# if acceleration can't be determined) [default=2]
|
||||
#USE_SOFTDRIVERS = 2
|
||||
|
||||
# CIPHERS: either ALL, NONE, or a comma-separated list of ciphers to
|
||||
# enable [default=ALL]
|
||||
# It is recommended to disable the ECB ciphers; in most cases, it will
|
||||
# only be used for PRNG, in small blocks, where performance is poor,
|
||||
# and there may be problems with apps forking with open crypto
|
||||
# contexts, leading to failures. The CBC ciphers work well:
|
||||
#CIPHERS=DES-CBC, DES-EDE3-CBC, AES-128-CBC, AES-192-CBC, AES-256-CBC
|
||||
|
||||
# DIGESTS: either ALL, NONE, or a comma-separated list of digests to
|
||||
# enable [default=NONE]
|
||||
# It is strongly recommended not to enable digests; their performance
|
||||
# is poor, and there are many cases in which they will not work,
|
||||
# especially when calling fork with open crypto contexts. Openssh,
|
||||
# for example, does this, and you may not be able to login.
|
||||
#DIGESTS = NONE
|
||||
|
||||
|
||||
31
package/libs/openssl/files/openssl.init
Executable file
31
package/libs/openssl/files/openssl.init
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=13
|
||||
ENGINES_CNF_D="/etc/ssl/engines.cnf.d"
|
||||
ENGINES_CNF="/var/etc/ssl/engines.cnf"
|
||||
ENGINES_DIR="%ENGINES_DIR%"
|
||||
|
||||
config_engine() {
|
||||
local enabled force
|
||||
config_get_bool enabled "$1" enabled 1
|
||||
config_get_bool force "$1" force 0
|
||||
[ "$enabled" = 0 ] && return
|
||||
if [ "$force" = 0 ] && \
|
||||
[ ! -f "${ENGINES_CNF_D}/$1.cnf" ] && \
|
||||
[ ! -f "${ENGINES_DIR}/$1.so" ]; then
|
||||
echo Skipping engine "$1": not installed
|
||||
return
|
||||
fi
|
||||
echo Enabling engine "$1"
|
||||
echo "$1=$1" >> "${ENGINES_CNF}"
|
||||
}
|
||||
|
||||
start() {
|
||||
mkdir -p "$(dirname "${ENGINES_CNF}")" || exit 1
|
||||
echo Generating engines.cnf
|
||||
echo "# This file is automatically generated from /etc/config/openssl." \
|
||||
> "${ENGINES_CNF}" || \
|
||||
{ echo Error writing ${ENGINES_CNF} >&2; exit 1; }
|
||||
config_load openssl
|
||||
config_foreach config_engine engine
|
||||
}
|
||||
3
package/libs/openssl/files/padlock.cnf
Normal file
3
package/libs/openssl/files/padlock.cnf
Normal file
@ -0,0 +1,3 @@
|
||||
[padlock]
|
||||
default_algorithms = ALL
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 559fbff13af9ce2fbc0b9bc5727a7323e1db6217 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Thu, 27 Sep 2018 08:29:21 -0300
|
||||
Subject: Do not use host kernel version to disable AFALG
|
||||
@ -9,7 +9,6 @@ version to disable building the AFALG engine on openwrt targets.
|
||||
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
|
||||
diff --git a/Configure b/Configure
|
||||
index 5a699836f3..74d057c219 100755
|
||||
--- a/Configure
|
||||
+++ b/Configure
|
||||
@@ -1548,7 +1548,9 @@ unless ($disabled{"crypto-mdebug-backtrace"})
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 3d43acc6068f00dbfc0c9a06355e2c8f7d302d0f Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Thu, 27 Sep 2018 08:30:24 -0300
|
||||
Subject: Add openwrt targets
|
||||
@ -9,7 +9,6 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
|
||||
diff --git a/Configurations/25-openwrt.conf b/Configurations/25-openwrt.conf
|
||||
new file mode 100644
|
||||
index 0000000000..86a86d31e4
|
||||
--- /dev/null
|
||||
+++ b/Configurations/25-openwrt.conf
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 4ad8f2fe6bf3b91df7904fcbe960e5fdfca36336 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Thu, 27 Sep 2018 08:31:38 -0300
|
||||
Subject: Avoid exposing build directories
|
||||
@ -9,7 +9,6 @@ OpenSSL_version(OPENSSL_CFLAGS), or running openssl version -a
|
||||
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
|
||||
diff --git a/crypto/build.info b/crypto/build.info
|
||||
index 2c619c62e8..893128345a 100644
|
||||
--- a/crypto/build.info
|
||||
+++ b/crypto/build.info
|
||||
@@ -10,7 +10,7 @@ EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From ba2fe646f2d9104a18b066e43582154049e9ffcb Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Thu, 27 Sep 2018 08:34:38 -0300
|
||||
Subject: Do not build tests and fuzz directories
|
||||
@ -8,7 +8,6 @@ This shortens build time.
|
||||
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
|
||||
diff --git a/Configure b/Configure
|
||||
index 74d057c219..5813e9f8fe 100755
|
||||
--- a/Configure
|
||||
+++ b/Configure
|
||||
@@ -318,7 +318,7 @@ my $auto_threads=1; # enable threads automatically? true by default
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 4f7ab2040bb71f03a8f8388911144559aa2a5b60 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Thu, 27 Sep 2018 08:44:39 -0300
|
||||
Subject: Add OPENSSL_PREFER_CHACHA_OVER_GCM option
|
||||
@ -15,7 +15,6 @@ when the client has it on top of its ciphersuite preference.
|
||||
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
|
||||
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
|
||||
index 6724ccf2d2..96d959427e 100644
|
||||
--- a/include/openssl/ssl.h
|
||||
+++ b/include/openssl/ssl.h
|
||||
@@ -173,9 +173,15 @@ extern "C" {
|
||||
@ -38,7 +37,6 @@ index 6724ccf2d2..96d959427e 100644
|
||||
# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
|
||||
"TLS_AES_128_GCM_SHA256"
|
||||
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
|
||||
index 27a1b2ec68..7039811323 100644
|
||||
--- a/ssl/ssl_ciph.c
|
||||
+++ b/ssl/ssl_ciph.c
|
||||
@@ -1467,11 +1467,29 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
|
||||
|
||||
@ -1,6 +1,17 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
|
||||
Date: Sat, 27 Mar 2021 17:43:25 -0300
|
||||
Subject: openssl.cnf: add engine configuration
|
||||
|
||||
This adds configuration options for engines, loading all cnf files under
|
||||
/etc/ssl/engines.cnf.d/.
|
||||
|
||||
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
|
||||
|
||||
diff --git a/apps/openssl.cnf b/apps/openssl.cnf
|
||||
--- a/apps/openssl.cnf
|
||||
+++ b/apps/openssl.cnf
|
||||
@@ -22,6 +22,99 @@ oid_section = new_oids
|
||||
@@ -22,6 +22,16 @@ oid_section = new_oids
|
||||
# (Alternatively, use a configuration file that has only
|
||||
# X.509v3 extensions in its main [= default] section.)
|
||||
|
||||
@ -10,92 +21,9 @@
|
||||
+engines=engines
|
||||
+
|
||||
+[engines]
|
||||
+# To enable an engine, install the package, and uncomment it here:
|
||||
+#devcrypto=devcrypto
|
||||
+#afalg=afalg
|
||||
+#padlock=padlock
|
||||
+##gost=gost
|
||||
+.include /var/etc/ssl/engines.cnf
|
||||
+
|
||||
+[afalg]
|
||||
+# Leave this alone and configure algorithms with CIPERS/DIGESTS below
|
||||
+default_algorithms = ALL
|
||||
+
|
||||
+# The following commands are only available if using the alternative
|
||||
+# (sync) AFALG engine
|
||||
+# Configuration commands:
|
||||
+# Run 'openssl engine -t -c -vv -pre DUMP_INFO devcrypto' to see a
|
||||
+# list of supported algorithms, along with their driver, whether they
|
||||
+# are hw accelerated or not, and the engine's configuration commands.
|
||||
+
|
||||
+# USE_SOFTDRIVERS: specifies whether to use software (not accelerated)
|
||||
+# drivers (0=use only accelerated drivers, 1=allow all drivers, 2=use
|
||||
+# if acceleration can't be determined) [default=2]
|
||||
+#USE_SOFTDRIVERS = 2
|
||||
+
|
||||
+# CIPHERS: either ALL, NONE, NO_ECB (all except ECB-mode) or a
|
||||
+# comma-separated list of ciphers to enable [default=NO_ECB]
|
||||
+# Starting in 1.2.0, if you use a cipher list, each cipher may be
|
||||
+# followed by a colon (:) and the minimum request length to use
|
||||
+# AF_ALG drivers for that cipher; smaller requests are processed by
|
||||
+# softare; a negative value will use the default for that cipher
|
||||
+#CIPHERS=AES-128-CBC:1024, AES-256-CBC:768, DES-EDE3-CBC:0
|
||||
+
|
||||
+# DIGESTS: either ALL, NONE, or a comma-separated list of digests to
|
||||
+# enable [default=NONE]
|
||||
+# It is strongly recommended not to enable digests; their performance
|
||||
+# is poor, and there are many cases in which they will not work,
|
||||
+# especially when calling fork with open crypto contexts. Openssh,
|
||||
+# for example, does this, and you may not be able to login.
|
||||
+#DIGESTS = NONE
|
||||
+
|
||||
+[devcrypto]
|
||||
+# Leave this alone and configure algorithms with CIPERS/DIGESTS below
|
||||
+default_algorithms = ALL
|
||||
+
|
||||
+# Configuration commands:
|
||||
+# Run 'openssl engine -t -c -vv -pre DUMP_INFO devcrypto' to see a
|
||||
+# list of supported algorithms, along with their driver, whether they
|
||||
+# are hw accelerated or not, and the engine's configuration commands.
|
||||
+
|
||||
+# USE_SOFTDRIVERS: specifies whether to use software (not accelerated)
|
||||
+# drivers (0=use only accelerated drivers, 1=allow all drivers, 2=use
|
||||
+# if acceleration can't be determined) [default=2]
|
||||
+#USE_SOFTDRIVERS = 2
|
||||
+
|
||||
+# CIPHERS: either ALL, NONE, or a comma-separated list of ciphers to
|
||||
+# enable [default=ALL]
|
||||
+# It is recommended to disable the ECB ciphers; in most cases, it will
|
||||
+# only be used for PRNG, in small blocks, where performance is poor,
|
||||
+# and there may be problems with apps forking with open crypto
|
||||
+# contexts, leading to failures. The CBC ciphers work well:
|
||||
+#CIPHERS=DES-CBC, DES-EDE3-CBC, AES-128-CBC, AES-192-CBC, AES-256-CBC
|
||||
+
|
||||
+# DIGESTS: either ALL, NONE, or a comma-separated list of digests to
|
||||
+# enable [default=NONE]
|
||||
+# It is strongly recommended not to enable digests; their performance
|
||||
+# is poor, and there are many cases in which they will not work,
|
||||
+# especially when calling fork with open crypto contexts. Openssh,
|
||||
+# for example, does this, and you may not be able to login.
|
||||
+#DIGESTS = NONE
|
||||
+
|
||||
+[padlock]
|
||||
+default_algorithms = ALL
|
||||
+
|
||||
+[gost]
|
||||
+default_algorithms = ALL
|
||||
+# CRYPT_PARAMS: OID of default GOST 28147-89 parameters It allows the
|
||||
+# user to choose between different parameter sets of symmetric cipher
|
||||
+# algorithm. RFC 4357 specifies several parameters for the
|
||||
+# GOST 28147-89 algorithm, but OpenSSL doesn't provide user interface
|
||||
+# to choose one when encrypting. So use engine configuration parameter
|
||||
+# instead.
|
||||
+# Value of this parameter can be either short name, defined in OpenSSL
|
||||
+# obj_dat.h header file or numeric representation of OID, defined in
|
||||
+# RFC 4357. Defaults to id-tc26-gost-28147-param-Z
|
||||
+#CRYPT_PARAMS = id-tc26-gost-28147-param-Z
|
||||
+
|
||||
+# PBE_PARAMS: Shortname of default digest alg for PBE
|
||||
+#PBE_PARAMS =
|
||||
+.include /etc/ssl/engines.cnf.d
|
||||
+
|
||||
[ new_oids ]
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From f14345422747a495a52f9237a43b8be189f21912 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Mon, 5 Nov 2018 15:54:17 -0200
|
||||
Subject: eng_devcrypto: save ioctl if EVP_MD_..FLAG_ONESHOT
|
||||
@ -15,7 +15,6 @@ Reviewed-by: Richard Levitte <levitte@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/7585)
|
||||
|
||||
diff --git a/crypto/engine/eng_devcrypto.c b/crypto/engine/eng_devcrypto.c
|
||||
index a727c6f646..a2c9a966f7 100644
|
||||
--- a/crypto/engine/eng_devcrypto.c
|
||||
+++ b/crypto/engine/eng_devcrypto.c
|
||||
@@ -461,6 +461,7 @@ struct digest_ctx {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 78e7b1cc7119622645bc5a8542c55b6c95dc7868 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Tue, 6 Nov 2018 22:54:07 -0200
|
||||
Subject: eng_devcrypto: add command to dump driver info
|
||||
@ -12,7 +12,6 @@ Reviewed-by: Richard Levitte <levitte@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/7585)
|
||||
|
||||
diff --git a/crypto/engine/eng_devcrypto.c b/crypto/engine/eng_devcrypto.c
|
||||
index 5ec38ca8f3..64dc6b891d 100644
|
||||
--- a/crypto/engine/eng_devcrypto.c
|
||||
+++ b/crypto/engine/eng_devcrypto.c
|
||||
@@ -50,16 +50,20 @@ static int use_softdrivers = DEVCRYPTO_DEFAULT_USE_SOFDTRIVERS;
|
||||
|
||||
@ -9,7 +9,6 @@ engines/e_devcrypto.c.
|
||||
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
|
||||
diff --git a/crypto/engine/build.info b/crypto/engine/build.info
|
||||
index e00802a3fd..47fe948966 100644
|
||||
--- a/crypto/engine/build.info
|
||||
+++ b/crypto/engine/build.info
|
||||
@@ -6,6 +6,3 @@ SOURCE[../../libcrypto]=\
|
||||
@ -20,7 +19,6 @@ index e00802a3fd..47fe948966 100644
|
||||
- SOURCE[../../libcrypto]=eng_devcrypto.c
|
||||
-ENDIF
|
||||
diff --git a/crypto/init.c b/crypto/init.c
|
||||
index 1b0d523bea..ee3e2eb075 100644
|
||||
--- a/crypto/init.c
|
||||
+++ b/crypto/init.c
|
||||
@@ -329,18 +329,6 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_engine_openssl)
|
||||
@ -86,7 +84,6 @@ index 1b0d523bea..ee3e2eb075 100644
|
||||
if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
|
||||
&& !RUN_ONCE(&engine_padlock, ossl_init_engine_padlock))
|
||||
diff --git a/engines/build.info b/engines/build.info
|
||||
index 1db771971c..33a25d7004 100644
|
||||
--- a/engines/build.info
|
||||
+++ b/engines/build.info
|
||||
@@ -11,6 +11,9 @@ IF[{- !$disabled{"engine"} -}]
|
||||
@ -116,7 +113,6 @@ diff --git a/crypto/engine/eng_devcrypto.c b/engines/e_devcrypto.c
|
||||
similarity index 95%
|
||||
rename from crypto/engine/eng_devcrypto.c
|
||||
rename to engines/e_devcrypto.c
|
||||
index 2c1b52d572..eff1ed3a7d 100644
|
||||
--- a/crypto/engine/eng_devcrypto.c
|
||||
+++ b/engines/e_devcrypto.c
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
@ -20,7 +20,6 @@ turn them on if it is safe and fast enough.
|
||||
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
|
||||
diff --git a/engines/e_devcrypto.c b/engines/e_devcrypto.c
|
||||
index 3fcd81de7a..d25230d366 100644
|
||||
--- a/engines/e_devcrypto.c
|
||||
+++ b/engines/e_devcrypto.c
|
||||
@@ -852,7 +852,7 @@ static void prepare_digest_methods(void)
|
||||
|
||||
@ -9,7 +9,6 @@ session. It may have been closed by another process after a fork.
|
||||
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
|
||||
diff --git a/engines/e_devcrypto.c b/engines/e_devcrypto.c
|
||||
index d25230d366..f4570f1666 100644
|
||||
--- a/engines/e_devcrypto.c
|
||||
+++ b/engines/e_devcrypto.c
|
||||
@@ -195,9 +195,8 @@ static int cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wolfssl
|
||||
PKG_VERSION:=4.8.1-stable
|
||||
PKG_VERSION:=5.1.1-stable
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
|
||||
PKG_HASH:=50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444
|
||||
PKG_HASH:=d3e0544dbe7e9587c0f6538cdc671b6492663bb7a4281819538abe6c99cdbd92
|
||||
|
||||
PKG_FIXUP:=libtool
|
||||
PKG_INSTALL:=1
|
||||
@ -62,7 +62,6 @@ TARGET_CFLAGS += \
|
||||
-fomit-frame-pointer \
|
||||
-flto \
|
||||
-DFP_MAX_BITS=8192 \
|
||||
-DWOLFSSL_ALT_CERT_CHAINS \
|
||||
$(if $(CONFIG_WOLFSSL_ALT_NAMES),-DWOLFSSL_ALT_NAMES)
|
||||
|
||||
TARGET_LDFLAGS += -flto
|
||||
@ -75,6 +74,7 @@ CONFIGURE_ARGS += \
|
||||
--enable-opensslextra \
|
||||
--enable-sni \
|
||||
--enable-stunnel \
|
||||
--enable-altcertchains \
|
||||
--disable-crypttests \
|
||||
--disable-examples \
|
||||
--disable-jobserver \
|
||||
|
||||
@ -1,116 +0,0 @@
|
||||
From fa8f23284d4689c2a737204b337b58d966dcbd8c Mon Sep 17 00:00:00 2001
|
||||
From: Sean Parkinson <sean@wolfssl.com>
|
||||
Date: Fri, 20 Aug 2021 10:23:38 +1000
|
||||
Subject: [PATCH] Maths x86 asm: change asm snippets to get compiling
|
||||
|
||||
TFM:
|
||||
Use register or memory for c0, c1, c2 in SQRADD and SQRADD2.
|
||||
SP:
|
||||
Use register or memory for vl, vh, vo in SP_ASM_MUL_ADD,
|
||||
SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD.
|
||||
---
|
||||
wolfcrypt/src/asm.c | 29 ++++++++++++++++++++---------
|
||||
wolfcrypt/src/sp_int.c | 6 +++---
|
||||
2 files changed, 23 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/wolfcrypt/src/asm.c
|
||||
+++ b/wolfcrypt/src/asm.c
|
||||
@@ -698,33 +698,39 @@ __asm__( \
|
||||
|
||||
#define SQRADD(i, j) \
|
||||
__asm__( \
|
||||
- "movl %6,%%eax \n\t" \
|
||||
+ "movl %3,%%eax \n\t" \
|
||||
"mull %%eax \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","cc");
|
||||
+ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \
|
||||
+ : "m"(i) \
|
||||
+ :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADD2(i, j) \
|
||||
__asm__( \
|
||||
- "movl %6,%%eax \n\t" \
|
||||
- "mull %7 \n\t" \
|
||||
+ "movl %3,%%eax \n\t" \
|
||||
+ "mull %4 \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx", "cc");
|
||||
+ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \
|
||||
+ : "m"(i), "m"(j) \
|
||||
+ :"%eax","%edx", "cc");
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
-__asm__( \
|
||||
+__asm__( \
|
||||
"movl %3,%%eax \n\t" \
|
||||
"mull %4 \n\t" \
|
||||
"movl %%eax,%0 \n\t" \
|
||||
"movl %%edx,%1 \n\t" \
|
||||
"xorl %2,%2 \n\t" \
|
||||
- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","cc");
|
||||
+ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \
|
||||
+ : "g"(i), "g"(j) \
|
||||
+ :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADDAC(i, j) \
|
||||
__asm__( \
|
||||
@@ -733,7 +739,9 @@ __asm__(
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","cc");
|
||||
+ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \
|
||||
+ : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
|
||||
+ :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADDDB \
|
||||
__asm__( \
|
||||
@@ -743,7 +751,10 @@ __asm__(
|
||||
"addl %6,%0 \n\t" \
|
||||
"adcl %7,%1 \n\t" \
|
||||
"adcl %8,%2 \n\t" \
|
||||
- :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc");
|
||||
+ :"=r"(c0), "=r"(c1), "=r"(c2) \
|
||||
+ : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), \
|
||||
+ "r"(sc2) \
|
||||
+ : "cc");
|
||||
|
||||
#elif defined(TFM_X86_64)
|
||||
/* x86-64 optimized */
|
||||
--- a/wolfcrypt/src/sp_int.c
|
||||
+++ b/wolfcrypt/src/sp_int.c
|
||||
@@ -476,7 +476,7 @@ static WC_INLINE sp_int_digit sp_div_wor
|
||||
"addl %%eax, %[l] \n\t" \
|
||||
"adcl %%edx, %[h] \n\t" \
|
||||
"adcl $0 , %[o] \n\t" \
|
||||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \
|
||||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \
|
||||
: [a] "r" (va), [b] "r" (vb) \
|
||||
: "eax", "edx", "cc" \
|
||||
)
|
||||
@@ -502,7 +502,7 @@ static WC_INLINE sp_int_digit sp_div_wor
|
||||
"addl %%eax, %[l] \n\t" \
|
||||
"adcl %%edx, %[h] \n\t" \
|
||||
"adcl $0 , %[o] \n\t" \
|
||||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \
|
||||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \
|
||||
: [a] "r" (va), [b] "r" (vb) \
|
||||
: "eax", "edx", "cc" \
|
||||
)
|
||||
@@ -541,7 +541,7 @@ static WC_INLINE sp_int_digit sp_div_wor
|
||||
"addl %%eax, %[l] \n\t" \
|
||||
"adcl %%edx, %[h] \n\t" \
|
||||
"adcl $0 , %[o] \n\t" \
|
||||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \
|
||||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \
|
||||
: [a] "m" (va) \
|
||||
: "eax", "edx", "cc" \
|
||||
)
|
||||
@ -1,22 +0,0 @@
|
||||
From f447e4c1fa4c932c0286fa0331966756e243db81 Mon Sep 17 00:00:00 2001
|
||||
From: JacobBarthelmeh <jacob@wolfssl.com>
|
||||
Date: Fri, 17 Sep 2021 15:06:13 -0700
|
||||
Subject: [PATCH] update macro guard on SHA256 transform call
|
||||
|
||||
---
|
||||
src/ssl.c | 3 ++-
|
||||
tests/api.c | 3 ++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/src/ssl.c
|
||||
+++ b/src/ssl.c
|
||||
@@ -17639,7 +17639,8 @@ size_t wolfSSL_get_client_random(const W
|
||||
|
||||
#if defined(OPENSSL_EXTRA)
|
||||
#if !defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || \
|
||||
- (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2)))
|
||||
+ (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2))) && \
|
||||
+ !defined(WOLFSSL_DEVCRYPTO_HASH) && !defined(WOLFSSL_AFALG_HASH)
|
||||
/* Apply SHA256 transformation to the data */
|
||||
int wolfSSL_SHA256_Transform(WOLFSSL_SHA256_CTX* sha256,
|
||||
const unsigned char* data)
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wolfssl/wolfcrypt/settings.h
|
||||
+++ b/wolfssl/wolfcrypt/settings.h
|
||||
@@ -2274,7 +2274,7 @@ extern void uITRON4_free(void *p) ;
|
||||
@@ -2346,7 +2346,7 @@ extern void uITRON4_free(void *p) ;
|
||||
#endif
|
||||
|
||||
/* warning for not using harden build options (default with ./configure) */
|
||||
|
||||
@ -11,7 +11,7 @@ RNG regardless of the built settings for wolfssl.
|
||||
|
||||
--- a/wolfcrypt/src/ecc.c
|
||||
+++ b/wolfcrypt/src/ecc.c
|
||||
@@ -10938,21 +10938,21 @@ void wc_ecc_fp_free(void)
|
||||
@@ -11647,21 +11647,21 @@ void wc_ecc_fp_free(void)
|
||||
|
||||
#endif /* FP_ECC */
|
||||
|
||||
@ -37,7 +37,7 @@ RNG regardless of the built settings for wolfssl.
|
||||
|
||||
--- a/wolfssl/wolfcrypt/ecc.h
|
||||
+++ b/wolfssl/wolfcrypt/ecc.h
|
||||
@@ -616,10 +616,8 @@ WOLFSSL_API
|
||||
@@ -647,10 +647,8 @@ WOLFSSL_API
|
||||
void wc_ecc_fp_free(void);
|
||||
WOLFSSL_LOCAL
|
||||
void wc_ecc_fp_init(void);
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Juliusz Sosinowicz <juliusz@wolfssl.com>
|
||||
Date: Sat, 12 Feb 2022 00:34:24 +0100
|
||||
Subject: [PATCH] Reported in ZD13631
|
||||
|
||||
`ssl->peerVerifyRet` wasn't being cleared when retrying with an alternative cert chain
|
||||
|
||||
References: https://github.com/wolfSSL/wolfssl/issues/4879
|
||||
---
|
||||
src/internal.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/internal.c b/src/internal.c
|
||||
index 0dded42a76c4..f5814d30607c 100644
|
||||
--- a/src/internal.c
|
||||
+++ b/src/internal.c
|
||||
@@ -12372,6 +12372,9 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
||||
}
|
||||
|
||||
ret = 0; /* clear errors and continue */
|
||||
+ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
||||
+ ssl->peerVerifyRet = 0;
|
||||
+ #endif
|
||||
args->verifyErr = 0;
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_CPE_ID:=cpe:/a:samba:samba
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_PARALLEL:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/shellsync
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=shellsync
|
||||
TITLE:=Sync shell scripts
|
||||
DEPENDS:=+libpthread +kmod-macvlan
|
||||
endef
|
||||
|
||||
@ -18,7 +18,8 @@ define Build/Prepare
|
||||
endef
|
||||
|
||||
define Package/shellsync/description
|
||||
A tool to sync different shell scripts.Based on syncppp patch by morfast.
|
||||
A tool to sync different shell scripts.
|
||||
Based on syncppp patch by morfast.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@ -30,5 +31,4 @@ define Package/shellsync/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/shellsync $(1)/usr/bin
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,shellsync))
|
||||
|
||||
@ -4,20 +4,23 @@
|
||||
> Mail: gch981213@gmail.com
|
||||
> Created Time: 2014年11月06日 星期四 19时15分30秒
|
||||
************************************************************************/
|
||||
#include<stdio.h>
|
||||
#include<semaphore.h>
|
||||
#include<fcntl.h>
|
||||
#include<stdlib.h>
|
||||
#include<time.h>
|
||||
#include<errno.h>
|
||||
#include <stdio.h>
|
||||
#include <semaphore.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define SEM_BLOCK_NAME "SYNCSHELL_block"
|
||||
#define SEM_COUNT_NAME "SYNCSHELL_count"
|
||||
|
||||
int wait_timeout;
|
||||
|
||||
int sync_wait(int nproc)
|
||||
{
|
||||
int flags;
|
||||
int value;
|
||||
sem_t *block;
|
||||
sem_t *block;
|
||||
sem_t *count;
|
||||
struct timespec ts;
|
||||
|
||||
@ -32,7 +35,6 @@ int sync_wait(int nproc)
|
||||
}
|
||||
ts.tv_sec += wait_timeout;
|
||||
|
||||
|
||||
flags = O_RDWR | O_CREAT;
|
||||
block = sem_open(SEM_BLOCK_NAME, flags, 0644, 0);
|
||||
count = sem_open(SEM_COUNT_NAME, flags, 0644, 0);
|
||||
@ -50,6 +52,7 @@ int sync_wait(int nproc)
|
||||
return -1;
|
||||
}
|
||||
printf("%d processes have arrived, waiting for the left %d\n", value, nproc-value);
|
||||
|
||||
if (value >= nproc) {
|
||||
while (nproc-1 > 0) {
|
||||
if (sem_post(block) < 0) {
|
||||
@ -67,7 +70,6 @@ int sync_wait(int nproc)
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sem_close(count);
|
||||
|
||||
@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethtool
|
||||
PKG_VERSION:=5.14
|
||||
PKG_VERSION:=5.16
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/software/network/ethtool
|
||||
PKG_HASH:=bb13db91915cacd7a492b65b65df07a67e4b974ddbeaf76205b1945a23d27686
|
||||
PKG_HASH:=aa2fef1936dd4a11755dfa0bdb93f0ec5bea45208d27c9754bc3abe1aa42c1cb
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tcpdump
|
||||
PKG_VERSION:=4.9.3
|
||||
PKG_RELEASE:=3
|
||||
PKG_RELEASE:=4
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://www.tcpdump.org/release/
|
||||
|
||||
101
package/network/utils/tcpdump/patches/102-CVE-2018-16301.patch
Normal file
101
package/network/utils/tcpdump/patches/102-CVE-2018-16301.patch
Normal file
@ -0,0 +1,101 @@
|
||||
From 8ab211a7ec728bb0ad8c766c8eeb12deb0a13b86 Mon Sep 17 00:00:00 2001
|
||||
From: Guy Harris <gharris@sonic.net>
|
||||
Date: Wed, 30 Sep 2020 11:37:30 -0700
|
||||
Subject: [PATCH] Handle very large -f files by rejecting them.
|
||||
|
||||
_read(), on Windows, has a 32-bit size argument and a 32-bit return
|
||||
value, so reject -f files that have more than 2^31-1 characters.
|
||||
|
||||
Add some #defines so that, on Windows, we use _fstati64 to get the size
|
||||
of that file, to handle large files.
|
||||
|
||||
Don't assume that our definition for ssize_t is the same size as size_t;
|
||||
by the time we want to print the return value of the read, we know it'll
|
||||
fit into an int, so just cast it to int and print it with %d.
|
||||
|
||||
(cherry picked from commit faf8fb70af3a013e5d662b8283dec742fd6b1a77)
|
||||
---
|
||||
netdissect-stdinc.h | 16 +++++++++++++++-
|
||||
tcpdump.c | 15 ++++++++++++---
|
||||
2 files changed, 27 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/netdissect-stdinc.h
|
||||
+++ b/netdissect-stdinc.h
|
||||
@@ -149,10 +149,17 @@
|
||||
#ifdef _MSC_VER
|
||||
#define stat _stat
|
||||
#define open _open
|
||||
-#define fstat _fstat
|
||||
#define read _read
|
||||
#define close _close
|
||||
#define O_RDONLY _O_RDONLY
|
||||
+
|
||||
+/*
|
||||
+ * We define our_fstat64 as _fstati64, and define our_statb as
|
||||
+ * struct _stati64, so we get 64-bit file sizes.
|
||||
+ */
|
||||
+#define our_fstat _fstati64
|
||||
+#define our_statb struct _stati64
|
||||
+
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/*
|
||||
@@ -211,6 +218,13 @@ typedef char* caddr_t;
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
+/*
|
||||
+ * We should have large file support enabled, if it's available,
|
||||
+ * so just use fstat as our_fstat and struct stat as our_statb.
|
||||
+ */
|
||||
+#define our_fstat fstat
|
||||
+#define our_statb struct stat
|
||||
+
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#ifndef HAVE___ATTRIBUTE__
|
||||
--- a/tcpdump.c
|
||||
+++ b/tcpdump.c
|
||||
@@ -108,6 +108,7 @@ The Regents of the University of Califor
|
||||
#endif /* HAVE_CAP_NG_H */
|
||||
#endif /* HAVE_LIBCAP_NG */
|
||||
|
||||
+#include "netdissect-stdinc.h"
|
||||
#include "netdissect.h"
|
||||
#include "interface.h"
|
||||
#include "addrtoname.h"
|
||||
@@ -861,15 +862,22 @@ read_infile(char *fname)
|
||||
{
|
||||
register int i, fd, cc;
|
||||
register char *cp;
|
||||
- struct stat buf;
|
||||
+ our_statb buf;
|
||||
|
||||
fd = open(fname, O_RDONLY|O_BINARY);
|
||||
if (fd < 0)
|
||||
error("can't open %s: %s", fname, pcap_strerror(errno));
|
||||
|
||||
- if (fstat(fd, &buf) < 0)
|
||||
+ if (our_fstat(fd, &buf) < 0)
|
||||
error("can't stat %s: %s", fname, pcap_strerror(errno));
|
||||
|
||||
+ /*
|
||||
+ * Reject files whose size doesn't fit into an int; a filter
|
||||
+ * *that* large will probably be too big.
|
||||
+ */
|
||||
+ if (buf.st_size > INT_MAX)
|
||||
+ error("%s is too large", fname);
|
||||
+
|
||||
cp = malloc((u_int)buf.st_size + 1);
|
||||
if (cp == NULL)
|
||||
error("malloc(%d) for %s: %s", (u_int)buf.st_size + 1,
|
||||
@@ -878,7 +886,8 @@ read_infile(char *fname)
|
||||
if (cc < 0)
|
||||
error("read %s: %s", fname, pcap_strerror(errno));
|
||||
if (cc != buf.st_size)
|
||||
- error("short read %s (%d != %d)", fname, cc, (int)buf.st_size);
|
||||
+ error("short read %s (%d != %d)", fname, (int) cc,
|
||||
+ (int)buf.st_size);
|
||||
|
||||
close(fd);
|
||||
/* replace "# comment" with spaces */
|
||||
@ -102,6 +102,23 @@ proto_wireguard_setup_peer() {
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_key_is_generated() {
|
||||
local private_key
|
||||
private_key="$(uci get network."$1".private_key)"
|
||||
|
||||
if [ "$private_key" == "generate" ]; then
|
||||
local ucitmp
|
||||
oldmask="$(umask)"
|
||||
umask 077
|
||||
ucitmp="$(mktemp -d)"
|
||||
private_key="$("${WG}" genkey)"
|
||||
uci -q -t "$ucitmp" set network."$1".private_key="$private_key" && \
|
||||
uci -q -t "$ucitmp" commit network
|
||||
rm -rf "$ucitmp"
|
||||
umask "$oldmask"
|
||||
fi
|
||||
}
|
||||
|
||||
proto_wireguard_setup() {
|
||||
local config="$1"
|
||||
local wg_dir="/tmp/wireguard"
|
||||
@ -111,6 +128,8 @@ proto_wireguard_setup() {
|
||||
local listen_port
|
||||
local mtu
|
||||
|
||||
ensure_key_is_generated "${config}"
|
||||
|
||||
config_load network
|
||||
config_get private_key "${config}" "private_key"
|
||||
config_get listen_port "${config}" "listen_port"
|
||||
|
||||
@ -211,15 +211,24 @@ config BUSYBOX_DEFAULT_MD5_SMALL
|
||||
config BUSYBOX_DEFAULT_SHA3_SMALL
|
||||
int
|
||||
default 1
|
||||
config BUSYBOX_DEFAULT_FEATURE_FAST_TOP
|
||||
config BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS
|
||||
config BUSYBOX_DEFAULT_FEATURE_VERBOSE_CP_MESSAGE
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_ETC_SERVICES
|
||||
config BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE
|
||||
bool
|
||||
default n
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_COPYBUF_KB
|
||||
int
|
||||
default 4
|
||||
config BUSYBOX_DEFAULT_MONOTONIC_SYSCALL
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_EDITING
|
||||
bool
|
||||
default y
|
||||
@ -289,30 +298,6 @@ config BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE
|
||||
config BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_VERBOSE_CP_MESSAGE
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_COPYBUF_KB
|
||||
int
|
||||
default 4
|
||||
config BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_MONOTONIC_SYSCALL
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_HWIB
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_SEAMLESS_XZ
|
||||
bool
|
||||
default n
|
||||
@ -391,6 +376,12 @@ config BUSYBOX_DEFAULT_FEATURE_CPIO_O
|
||||
config BUSYBOX_DEFAULT_FEATURE_CPIO_P
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_CPIO_IGNORE_DEVNO
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_CPIO_RENUMBER_INODES
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_DPKG
|
||||
bool
|
||||
default n
|
||||
@ -484,6 +475,18 @@ config BUSYBOX_DEFAULT_FEATURE_UNZIP_XZ
|
||||
config BUSYBOX_DEFAULT_FEATURE_LZMA_FAST
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_VERBOSE
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_TIMEZONE
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_PRESERVE_HARDLINKS
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_BASENAME
|
||||
bool
|
||||
default y
|
||||
@ -568,6 +571,9 @@ config BUSYBOX_DEFAULT_DF
|
||||
config BUSYBOX_DEFAULT_FEATURE_DF_FANCY
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_DIRNAME
|
||||
bool
|
||||
default y
|
||||
@ -908,15 +914,6 @@ config BUSYBOX_DEFAULT_WHOAMI
|
||||
config BUSYBOX_DEFAULT_YES
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_VERBOSE
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_PRESERVE_HARDLINKS
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_CHVT
|
||||
bool
|
||||
default n
|
||||
@ -1118,9 +1115,21 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_PRINT0
|
||||
config BUSYBOX_DEFAULT_FEATURE_FIND_MTIME
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_FIND_ATIME
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_FIND_CTIME
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_FIND_MMIN
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_FIND_AMIN
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_FIND_CMIN
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_FIND_PERM
|
||||
bool
|
||||
default y
|
||||
@ -1142,6 +1151,9 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_NEWER
|
||||
config BUSYBOX_DEFAULT_FEATURE_FIND_INUM
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_FIND_SAMEFILE
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_FIND_EXEC
|
||||
bool
|
||||
default y
|
||||
@ -2211,6 +2223,15 @@ config BUSYBOX_DEFAULT_FEATURE_PREFER_IPV4_ADDRESS
|
||||
config BUSYBOX_DEFAULT_VERBOSE_RESOLUTION_ERRORS
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_ETC_SERVICES
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_HWIB
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_TLS_SHA1
|
||||
bool
|
||||
default n
|
||||
@ -2265,6 +2286,9 @@ config BUSYBOX_DEFAULT_DNSDOMAINNAME
|
||||
config BUSYBOX_DEFAULT_HTTPD
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_HTTPD_PORT_DEFAULT
|
||||
int
|
||||
default 80
|
||||
config BUSYBOX_DEFAULT_FEATURE_HTTPD_RANGES
|
||||
bool
|
||||
default n
|
||||
@ -2544,6 +2568,9 @@ config BUSYBOX_DEFAULT_TELNETD
|
||||
config BUSYBOX_DEFAULT_FEATURE_TELNETD_STANDALONE
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_TELNETD_PORT_DEFAULT
|
||||
int
|
||||
default 23
|
||||
config BUSYBOX_DEFAULT_FEATURE_TELNETD_INETD_WAIT
|
||||
bool
|
||||
default n
|
||||
@ -2700,6 +2727,9 @@ config BUSYBOX_DEFAULT_LPR
|
||||
config BUSYBOX_DEFAULT_LPQ
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET
|
||||
string
|
||||
default ""
|
||||
config BUSYBOX_DEFAULT_MAKEMIME
|
||||
bool
|
||||
default n
|
||||
@ -2718,9 +2748,12 @@ config BUSYBOX_DEFAULT_FEATURE_REFORMIME_COMPAT
|
||||
config BUSYBOX_DEFAULT_SENDMAIL
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET
|
||||
string
|
||||
default ""
|
||||
config BUSYBOX_DEFAULT_FEATURE_FAST_TOP
|
||||
bool
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FREE
|
||||
bool
|
||||
default y
|
||||
@ -2835,9 +2868,6 @@ config BUSYBOX_DEFAULT_FEATURE_UPTIME_UTMP_SUPPORT
|
||||
config BUSYBOX_DEFAULT_WATCH
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS
|
||||
bool
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_CHPST
|
||||
bool
|
||||
default n
|
||||
|
||||
@ -5,14 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=busybox
|
||||
PKG_VERSION:=1.34.1
|
||||
PKG_VERSION:=1.35.0
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
PKG_FLAGS:=essential
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=https://www.busybox.net/downloads \
|
||||
http://sources.buildroot.net
|
||||
PKG_HASH:=415fbd89e5344c96acf449d94a6f956dbed62e18e835fc83e064db33a34bd549
|
||||
PKG_HASH:=faeeb244c35a348a334f4a59e44626ee870fb07b6884d68c10ae8bc19f83a694
|
||||
|
||||
PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@ -204,6 +204,20 @@ config BUSYBOX_CONFIG_FEATURE_CPIO_P
|
||||
depends on BUSYBOX_CONFIG_FEATURE_CPIO_O
|
||||
help
|
||||
Passthrough mode. Rarely used.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_CPIO_IGNORE_DEVNO
|
||||
bool "Support --ignore-devno like GNU cpio"
|
||||
default BUSYBOX_DEFAULT_FEATURE_CPIO_IGNORE_DEVNO
|
||||
depends on BUSYBOX_CONFIG_FEATURE_CPIO_O && BUSYBOX_CONFIG_LONG_OPTS
|
||||
help
|
||||
Optionally ignore device numbers when creating archives.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_CPIO_RENUMBER_INODES
|
||||
bool "Support --renumber-inodes like GNU cpio"
|
||||
default BUSYBOX_DEFAULT_FEATURE_CPIO_RENUMBER_INODES
|
||||
depends on BUSYBOX_CONFIG_FEATURE_CPIO_O && BUSYBOX_CONFIG_LONG_OPTS
|
||||
help
|
||||
Optionally renumber inodes when creating archives.
|
||||
config BUSYBOX_CONFIG_DPKG
|
||||
bool "dpkg (43 kb)"
|
||||
default BUSYBOX_DEFAULT_DPKG
|
||||
|
||||
@ -6,6 +6,47 @@
|
||||
|
||||
menu "Coreutils"
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_VERBOSE
|
||||
bool "Support verbose options (usually -v) for various applets"
|
||||
default BUSYBOX_DEFAULT_FEATURE_VERBOSE
|
||||
help
|
||||
Enable cp -v, rm -v and similar messages.
|
||||
Also enables long option (--verbose) if it exists.
|
||||
Without this option, -v is accepted but ignored.
|
||||
|
||||
comment "Common options for date and touch"
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_TIMEZONE
|
||||
bool "Allow timezone in dates"
|
||||
default BUSYBOX_DEFAULT_FEATURE_TIMEZONE
|
||||
depends on BUSYBOX_CONFIG_DESKTOP
|
||||
help
|
||||
Permit the use of timezones when parsing user-provided data
|
||||
strings, e.g. '1996-04-09 12:45:00 -0500'.
|
||||
|
||||
This requires support for the '%z' extension to strptime() which
|
||||
may not be available in all implementations.
|
||||
|
||||
comment "Common options for cp and mv"
|
||||
depends on BUSYBOX_CONFIG_CP || BUSYBOX_CONFIG_MV
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_PRESERVE_HARDLINKS
|
||||
bool "Preserve hard links"
|
||||
default BUSYBOX_DEFAULT_FEATURE_PRESERVE_HARDLINKS
|
||||
depends on BUSYBOX_CONFIG_CP || BUSYBOX_CONFIG_MV
|
||||
help
|
||||
Allow cp and mv to preserve hard links.
|
||||
|
||||
comment "Common options for df, du, ls"
|
||||
depends on BUSYBOX_CONFIG_DF || BUSYBOX_CONFIG_DU || BUSYBOX_CONFIG_LS
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_HUMAN_READABLE
|
||||
bool "Support human readable output (example 13k, 23M, 235G)"
|
||||
default BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE
|
||||
depends on BUSYBOX_CONFIG_DF || BUSYBOX_CONFIG_DU || BUSYBOX_CONFIG_LS
|
||||
help
|
||||
Allow df, du, and ls to have human readable output.
|
||||
|
||||
config BUSYBOX_CONFIG_BASENAME
|
||||
bool "basename (438 bytes)"
|
||||
default BUSYBOX_DEFAULT_BASENAME
|
||||
@ -200,6 +241,26 @@ config BUSYBOX_CONFIG_FEATURE_DF_FANCY
|
||||
-a Show all filesystems
|
||||
-i Inodes
|
||||
-B <SIZE> Blocksize
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_SKIP_ROOTFS
|
||||
bool "Skip rootfs in mount table"
|
||||
default BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS
|
||||
depends on BUSYBOX_CONFIG_DF
|
||||
help
|
||||
Ignore rootfs entry in mount table.
|
||||
|
||||
In Linux, kernel has a special filesystem, rootfs, which is initially
|
||||
mounted on /. It contains initramfs data, if kernel is configured
|
||||
to have one. Usually, another file system is mounted over / early
|
||||
in boot process, and therefore most tools which manipulate
|
||||
mount table, such as df, will skip rootfs entry.
|
||||
|
||||
However, some systems do not mount anything on /.
|
||||
If you need to configure busybox for one of these systems,
|
||||
you may find it useful to turn this option off to make df show
|
||||
initramfs statistics.
|
||||
|
||||
Otherwise, choose Y.
|
||||
config BUSYBOX_CONFIG_DIRNAME
|
||||
bool "dirname (329 bytes)"
|
||||
default BUSYBOX_DEFAULT_DIRNAME
|
||||
@ -896,34 +957,4 @@ config BUSYBOX_CONFIG_YES
|
||||
yes is used to repeatedly output a specific string, or
|
||||
the default string 'y'.
|
||||
|
||||
comment "Common options"
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_VERBOSE
|
||||
bool "Support verbose options (usually -v) for various applets"
|
||||
default BUSYBOX_DEFAULT_FEATURE_VERBOSE
|
||||
help
|
||||
Enable cp -v, rm -v and similar messages.
|
||||
Also enables long option (--verbose) if it exists.
|
||||
Without this option, -v is accepted but ignored.
|
||||
|
||||
comment "Common options for cp and mv"
|
||||
depends on BUSYBOX_CONFIG_CP || BUSYBOX_CONFIG_MV
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_PRESERVE_HARDLINKS
|
||||
bool "Preserve hard links"
|
||||
default BUSYBOX_DEFAULT_FEATURE_PRESERVE_HARDLINKS
|
||||
depends on BUSYBOX_CONFIG_CP || BUSYBOX_CONFIG_MV
|
||||
help
|
||||
Allow cp and mv to preserve hard links.
|
||||
|
||||
comment "Common options for df, du, ls"
|
||||
depends on BUSYBOX_CONFIG_DF || BUSYBOX_CONFIG_DU || BUSYBOX_CONFIG_LS
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_HUMAN_READABLE
|
||||
bool "Support human readable output (example 13k, 23M, 235G)"
|
||||
default BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE
|
||||
depends on BUSYBOX_CONFIG_DF || BUSYBOX_CONFIG_DU || BUSYBOX_CONFIG_LS
|
||||
help
|
||||
Allow df, du, and ls to have human readable output.
|
||||
|
||||
endmenu
|
||||
|
||||
@ -23,21 +23,53 @@ config BUSYBOX_CONFIG_FEATURE_FIND_PRINT0
|
||||
interpreted by other programs.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FIND_MTIME
|
||||
bool "Enable -mtime: modified time matching"
|
||||
bool "Enable -mtime: modification time matching"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FIND_MTIME
|
||||
depends on BUSYBOX_CONFIG_FIND
|
||||
help
|
||||
Allow searching based on the modification time of
|
||||
files, in days.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FIND_ATIME
|
||||
bool "Enable -atime: access time matching"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FIND_ATIME
|
||||
depends on BUSYBOX_CONFIG_FEATURE_FIND_MTIME
|
||||
help
|
||||
Allow searching based on the access time of
|
||||
files, in days.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FIND_CTIME
|
||||
bool "Enable -ctime: status change timestamp matching"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FIND_CTIME
|
||||
depends on BUSYBOX_CONFIG_FEATURE_FIND_MTIME
|
||||
help
|
||||
Allow searching based on the status change timestamp of
|
||||
files, in days.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FIND_MMIN
|
||||
bool "Enable -mmin: modified time matching by minutes"
|
||||
bool "Enable -mmin: modification time matching by minutes"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FIND_MMIN
|
||||
depends on BUSYBOX_CONFIG_FIND
|
||||
help
|
||||
Allow searching based on the modification time of
|
||||
files, in minutes.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FIND_AMIN
|
||||
bool "Enable -amin: access time matching by minutes"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FIND_AMIN
|
||||
depends on BUSYBOX_CONFIG_FEATURE_FIND_MMIN
|
||||
help
|
||||
Allow searching based on the access time of
|
||||
files, in minutes.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FIND_CMIN
|
||||
bool "Enable -cmin: status change timestamp matching by minutes"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FIND_CMIN
|
||||
depends on BUSYBOX_CONFIG_FEATURE_FIND_MMIN
|
||||
help
|
||||
Allow searching based on the status change timestamp of
|
||||
files, in minutes.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FIND_PERM
|
||||
bool "Enable -perm: permissions matching"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FIND_PERM
|
||||
@ -79,6 +111,13 @@ config BUSYBOX_CONFIG_FEATURE_FIND_INUM
|
||||
default BUSYBOX_DEFAULT_FEATURE_FIND_INUM
|
||||
depends on BUSYBOX_CONFIG_FIND
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FIND_SAMEFILE
|
||||
bool "Enable -samefile: reference file matching"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FIND_SAMEFILE
|
||||
depends on BUSYBOX_CONFIG_FIND
|
||||
help
|
||||
Support the 'find -samefile' option for searching by a reference file.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FIND_EXEC
|
||||
bool "Enable -exec: execute commands"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FIND_EXEC
|
||||
|
||||
@ -117,32 +117,73 @@ config BUSYBOX_CONFIG_SHA3_SMALL
|
||||
64-bit x86: +270 bytes of code, 45% faster
|
||||
32-bit x86: +450 bytes of code, 75% faster
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FAST_TOP
|
||||
bool "Faster /proc scanning code (+100 bytes)"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FAST_TOP # all "fast or small" options default to small
|
||||
config BUSYBOX_CONFIG_FEATURE_NON_POSIX_CP
|
||||
bool "Non-POSIX, but safer, copying to special nodes"
|
||||
default BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP
|
||||
help
|
||||
This option makes top and ps ~20% faster (or 20% less CPU hungry),
|
||||
but code size is slightly bigger.
|
||||
With this option, "cp file symlink" will delete symlink
|
||||
and create a regular file. This does not conform to POSIX,
|
||||
but prevents a symlink attack.
|
||||
Similarly, "cp file device" will not send file's data
|
||||
to the device. (To do that, use "cat file >device")
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_ETC_NETWORKS
|
||||
bool "Support /etc/networks"
|
||||
default BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS
|
||||
config BUSYBOX_CONFIG_FEATURE_VERBOSE_CP_MESSAGE
|
||||
bool "Give more precise messages when copy fails (cp, mv etc)"
|
||||
default BUSYBOX_DEFAULT_FEATURE_VERBOSE_CP_MESSAGE
|
||||
help
|
||||
Enable support for network names in /etc/networks. This is
|
||||
a rarely used feature which allows you to use names
|
||||
instead of IP/mask pairs in route command.
|
||||
Error messages with this feature enabled:
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_ETC_SERVICES
|
||||
bool "Consult /etc/services even for well-known ports"
|
||||
default BUSYBOX_DEFAULT_FEATURE_ETC_SERVICES
|
||||
$ cp file /does_not_exist/file
|
||||
cp: cannot create '/does_not_exist/file': Path does not exist
|
||||
$ cp file /vmlinuz/file
|
||||
cp: cannot stat '/vmlinuz/file': Path has non-directory component
|
||||
|
||||
If this feature is not enabled, they will be, respectively:
|
||||
|
||||
cp: cannot create '/does_not_exist/file': No such file or directory
|
||||
cp: cannot stat '/vmlinuz/file': Not a directory
|
||||
|
||||
This will cost you ~60 bytes.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_USE_SENDFILE
|
||||
bool "Use sendfile system call"
|
||||
default BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE
|
||||
help
|
||||
Look up e.g. "telnet" and "http" in /etc/services file
|
||||
instead of assuming ports 23 and 80.
|
||||
This is almost never necessary (everybody uses standard ports),
|
||||
and it makes sense to avoid reading this file.
|
||||
If you disable this option, in the cases where port is explicitly
|
||||
specified as a service name (e.g. "telnet HOST PORTNAME"),
|
||||
it will still be looked up in /etc/services.
|
||||
When enabled, busybox will use the kernel sendfile() function
|
||||
instead of read/write loops to copy data between file descriptors
|
||||
(for example, cp command does this a lot).
|
||||
If sendfile() doesn't work, copying code falls back to read/write
|
||||
loop. sendfile() was originally implemented for faster I/O
|
||||
from files to sockets, but since Linux 2.6.33 it was extended
|
||||
to work for many more file types.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_COPYBUF_KB
|
||||
int "Copy buffer size, in kilobytes"
|
||||
range 1 1024
|
||||
default BUSYBOX_DEFAULT_FEATURE_COPYBUF_KB
|
||||
help
|
||||
Size of buffer used by cp, mv, install, wget etc.
|
||||
Buffers which are 4 kb or less will be allocated on stack.
|
||||
Bigger buffers will be allocated with mmap, with fallback to 4 kb
|
||||
stack buffer if mmap fails.
|
||||
|
||||
config BUSYBOX_CONFIG_MONOTONIC_SYSCALL
|
||||
bool "Use clock_gettime(CLOCK_MONOTONIC) syscall"
|
||||
default BUSYBOX_DEFAULT_MONOTONIC_SYSCALL
|
||||
help
|
||||
Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring
|
||||
time intervals (time, ping, traceroute etc need this).
|
||||
Probably requires Linux 2.6+. If not selected, gettimeofday
|
||||
will be used instead (which gives wrong results if date/time
|
||||
is reset).
|
||||
|
||||
config BUSYBOX_CONFIG_IOCTL_HEX2STR_ERROR
|
||||
bool "Use ioctl names rather than hex values in error messages"
|
||||
default BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR
|
||||
help
|
||||
Use ioctl names rather than hex values in error messages
|
||||
(e.g. VT_DISALLOCATE rather than 0x5608). If disabled this
|
||||
saves about 1400 bytes.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_EDITING
|
||||
bool "Command line editing"
|
||||
@ -358,96 +399,3 @@ config BUSYBOX_CONFIG_UNICODE_PRESERVE_BROKEN
|
||||
For example, this means that entering 'l', 's', ' ', 0xff, [Enter]
|
||||
at shell prompt will list file named 0xff (single char name
|
||||
with char value 255), not file named '?'.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_NON_POSIX_CP
|
||||
bool "Non-POSIX, but safer, copying to special nodes"
|
||||
default BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP
|
||||
help
|
||||
With this option, "cp file symlink" will delete symlink
|
||||
and create a regular file. This does not conform to POSIX,
|
||||
but prevents a symlink attack.
|
||||
Similarly, "cp file device" will not send file's data
|
||||
to the device. (To do that, use "cat file >device")
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_VERBOSE_CP_MESSAGE
|
||||
bool "Give more precise messages when copy fails (cp, mv etc)"
|
||||
default BUSYBOX_DEFAULT_FEATURE_VERBOSE_CP_MESSAGE
|
||||
help
|
||||
Error messages with this feature enabled:
|
||||
|
||||
$ cp file /does_not_exist/file
|
||||
cp: cannot create '/does_not_exist/file': Path does not exist
|
||||
$ cp file /vmlinuz/file
|
||||
cp: cannot stat '/vmlinuz/file': Path has non-directory component
|
||||
|
||||
If this feature is not enabled, they will be, respectively:
|
||||
|
||||
cp: cannot create '/does_not_exist/file': No such file or directory
|
||||
cp: cannot stat '/vmlinuz/file': Not a directory
|
||||
|
||||
This will cost you ~60 bytes.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_USE_SENDFILE
|
||||
bool "Use sendfile system call"
|
||||
default BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE
|
||||
help
|
||||
When enabled, busybox will use the kernel sendfile() function
|
||||
instead of read/write loops to copy data between file descriptors
|
||||
(for example, cp command does this a lot).
|
||||
If sendfile() doesn't work, copying code falls back to read/write
|
||||
loop. sendfile() was originally implemented for faster I/O
|
||||
from files to sockets, but since Linux 2.6.33 it was extended
|
||||
to work for many more file types.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_COPYBUF_KB
|
||||
int "Copy buffer size, in kilobytes"
|
||||
range 1 1024
|
||||
default BUSYBOX_DEFAULT_FEATURE_COPYBUF_KB
|
||||
help
|
||||
Size of buffer used by cp, mv, install, wget etc.
|
||||
Buffers which are 4 kb or less will be allocated on stack.
|
||||
Bigger buffers will be allocated with mmap, with fallback to 4 kb
|
||||
stack buffer if mmap fails.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_SKIP_ROOTFS
|
||||
bool "Skip rootfs in mount table"
|
||||
default BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS
|
||||
help
|
||||
Ignore rootfs entry in mount table.
|
||||
|
||||
In Linux, kernel has a special filesystem, rootfs, which is initially
|
||||
mounted on /. It contains initramfs data, if kernel is configured
|
||||
to have one. Usually, another file system is mounted over / early
|
||||
in boot process, and therefore most tools which manipulate
|
||||
mount table, such as df, will skip rootfs entry.
|
||||
|
||||
However, some systems do not mount anything on /.
|
||||
If you need to configure busybox for one of these systems,
|
||||
you may find it useful to turn this option off to make df show
|
||||
initramfs statistics.
|
||||
|
||||
Otherwise, choose Y.
|
||||
|
||||
config BUSYBOX_CONFIG_MONOTONIC_SYSCALL
|
||||
bool "Use clock_gettime(CLOCK_MONOTONIC) syscall"
|
||||
default BUSYBOX_DEFAULT_MONOTONIC_SYSCALL
|
||||
help
|
||||
Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring
|
||||
time intervals (time, ping, traceroute etc need this).
|
||||
Probably requires Linux 2.6+. If not selected, gettimeofday
|
||||
will be used instead (which gives wrong results if date/time
|
||||
is reset).
|
||||
|
||||
config BUSYBOX_CONFIG_IOCTL_HEX2STR_ERROR
|
||||
bool "Use ioctl names rather than hex values in error messages"
|
||||
default BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR
|
||||
help
|
||||
Use ioctl names rather than hex values in error messages
|
||||
(e.g. VT_DISALLOCATE rather than 0x5608). If disabled this
|
||||
saves about 1400 bytes.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_HWIB
|
||||
bool "Support infiniband HW"
|
||||
default BUSYBOX_DEFAULT_FEATURE_HWIB
|
||||
help
|
||||
Support for printing infiniband addresses in network applets.
|
||||
|
||||
@ -1,6 +1,13 @@
|
||||
# DO NOT EDIT. This file is generated from Config.src
|
||||
menu "Mail Utilities"
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_MIME_CHARSET
|
||||
string "Default charset"
|
||||
default BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET
|
||||
depends on BUSYBOX_CONFIG_MAKEMIME || BUSYBOX_CONFIG_REFORMIME || BUSYBOX_CONFIG_SENDMAIL
|
||||
help
|
||||
Default charset of the message.
|
||||
|
||||
config BUSYBOX_CONFIG_MAKEMIME
|
||||
bool "makemime (5.4 kb)"
|
||||
default BUSYBOX_DEFAULT_MAKEMIME
|
||||
@ -41,11 +48,4 @@ config BUSYBOX_CONFIG_SENDMAIL
|
||||
help
|
||||
Barebones sendmail.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_MIME_CHARSET
|
||||
string "Default charset"
|
||||
default BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET
|
||||
depends on BUSYBOX_CONFIG_MAKEMIME || BUSYBOX_CONFIG_REFORMIME || BUSYBOX_CONFIG_SENDMAIL
|
||||
help
|
||||
Default charset of the message.
|
||||
|
||||
endmenu
|
||||
|
||||
@ -47,6 +47,32 @@ config BUSYBOX_CONFIG_VERBOSE_RESOLUTION_ERRORS
|
||||
"can't resolve 'hostname.com'" and want to know more.
|
||||
This may increase size of your executable a bit.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_ETC_NETWORKS
|
||||
bool "Support /etc/networks"
|
||||
default BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS
|
||||
help
|
||||
Enable support for network names in /etc/networks. This is
|
||||
a rarely used feature which allows you to use names
|
||||
instead of IP/mask pairs in route command.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_ETC_SERVICES
|
||||
bool "Consult /etc/services even for well-known ports"
|
||||
default BUSYBOX_DEFAULT_FEATURE_ETC_SERVICES
|
||||
help
|
||||
Look up e.g. "telnet" and "http" in /etc/services file
|
||||
instead of assuming ports 23 and 80.
|
||||
This is almost never necessary (everybody uses standard ports),
|
||||
and it makes sense to avoid reading this file.
|
||||
If you disable this option, in the cases where port is explicitly
|
||||
specified as a service name (e.g. "telnet HOST PORTNAME"),
|
||||
it will still be looked up in /etc/services.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_HWIB
|
||||
bool "Support infiniband HW"
|
||||
default BUSYBOX_DEFAULT_FEATURE_HWIB
|
||||
help
|
||||
Support for printing infiniband addresses in network applets.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_TLS_SHA1
|
||||
bool "In TLS code, support ciphers which use deprecated SHA1"
|
||||
depends on BUSYBOX_CONFIG_TLS
|
||||
@ -173,6 +199,12 @@ config BUSYBOX_CONFIG_HTTPD
|
||||
help
|
||||
HTTP server.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_HTTPD_PORT_DEFAULT
|
||||
int "Default port"
|
||||
default BUSYBOX_DEFAULT_FEATURE_HTTPD_PORT_DEFAULT
|
||||
range 1 65535
|
||||
depends on BUSYBOX_CONFIG_HTTPD
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES
|
||||
bool "Support 'Ranges:' header"
|
||||
default BUSYBOX_DEFAULT_FEATURE_HTTPD_RANGES
|
||||
@ -774,7 +806,6 @@ config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS
|
||||
bool "Enable long options"
|
||||
default BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_LONG_OPTIONS
|
||||
depends on BUSYBOX_CONFIG_FEATURE_NSLOOKUP_BIG && BUSYBOX_CONFIG_LONG_OPTS
|
||||
|
||||
config BUSYBOX_CONFIG_NTPD
|
||||
bool "ntpd (22 kb)"
|
||||
default BUSYBOX_DEFAULT_NTPD
|
||||
@ -945,6 +976,12 @@ config BUSYBOX_CONFIG_FEATURE_TELNETD_STANDALONE
|
||||
help
|
||||
Selecting this will make telnetd able to run standalone.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_TELNETD_PORT_DEFAULT
|
||||
int "Default port"
|
||||
default BUSYBOX_DEFAULT_FEATURE_TELNETD_PORT_DEFAULT
|
||||
range 1 65535
|
||||
depends on BUSYBOX_CONFIG_FEATURE_TELNETD_STANDALONE
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_TELNETD_INETD_WAIT
|
||||
bool "Support -w SEC option (inetd wait mode)"
|
||||
default BUSYBOX_DEFAULT_FEATURE_TELNETD_INETD_WAIT
|
||||
|
||||
@ -6,6 +6,21 @@
|
||||
|
||||
menu "Process Utilities"
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_FAST_TOP
|
||||
bool "Faster /proc scanning code (+100 bytes)"
|
||||
default BUSYBOX_DEFAULT_FEATURE_FAST_TOP # all "fast or small" options default to small
|
||||
help
|
||||
This option makes top and ps ~20% faster (or 20% less CPU hungry),
|
||||
but code size is slightly bigger.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_SHOW_THREADS
|
||||
bool "Support thread display in ps/pstree/top"
|
||||
default BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS
|
||||
depends on BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_PSTREE
|
||||
help
|
||||
Enables the ps -T option, showing of threads in pstree,
|
||||
and 'h' command in top.
|
||||
|
||||
config BUSYBOX_CONFIG_FREE
|
||||
bool "free (3.1 kb)"
|
||||
default BUSYBOX_DEFAULT_FREE
|
||||
@ -259,12 +274,4 @@ config BUSYBOX_CONFIG_WATCH
|
||||
watch is used to execute a program periodically, showing
|
||||
output to the screen.
|
||||
|
||||
config BUSYBOX_CONFIG_FEATURE_SHOW_THREADS
|
||||
bool "Support thread display in ps/pstree/top"
|
||||
default BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS
|
||||
depends on BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_PSTREE
|
||||
help
|
||||
Enables the ps -T option, showing of threads in pstree,
|
||||
and 'h' command in top.
|
||||
|
||||
endmenu
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/networking/libiproute/iplink.c
|
||||
+++ b/networking/libiproute/iplink.c
|
||||
@@ -652,7 +652,7 @@ static int do_add_or_delete(char **argv,
|
||||
@@ -683,7 +683,7 @@ static int do_add_or_delete(char **argv,
|
||||
}
|
||||
xrtnl_open(&rth);
|
||||
ll_init_map(&rth);
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=e2fsprogs
|
||||
PKG_VERSION:=1.45.6
|
||||
PKG_RELEASE:=2
|
||||
PKG_VERSION:=1.46.5
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
|
||||
PKG_HASH:=ffa7ae6954395abdc50d0f8605d8be84736465afc53b8938ef473fcf7ff44256
|
||||
PKG_HASH:=2f16c9176704cf645dc69d5b15ff704ae722d665df38b2ed3cfc249757d8d81e
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=NOTICE
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/lib/et/Makefile.in
|
||||
+++ b/lib/et/Makefile.in
|
||||
@@ -25,8 +25,8 @@ SHARE_FILES= et_c.awk et_h.awk
|
||||
@@ -26,8 +26,8 @@ SHARE_FILES= et_c.awk et_h.awk
|
||||
LIBRARY= libcom_err
|
||||
LIBDIR= et
|
||||
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
From e33ecf1595e390b2657018442c68ae824b3e13b4 Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Tue, 15 Dec 2020 23:58:53 +0100
|
||||
Subject: [PATCH e2fsprogs] build: Add SYSLIBS to e4crypt linking
|
||||
|
||||
The $(SYSLIBS) was missing when linking the e4crypt application. This is
|
||||
available in the e4crypt.profiled variant, so I assume this was just
|
||||
missing in the normal variant and is not left out intentionally.
|
||||
|
||||
This fixes building e2fsprogrs with -fsanitize=undefined in the global
|
||||
CFLAGS nad LDFLAGS.
|
||||
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
---
|
||||
misc/Makefile.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/misc/Makefile.in
|
||||
+++ b/misc/Makefile.in
|
||||
@@ -242,7 +242,7 @@ e4defrag: $(E4DEFRAG_OBJS) $(DEPLIBS)
|
||||
e4crypt: $(E4CRYPT_OBJS) $(DEPLIBS) $(DEPSTATIC_LIBUUID)
|
||||
$(E) " LD $@"
|
||||
$(Q) $(CC) $(ALL_LDFLAGS) -o e4crypt $(E4CRYPT_OBJS) \
|
||||
- $(LIBUUID) $(LIBS)
|
||||
+ $(LIBUUID) $(LIBS) $(SYSLIBS)
|
||||
|
||||
e4defrag.profiled: $(E4DEFRAG_OBJS) $(PROFILED_DEPLIBS)
|
||||
$(E) " LD $@"
|
||||
@ -52,7 +52,7 @@ TARGET_CFLAGS += \
|
||||
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
MAKE_VARS += CHECK_RUN_DIR=0
|
||||
MAKE_FLAGS += CHECK_RUN_DIR=0
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default,mdadm)
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=util-linux
|
||||
PKG_VERSION:=2.37
|
||||
PKG_VERSION:=2.37.3
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.37
|
||||
PKG_HASH:=bd07b7e98839e0359842110525a3032fdb8eaf3a90bedde3dd1652d32d15cce5
|
||||
PKG_HASH:=590c592e58cd6bf38519cb467af05ce6a1ab18040e3e3418f24bcfb2f55f9776
|
||||
PKG_CPE_ID:=cpe:/a:kernel:util-linux
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
@ -523,6 +523,7 @@ CONFIGURE_ARGS += \
|
||||
--disable-lslogins \
|
||||
--disable-runuser \
|
||||
--disable-chfn-chsh \
|
||||
--disable-raw \
|
||||
--without-python \
|
||||
--without-udev \
|
||||
--without-readline \
|
||||
|
||||
28
scripts/config/.gitignore
vendored
28
scripts/config/.gitignore
vendored
@ -1,22 +1,16 @@
|
||||
#
|
||||
# Generated files
|
||||
#
|
||||
*.moc
|
||||
*conf-cfg
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
/conf
|
||||
/[gmnq]conf
|
||||
/[gmnq]conf-cfg
|
||||
/qconf-moc.cc
|
||||
|
||||
#
|
||||
# configuration programs
|
||||
#
|
||||
conf
|
||||
mconf
|
||||
nconf
|
||||
qconf
|
||||
gconf
|
||||
# From linux kconfig parent directories
|
||||
.*
|
||||
|
||||
#
|
||||
# temporary files from older version. Should be removed
|
||||
#
|
||||
# OpenWrt-generated files
|
||||
mconf_check
|
||||
|
||||
# Temporary files from older versions. They should be removed after the
|
||||
# end of support for OpenWrt 19.07.
|
||||
zconf.???.c
|
||||
zconf.hash.c
|
||||
.tmp_qtcheck
|
||||
|
||||
@ -5,11 +5,11 @@
|
||||
.PHONY: clean all
|
||||
all: conf mconf
|
||||
clean:
|
||||
rm -f *.o lxdialog/*.o *.moc $(clean-files) conf mconf qconf nconf
|
||||
rm -f *.o lxdialog/*.o *.moc .*.cmd $(clean-files)
|
||||
|
||||
# This clean-files definition is here to ensure that temporary files from the
|
||||
# previous version are removed by make config-clean.
|
||||
# It should be removed or emptied when this Makefile get updated again.
|
||||
# It should be emptied after the end of support for OpenWrt 19.07.
|
||||
clean-files := zconf.tab.c zconf.lex.c zconf.hash.c .tmp_qtcheck
|
||||
|
||||
# ===========================================================================
|
||||
@ -24,9 +24,11 @@ src:=.
|
||||
obj:=.
|
||||
Q:=$(if $V,,@)
|
||||
cmd = $(cmd_$(1))
|
||||
dot-target = $(dir $@).$(notdir $@)
|
||||
|
||||
# taken from ../Kbuild.include
|
||||
# some definitions taken from ../Kbuild.include
|
||||
dot-target = $(dir $@).$(notdir $@)
|
||||
squote := '
|
||||
escsq = $(subst $(squote),'\$(squote)',$1)
|
||||
define filechk
|
||||
$(Q)set -e; \
|
||||
mkdir -p $(dir $@); \
|
||||
@ -37,23 +39,29 @@ define filechk
|
||||
mv -f $(dot-target).tmp $@; \
|
||||
fi
|
||||
endef
|
||||
cmd-check = $(if $(strip $(cmd_$@)),,1)
|
||||
make-cmd = $(call escsq,$(subst $(pound),$$(pound),$(subst $$,$$$$,$(cmd_$(1)))))
|
||||
newer-prereqs = $(filter-out $(PHONY),$?)
|
||||
if_changed = $(if $(newer-prereqs)$(cmd-check), \
|
||||
$(cmd); \
|
||||
printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)
|
||||
|
||||
### Stripped down upstream Makefile follows:
|
||||
# ===========================================================================
|
||||
# object files used by all kconfig flavours
|
||||
common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \
|
||||
symbol.o util.o
|
||||
common-objs := confdata.o expr.o lexer.lex.o menu.o parser.tab.o \
|
||||
preprocess.o symbol.o util.o
|
||||
|
||||
$(obj)/lexer.lex.o: $(obj)/parser.tab.h
|
||||
HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)
|
||||
HOSTCFLAGS_parser.tab.o := -I $(srctree)/$(src)
|
||||
|
||||
# conf: Used for defconfig, oldconfig and related targets
|
||||
hostprogs-y += conf
|
||||
hostprogs += conf
|
||||
conf-objs := conf.o $(common-objs)
|
||||
|
||||
# nconf: Used for the nconfig target based on ncurses
|
||||
hostprogs-y += nconf
|
||||
hostprogs += nconf
|
||||
nconf-objs := nconf.o nconf.gui.o $(common-objs)
|
||||
|
||||
HOSTLDLIBS_nconf = $(shell . $(obj)/nconf-cfg && echo $$libs)
|
||||
@ -63,7 +71,7 @@ HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/nconf-cfg && echo $$cflags)
|
||||
$(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg
|
||||
|
||||
# mconf: Used for the menuconfig target based on lxdialog
|
||||
hostprogs-y += mconf
|
||||
hostprogs += mconf
|
||||
lxdialog := $(addprefix lxdialog/, \
|
||||
checklist.o inputbox.o menubox.o textbox.o util.o yesno.o)
|
||||
mconf-objs := mconf.o $(lxdialog) $(common-objs)
|
||||
@ -75,20 +83,23 @@ $(foreach f, mconf.o $(lxdialog), \
|
||||
$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/mconf-cfg
|
||||
|
||||
# qconf: Used for the xconfig target based on Qt
|
||||
hostprogs-y += qconf
|
||||
qconf-cxxobjs := qconf.o
|
||||
hostprogs += qconf
|
||||
qconf-cxxobjs := qconf.o qconf-moc.o
|
||||
qconf-objs := images.o $(common-objs)
|
||||
|
||||
HOSTLDLIBS_qconf = $(shell . $(obj)/qconf-cfg && echo $$libs)
|
||||
HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/qconf-cfg && echo $$cflags)
|
||||
HOSTCXXFLAGS_qconf-moc.o = $(shell . $(obj)/qconf-cfg && echo $$cflags)
|
||||
|
||||
$(obj)/qconf.o: $(obj)/qconf-cfg $(obj)/qconf.moc
|
||||
$(obj)/qconf.o: $(obj)/qconf-cfg
|
||||
|
||||
quiet_cmd_moc = MOC $@
|
||||
cmd_moc = $(shell . $(obj)/qconf-cfg && echo $$moc) -i $< -o $@
|
||||
cmd_moc = $(shell . $(obj)/qconf-cfg && echo $$moc) $< -o $@
|
||||
|
||||
$(obj)/%.moc: $(src)/%.h $(obj)/qconf-cfg
|
||||
$(call cmd,moc)
|
||||
$(obj)/qconf-moc.cc: $(src)/qconf.h $(obj)/qconf-cfg FORCE
|
||||
$(call if_changed,moc)
|
||||
|
||||
targets += qconf-moc.cc
|
||||
|
||||
# check if necessary packages are available, and configure build flags
|
||||
filechk_conf_cfg = $(CONFIG_SHELL) $<
|
||||
@ -102,6 +113,8 @@ clean-files += *conf-cfg
|
||||
# OpenWrt rules and final adjustments that need to be made after reading the
|
||||
# full upstream Makefile
|
||||
|
||||
clean-files += $(targets) $(hostprogs)
|
||||
|
||||
FORCE:
|
||||
|
||||
ifdef BUILD_SHIPPED_FILES
|
||||
@ -117,24 +130,25 @@ clean-files += $(shipped-files)
|
||||
flex -L -o$@ $<
|
||||
endif
|
||||
|
||||
$(foreach f, mconf.o $(lxdialog), \
|
||||
$(eval $f: CFLAGS+=$$(HOSTCFLAGS_$f)))
|
||||
$(foreach f,$(conf-objs) $(filter-out $(common-objs),$(mconf-objs) \
|
||||
$(qconf-objs) \
|
||||
$(nconf-objs)), \
|
||||
$(eval $(obj)/$f: CFLAGS+=$$(HOSTCFLAGS_$f)))
|
||||
|
||||
$(obj)/lexer.lex.o: CFLAGS += $(HOSTCFLAGS_lexer.lex.o)
|
||||
$(obj)/parser.tab.o: CFLAGS += $(HOSTCFLAGS_parser.tab.o)
|
||||
$(obj)/qconf.o: CXXFLAGS+=$(HOSTCXXFLAGS_qconf.o)
|
||||
$(foreach f,$(qconf-cxxobjs), \
|
||||
$(eval $(obj)/$f: CXXFLAGS+=$$(HOSTCXXFLAGS_$f)))
|
||||
|
||||
conf: $(conf-objs)
|
||||
$(obj)/conf: $(addprefix $(obj)/,$(conf-objs))
|
||||
|
||||
# The *conf-cfg file is used (then filtered out) as the first prerequisite to
|
||||
# avoid sourcing it before the script is built, when trying to compute CFLAGS
|
||||
# for the actual first prerequisite. This avoids errors like:
|
||||
# '/bin/sh: ./mconf-cfg: No such file or directory'
|
||||
mconf: mconf-cfg $(mconf-objs)
|
||||
$(obj)/mconf: mconf-cfg $(addprefix $(obj)/,$(mconf-objs))
|
||||
$(CC) -o $@ $(filter-out mconf-cfg,$^) $(HOSTLDLIBS_mconf)
|
||||
|
||||
nconf: nconf-cfg $(nconf-objs)
|
||||
$(obj)/nconf: nconf-cfg $(addprefix $(obj)/,$(nconf-objs))
|
||||
$(CC) -o $@ $(filter-out nconf-cfg,$^) $(HOSTLDLIBS_nconf)
|
||||
|
||||
qconf: qconf-cfg $(qconf-cxxobjs) $(qconf-objs)
|
||||
$(obj)/qconf: qconf-cfg $(addprefix $(obj)/,$(qconf-cxxobjs) $(qconf-objs))
|
||||
$(CXX) -o $@ $(filter-out qconf-cfg,$^) $(HOSTLDLIBS_qconf)
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
These files were taken from the Linux Kernel Configuration System at commit
|
||||
089b7d890f972f6b649fedc9259f6b93a18fb970 (Feb 4, 2020) and modified for the
|
||||
OpenWrt Buildroot:
|
||||
- Removed gconf, tests and kernel configuration targets.
|
||||
These files were taken from the Linux 5.14 Kernel Configuration System and
|
||||
modified for the OpenWrt Buildroot:
|
||||
- Removed nconf, gconf, tests and kernel configuration targets.
|
||||
- Adjusted the Makefile to compile outside the kernel.
|
||||
- Always use default file when running make all{no,mod,yes}config.
|
||||
- Added a 'reset' command to reset config when the target changes.
|
||||
@ -24,4 +23,4 @@ OpenWrt Buildroot:
|
||||
BUILD_SHIPPED_FILES defined
|
||||
|
||||
For a full list of changes, see the repository at:
|
||||
https://github.com/cotequeiroz/linux/commits/openwrt/scripts/kconfig
|
||||
https://github.com/cotequeiroz/linux/commits/openwrt-5.14/scripts/kconfig
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <errno.h>
|
||||
|
||||
@ -39,7 +38,7 @@ enum input_mode {
|
||||
fatalrecursive,
|
||||
};
|
||||
static enum input_mode input_mode = oldaskconfig;
|
||||
|
||||
static int input_mode_opt;
|
||||
static int indent = 1;
|
||||
static int tty_stdio;
|
||||
static int sync_kconfig;
|
||||
@ -84,10 +83,243 @@ static void xfgets(char *str, int size, FILE *in)
|
||||
printf("%s", str);
|
||||
}
|
||||
|
||||
static void set_randconfig_seed(void)
|
||||
{
|
||||
unsigned int seed;
|
||||
char *env;
|
||||
bool seed_set = false;
|
||||
|
||||
env = getenv("KCONFIG_SEED");
|
||||
if (env && *env) {
|
||||
char *endp;
|
||||
|
||||
seed = strtol(env, &endp, 0);
|
||||
if (*endp == '\0')
|
||||
seed_set = true;
|
||||
}
|
||||
|
||||
if (!seed_set) {
|
||||
struct timeval now;
|
||||
|
||||
/*
|
||||
* Use microseconds derived seed, compensate for systems where it may
|
||||
* be zero.
|
||||
*/
|
||||
gettimeofday(&now, NULL);
|
||||
seed = (now.tv_sec + 1) * (now.tv_usec + 1);
|
||||
}
|
||||
|
||||
printf("KCONFIG_SEED=0x%X\n", seed);
|
||||
srand(seed);
|
||||
}
|
||||
|
||||
static bool randomize_choice_values(struct symbol *csym)
|
||||
{
|
||||
struct property *prop;
|
||||
struct symbol *sym;
|
||||
struct expr *e;
|
||||
int cnt, def;
|
||||
|
||||
/*
|
||||
* If choice is mod then we may have more items selected
|
||||
* and if no then no-one.
|
||||
* In both cases stop.
|
||||
*/
|
||||
if (csym->curr.tri != yes)
|
||||
return false;
|
||||
|
||||
prop = sym_get_choice_prop(csym);
|
||||
|
||||
/* count entries in choice block */
|
||||
cnt = 0;
|
||||
expr_list_for_each_sym(prop->expr, e, sym)
|
||||
cnt++;
|
||||
|
||||
/*
|
||||
* find a random value and set it to yes,
|
||||
* set the rest to no so we have only one set
|
||||
*/
|
||||
def = rand() % cnt;
|
||||
|
||||
cnt = 0;
|
||||
expr_list_for_each_sym(prop->expr, e, sym) {
|
||||
if (def == cnt++) {
|
||||
sym->def[S_DEF_USER].tri = yes;
|
||||
csym->def[S_DEF_USER].val = sym;
|
||||
} else {
|
||||
sym->def[S_DEF_USER].tri = no;
|
||||
}
|
||||
sym->flags |= SYMBOL_DEF_USER;
|
||||
/* clear VALID to get value calculated */
|
||||
sym->flags &= ~SYMBOL_VALID;
|
||||
}
|
||||
csym->flags |= SYMBOL_DEF_USER;
|
||||
/* clear VALID to get value calculated */
|
||||
csym->flags &= ~SYMBOL_VALID;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
enum conf_def_mode {
|
||||
def_default,
|
||||
def_yes,
|
||||
def_mod,
|
||||
def_y2m,
|
||||
def_m2y,
|
||||
def_no,
|
||||
def_random
|
||||
};
|
||||
|
||||
static bool conf_set_all_new_symbols(enum conf_def_mode mode)
|
||||
{
|
||||
struct symbol *sym, *csym;
|
||||
int i, cnt;
|
||||
/*
|
||||
* can't go as the default in switch-case below, otherwise gcc whines
|
||||
* about -Wmaybe-uninitialized
|
||||
*/
|
||||
int pby = 50; /* probability of bool = y */
|
||||
int pty = 33; /* probability of tristate = y */
|
||||
int ptm = 33; /* probability of tristate = m */
|
||||
bool has_changed = false;
|
||||
|
||||
if (mode == def_random) {
|
||||
int n, p[3];
|
||||
char *env = getenv("KCONFIG_PROBABILITY");
|
||||
|
||||
n = 0;
|
||||
while (env && *env) {
|
||||
char *endp;
|
||||
int tmp = strtol(env, &endp, 10);
|
||||
|
||||
if (tmp >= 0 && tmp <= 100) {
|
||||
p[n++] = tmp;
|
||||
} else {
|
||||
errno = ERANGE;
|
||||
perror("KCONFIG_PROBABILITY");
|
||||
exit(1);
|
||||
}
|
||||
env = (*endp == ':') ? endp + 1 : endp;
|
||||
if (n >= 3)
|
||||
break;
|
||||
}
|
||||
switch (n) {
|
||||
case 1:
|
||||
pby = p[0];
|
||||
ptm = pby / 2;
|
||||
pty = pby - ptm;
|
||||
break;
|
||||
case 2:
|
||||
pty = p[0];
|
||||
ptm = p[1];
|
||||
pby = pty + ptm;
|
||||
break;
|
||||
case 3:
|
||||
pby = p[0];
|
||||
pty = p[1];
|
||||
ptm = p[2];
|
||||
break;
|
||||
}
|
||||
|
||||
if (pty + ptm > 100) {
|
||||
errno = ERANGE;
|
||||
perror("KCONFIG_PROBABILITY");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
sym_clear_all_valid();
|
||||
|
||||
for_all_symbols(i, sym) {
|
||||
if (sym_has_value(sym) || sym->flags & SYMBOL_VALID)
|
||||
continue;
|
||||
switch (sym_get_type(sym)) {
|
||||
case S_BOOLEAN:
|
||||
case S_TRISTATE:
|
||||
has_changed = true;
|
||||
switch (mode) {
|
||||
case def_yes:
|
||||
sym->def[S_DEF_USER].tri = yes;
|
||||
break;
|
||||
case def_mod:
|
||||
sym->def[S_DEF_USER].tri = mod;
|
||||
break;
|
||||
case def_no:
|
||||
sym->def[S_DEF_USER].tri = no;
|
||||
break;
|
||||
case def_random:
|
||||
sym->def[S_DEF_USER].tri = no;
|
||||
cnt = rand() % 100;
|
||||
if (sym->type == S_TRISTATE) {
|
||||
if (cnt < pty)
|
||||
sym->def[S_DEF_USER].tri = yes;
|
||||
else if (cnt < pty + ptm)
|
||||
sym->def[S_DEF_USER].tri = mod;
|
||||
} else if (cnt < pby)
|
||||
sym->def[S_DEF_USER].tri = yes;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if (!(sym_is_choice(sym) && mode == def_random))
|
||||
sym->flags |= SYMBOL_DEF_USER;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* We have different type of choice blocks.
|
||||
* If curr.tri equals to mod then we can select several
|
||||
* choice symbols in one block.
|
||||
* In this case we do nothing.
|
||||
* If curr.tri equals yes then only one symbol can be
|
||||
* selected in a choice block and we set it to yes,
|
||||
* and the rest to no.
|
||||
*/
|
||||
if (mode != def_random) {
|
||||
for_all_symbols(i, csym) {
|
||||
if ((sym_is_choice(csym) && !sym_has_value(csym)) ||
|
||||
sym_is_choice_value(csym))
|
||||
csym->flags |= SYMBOL_NEED_SET_CHOICE_VALUES;
|
||||
}
|
||||
}
|
||||
|
||||
for_all_symbols(i, csym) {
|
||||
if (sym_has_value(csym) || !sym_is_choice(csym))
|
||||
continue;
|
||||
|
||||
sym_calc_value(csym);
|
||||
if (mode == def_random)
|
||||
has_changed |= randomize_choice_values(csym);
|
||||
else {
|
||||
set_all_choice_values(csym);
|
||||
has_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
return has_changed;
|
||||
}
|
||||
|
||||
static void conf_rewrite_mod_or_yes(enum conf_def_mode mode)
|
||||
{
|
||||
struct symbol *sym;
|
||||
int i;
|
||||
tristate old_val = (mode == def_y2m) ? yes : mod;
|
||||
tristate new_val = (mode == def_y2m) ? mod : yes;
|
||||
|
||||
for_all_symbols(i, sym) {
|
||||
if (sym_get_type(sym) == S_TRISTATE &&
|
||||
sym->def[S_DEF_USER].tri == old_val)
|
||||
sym->def[S_DEF_USER].tri = new_val;
|
||||
}
|
||||
sym_clear_all_valid();
|
||||
}
|
||||
|
||||
static int conf_askvalue(struct symbol *sym, const char *def)
|
||||
{
|
||||
enum symbol_type type = sym_get_type(sym);
|
||||
|
||||
if (!sym_has_value(sym))
|
||||
printf("(NEW) ");
|
||||
|
||||
@ -109,24 +341,12 @@ static int conf_askvalue(struct symbol *sym, const char *def)
|
||||
return 0;
|
||||
}
|
||||
/* fall through */
|
||||
case oldaskconfig:
|
||||
default:
|
||||
fflush(stdout);
|
||||
xfgets(line, sizeof(line), stdin);
|
||||
return 1;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case S_INT:
|
||||
case S_HEX:
|
||||
case S_STRING:
|
||||
printf("%s\n", def);
|
||||
return 1;
|
||||
default:
|
||||
;
|
||||
}
|
||||
printf("%s", line);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -139,7 +359,7 @@ static int conf_string(struct menu *menu)
|
||||
printf("%*s%s ", indent - 1, "", menu->prompt->text);
|
||||
printf("(%s) ", sym->name);
|
||||
def = sym_get_string_value(sym);
|
||||
if (sym_get_string_value(sym))
|
||||
if (def)
|
||||
printf("[%s] ", def);
|
||||
if (!conf_askvalue(sym, def))
|
||||
return 0;
|
||||
@ -421,34 +641,37 @@ static void check_conf(struct menu *menu)
|
||||
return;
|
||||
|
||||
sym = menu->sym;
|
||||
if (sym && !sym_has_value(sym)) {
|
||||
if (sym_is_changeable(sym) ||
|
||||
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
|
||||
if (input_mode == listnewconfig) {
|
||||
if (sym->name) {
|
||||
const char *str;
|
||||
if (sym && !sym_has_value(sym) &&
|
||||
(sym_is_changeable(sym) ||
|
||||
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes))) {
|
||||
|
||||
if (sym->type == S_STRING) {
|
||||
str = sym_get_string_value(sym);
|
||||
str = sym_escape_string_value(str);
|
||||
printf("%s%s=%s\n", CONFIG_, sym->name, str);
|
||||
free((void *)str);
|
||||
} else {
|
||||
str = sym_get_string_value(sym);
|
||||
printf("%s%s=%s\n", CONFIG_, sym->name, str);
|
||||
}
|
||||
switch (input_mode) {
|
||||
case listnewconfig:
|
||||
if (sym->name) {
|
||||
const char *str;
|
||||
|
||||
if (sym->type == S_STRING) {
|
||||
str = sym_get_string_value(sym);
|
||||
str = sym_escape_string_value(str);
|
||||
printf("%s%s=%s\n", CONFIG_, sym->name, str);
|
||||
free((void *)str);
|
||||
} else {
|
||||
str = sym_get_string_value(sym);
|
||||
printf("%s%s=%s\n", CONFIG_, sym->name, str);
|
||||
}
|
||||
} else if (input_mode == helpnewconfig) {
|
||||
printf("-----\n");
|
||||
print_help(menu);
|
||||
printf("-----\n");
|
||||
|
||||
} else {
|
||||
if (!conf_cnt++)
|
||||
printf("*\n* Restart config...\n*\n");
|
||||
rootEntry = menu_get_parent_menu(menu);
|
||||
conf(rootEntry);
|
||||
}
|
||||
break;
|
||||
case helpnewconfig:
|
||||
printf("-----\n");
|
||||
print_help(menu);
|
||||
printf("-----\n");
|
||||
break;
|
||||
default:
|
||||
if (!conf_cnt++)
|
||||
printf("*\n* Restart config...\n*\n");
|
||||
rootEntry = menu_get_parent_menu(menu);
|
||||
conf(rootEntry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -456,31 +679,38 @@ static void check_conf(struct menu *menu)
|
||||
check_conf(child);
|
||||
}
|
||||
|
||||
static struct option long_opts[] = {
|
||||
{"oldaskconfig", no_argument, NULL, oldaskconfig},
|
||||
{"oldconfig", no_argument, NULL, oldconfig},
|
||||
{"syncconfig", no_argument, NULL, syncconfig},
|
||||
{"defconfig", required_argument, NULL, defconfig},
|
||||
{"savedefconfig", required_argument, NULL, savedefconfig},
|
||||
{"allnoconfig", no_argument, NULL, allnoconfig},
|
||||
{"allyesconfig", no_argument, NULL, allyesconfig},
|
||||
{"allmodconfig", no_argument, NULL, allmodconfig},
|
||||
{"alldefconfig", no_argument, NULL, alldefconfig},
|
||||
{"randconfig", no_argument, NULL, randconfig},
|
||||
{"listnewconfig", no_argument, NULL, listnewconfig},
|
||||
{"helpnewconfig", no_argument, NULL, helpnewconfig},
|
||||
{"olddefconfig", no_argument, NULL, olddefconfig},
|
||||
{"yes2modconfig", no_argument, NULL, yes2modconfig},
|
||||
{"mod2yesconfig", no_argument, NULL, mod2yesconfig},
|
||||
{"fatalrecursive", no_argument, NULL, fatalrecursive},
|
||||
static const struct option long_opts[] = {
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{"silent", no_argument, NULL, 's'},
|
||||
{"oldaskconfig", no_argument, &input_mode_opt, oldaskconfig},
|
||||
{"oldconfig", no_argument, &input_mode_opt, oldconfig},
|
||||
{"syncconfig", no_argument, &input_mode_opt, syncconfig},
|
||||
{"defconfig", required_argument, &input_mode_opt, defconfig},
|
||||
{"savedefconfig", required_argument, &input_mode_opt, savedefconfig},
|
||||
{"allnoconfig", no_argument, &input_mode_opt, allnoconfig},
|
||||
{"allyesconfig", no_argument, &input_mode_opt, allyesconfig},
|
||||
{"allmodconfig", no_argument, &input_mode_opt, allmodconfig},
|
||||
{"alldefconfig", no_argument, &input_mode_opt, alldefconfig},
|
||||
{"randconfig", no_argument, &input_mode_opt, randconfig},
|
||||
{"listnewconfig", no_argument, &input_mode_opt, listnewconfig},
|
||||
{"helpnewconfig", no_argument, &input_mode_opt, helpnewconfig},
|
||||
{"olddefconfig", no_argument, &input_mode_opt, olddefconfig},
|
||||
{"yes2modconfig", no_argument, &input_mode_opt, yes2modconfig},
|
||||
{"mod2yesconfig", no_argument, &input_mode_opt, mod2yesconfig},
|
||||
{"fatalrecursive",no_argument, NULL, fatalrecursive},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
static void conf_usage(const char *progname)
|
||||
{
|
||||
|
||||
printf("Usage: %s [-s] [--fatalrecursive] [option] <kconfig-file>\n", progname);
|
||||
printf("[option] is _one_ of the following:\n");
|
||||
printf("Usage: %s [options] <kconfig-file>\n", progname);
|
||||
printf("\n");
|
||||
printf("Generic options:\n");
|
||||
printf(" -h, --help Print this message and exit.\n");
|
||||
printf(" -s, --silent Do not print log.\n");
|
||||
printf(" --fatalrecursive Treat recursive depenendencies as a fatal error\n");
|
||||
printf("\n");
|
||||
printf("Mode options:\n");
|
||||
printf(" --listnewconfig List new options\n");
|
||||
printf(" --helpnewconfig List new options and help text\n");
|
||||
printf(" --oldaskconfig Start a new configuration using a line-oriented program\n");
|
||||
@ -497,6 +727,7 @@ static void conf_usage(const char *progname)
|
||||
printf(" --randconfig New config with random answer to all options\n");
|
||||
printf(" --yes2modconfig Change answers from yes to mod if possible\n");
|
||||
printf(" --mod2yesconfig Change answers from mod to yes if possible\n");
|
||||
printf(" (If none of the above is given, --oldaskconfig is the default)\n");
|
||||
}
|
||||
|
||||
int main(int ac, char **av)
|
||||
@ -509,84 +740,56 @@ int main(int ac, char **av)
|
||||
|
||||
tty_stdio = isatty(0) && isatty(1);
|
||||
|
||||
while ((opt = getopt_long(ac, av, "r:w:s", long_opts, NULL)) != -1) {
|
||||
if (opt == 's') {
|
||||
conf_set_message_callback(NULL);
|
||||
continue;
|
||||
}
|
||||
while ((opt = getopt_long(ac, av, "hr:sw:", long_opts, NULL)) != -1) {
|
||||
switch (opt) {
|
||||
case syncconfig:
|
||||
/*
|
||||
* syncconfig is invoked during the build stage.
|
||||
* Suppress distracting "configuration written to ..."
|
||||
*/
|
||||
case 'h':
|
||||
conf_usage(progname);
|
||||
exit(1);
|
||||
break;
|
||||
case 's':
|
||||
conf_set_message_callback(NULL);
|
||||
sync_kconfig = 1;
|
||||
break;
|
||||
case defconfig:
|
||||
case savedefconfig:
|
||||
defconfig_file = optarg;
|
||||
break;
|
||||
case randconfig:
|
||||
{
|
||||
struct timeval now;
|
||||
unsigned int seed;
|
||||
char *seed_env;
|
||||
|
||||
/*
|
||||
* Use microseconds derived seed,
|
||||
* compensate for systems where it may be zero
|
||||
*/
|
||||
gettimeofday(&now, NULL);
|
||||
seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1));
|
||||
|
||||
seed_env = getenv("KCONFIG_SEED");
|
||||
if( seed_env && *seed_env ) {
|
||||
char *endp;
|
||||
int tmp = (int)strtol(seed_env, &endp, 0);
|
||||
if (*endp == '\0') {
|
||||
seed = tmp;
|
||||
}
|
||||
}
|
||||
fprintf( stderr, "KCONFIG_SEED=0x%X\n", seed );
|
||||
srand(seed);
|
||||
break;
|
||||
}
|
||||
case oldaskconfig:
|
||||
case oldconfig:
|
||||
case allnoconfig:
|
||||
case allyesconfig:
|
||||
case allmodconfig:
|
||||
case alldefconfig:
|
||||
case listnewconfig:
|
||||
case helpnewconfig:
|
||||
case olddefconfig:
|
||||
case yes2modconfig:
|
||||
case mod2yesconfig:
|
||||
break;
|
||||
case fatalrecursive:
|
||||
recursive_is_error = 1;
|
||||
continue;
|
||||
case 'r':
|
||||
input_file = optarg;
|
||||
continue;
|
||||
break;
|
||||
case 'w':
|
||||
output_file = optarg;
|
||||
continue;
|
||||
case '?':
|
||||
conf_usage(progname);
|
||||
exit(1);
|
||||
break;
|
||||
case 0:
|
||||
input_mode = input_mode_opt;
|
||||
switch (input_mode) {
|
||||
case syncconfig:
|
||||
/*
|
||||
* syncconfig is invoked during the build stage.
|
||||
* Suppress distracting
|
||||
* "configuration written to ..."
|
||||
*/
|
||||
conf_set_message_callback(NULL);
|
||||
sync_kconfig = 1;
|
||||
break;
|
||||
case defconfig:
|
||||
case savedefconfig:
|
||||
defconfig_file = optarg;
|
||||
break;
|
||||
case randconfig:
|
||||
set_randconfig_seed();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
input_mode = (enum input_mode)opt;
|
||||
}
|
||||
if (ac == optind) {
|
||||
fprintf(stderr, "%s: Kconfig file missing\n", av[0]);
|
||||
conf_usage(progname);
|
||||
exit(1);
|
||||
}
|
||||
name = av[optind];
|
||||
conf_parse(name);
|
||||
conf_parse(av[optind]);
|
||||
//zconfdump(stdout);
|
||||
|
||||
switch (input_mode) {
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@ -32,7 +33,7 @@ static bool is_dir(const char *path)
|
||||
struct stat st;
|
||||
|
||||
if (stat(path, &st))
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
return S_ISDIR(st.st_mode);
|
||||
}
|
||||
@ -129,19 +130,14 @@ static size_t depfile_prefix_len;
|
||||
static int conf_touch_dep(const char *name)
|
||||
{
|
||||
int fd, ret;
|
||||
const char *s;
|
||||
char *d, c;
|
||||
char *d;
|
||||
|
||||
/* check overflow: prefix + name + ".h" + '\0' must fit in buffer. */
|
||||
if (depfile_prefix_len + strlen(name) + 3 > sizeof(depfile_path))
|
||||
/* check overflow: prefix + name + '\0' must fit in buffer. */
|
||||
if (depfile_prefix_len + strlen(name) + 1 > sizeof(depfile_path))
|
||||
return -1;
|
||||
|
||||
d = depfile_path + depfile_prefix_len;
|
||||
s = name;
|
||||
|
||||
while ((c = *s++))
|
||||
*d++ = (c == '_') ? '/' : tolower(c);
|
||||
strcpy(d, ".h");
|
||||
strcpy(d, name);
|
||||
|
||||
/* Assume directory path already exists. */
|
||||
fd = open(depfile_path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||||
@ -384,28 +380,46 @@ int conf_read_simple(const char *name, int def)
|
||||
if (name) {
|
||||
in = zconf_fopen(name);
|
||||
} else {
|
||||
struct property *prop;
|
||||
char *env;
|
||||
|
||||
name = conf_get_configname();
|
||||
in = zconf_fopen(name);
|
||||
if (in)
|
||||
goto load;
|
||||
sym_add_change_count(1);
|
||||
if (!sym_defconfig_list)
|
||||
conf_set_changed(true);
|
||||
|
||||
env = getenv("KCONFIG_DEFCONFIG_LIST");
|
||||
if (!env)
|
||||
return 1;
|
||||
|
||||
for_all_defaults(sym_defconfig_list, prop) {
|
||||
if (expr_calc_value(prop->visible.expr) == no ||
|
||||
prop->expr->type != E_SYMBOL)
|
||||
continue;
|
||||
sym_calc_value(prop->expr->left.sym);
|
||||
name = sym_get_string_value(prop->expr->left.sym);
|
||||
in = zconf_fopen(name);
|
||||
while (1) {
|
||||
bool is_last;
|
||||
|
||||
while (isspace(*env))
|
||||
env++;
|
||||
|
||||
if (!*env)
|
||||
break;
|
||||
|
||||
p = env;
|
||||
while (*p && !isspace(*p))
|
||||
p++;
|
||||
|
||||
is_last = (*p == '\0');
|
||||
|
||||
*p = '\0';
|
||||
|
||||
in = zconf_fopen(env);
|
||||
if (in) {
|
||||
conf_message("using defaults found in %s",
|
||||
name);
|
||||
env);
|
||||
goto load;
|
||||
}
|
||||
|
||||
if (is_last)
|
||||
break;
|
||||
|
||||
env = p + 1;
|
||||
}
|
||||
}
|
||||
if (!in)
|
||||
@ -434,7 +448,7 @@ load:
|
||||
if (def == S_DEF_USER) {
|
||||
sym = sym_find(line + 2 + strlen(CONFIG_));
|
||||
if (!sym) {
|
||||
sym_add_change_count(1);
|
||||
conf_set_changed(true);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
@ -470,11 +484,11 @@ load:
|
||||
* Reading from include/config/auto.conf
|
||||
* If CONFIG_FOO previously existed in
|
||||
* auto.conf but it is missing now,
|
||||
* include/config/foo.h must be touched.
|
||||
* include/config/FOO must be touched.
|
||||
*/
|
||||
conf_touch_dep(line + strlen(CONFIG_));
|
||||
else
|
||||
sym_add_change_count(1);
|
||||
conf_set_changed(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -519,7 +533,7 @@ int conf_read(const char *name)
|
||||
int conf_unsaved = 0;
|
||||
int i;
|
||||
|
||||
sym_set_change_count(0);
|
||||
conf_set_changed(false);
|
||||
|
||||
if (conf_read_simple(name, S_DEF_USER)) {
|
||||
sym_calc_value(modules_sym);
|
||||
@ -577,7 +591,8 @@ int conf_read(const char *name)
|
||||
}
|
||||
}
|
||||
|
||||
sym_add_change_count(conf_warnings || conf_unsaved);
|
||||
if (conf_warnings || conf_unsaved)
|
||||
conf_set_changed(true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -922,7 +937,7 @@ next:
|
||||
if (is_same(name, tmpname)) {
|
||||
conf_message("No change to %s", name);
|
||||
unlink(tmpname);
|
||||
sym_set_change_count(0);
|
||||
conf_set_changed(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -934,7 +949,7 @@ next:
|
||||
|
||||
conf_message("configuration written to %s", name);
|
||||
|
||||
sym_set_change_count(0);
|
||||
conf_set_changed(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1105,26 +1120,20 @@ int conf_write_autoconf(int overwrite)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sym_change_count;
|
||||
static bool conf_changed;
|
||||
static void (*conf_changed_callback)(void);
|
||||
|
||||
void sym_set_change_count(int count)
|
||||
void conf_set_changed(bool val)
|
||||
{
|
||||
int _sym_change_count = sym_change_count;
|
||||
sym_change_count = count;
|
||||
if (conf_changed_callback &&
|
||||
(bool)_sym_change_count != (bool)count)
|
||||
if (conf_changed_callback && conf_changed != val)
|
||||
conf_changed_callback();
|
||||
}
|
||||
|
||||
void sym_add_change_count(int count)
|
||||
{
|
||||
sym_set_change_count(count + sym_change_count);
|
||||
conf_changed = val;
|
||||
}
|
||||
|
||||
bool conf_get_changed(void)
|
||||
{
|
||||
return sym_change_count;
|
||||
return conf_changed;
|
||||
}
|
||||
|
||||
void conf_set_changed_callback(void (*fn)(void))
|
||||
@ -1132,54 +1141,6 @@ void conf_set_changed_callback(void (*fn)(void))
|
||||
conf_changed_callback = fn;
|
||||
}
|
||||
|
||||
static bool randomize_choice_values(struct symbol *csym)
|
||||
{
|
||||
struct property *prop;
|
||||
struct symbol *sym;
|
||||
struct expr *e;
|
||||
int cnt, def;
|
||||
|
||||
/*
|
||||
* If choice is mod then we may have more items selected
|
||||
* and if no then no-one.
|
||||
* In both cases stop.
|
||||
*/
|
||||
if (csym->curr.tri != yes)
|
||||
return false;
|
||||
|
||||
prop = sym_get_choice_prop(csym);
|
||||
|
||||
/* count entries in choice block */
|
||||
cnt = 0;
|
||||
expr_list_for_each_sym(prop->expr, e, sym)
|
||||
cnt++;
|
||||
|
||||
/*
|
||||
* find a random value and set it to yes,
|
||||
* set the rest to no so we have only one set
|
||||
*/
|
||||
def = (rand() % cnt);
|
||||
|
||||
cnt = 0;
|
||||
expr_list_for_each_sym(prop->expr, e, sym) {
|
||||
if (def == cnt++) {
|
||||
sym->def[S_DEF_USER].tri = yes;
|
||||
csym->def[S_DEF_USER].val = sym;
|
||||
}
|
||||
else {
|
||||
sym->def[S_DEF_USER].tri = no;
|
||||
}
|
||||
sym->flags |= SYMBOL_DEF_USER;
|
||||
/* clear VALID to get value calculated */
|
||||
sym->flags &= ~SYMBOL_VALID;
|
||||
}
|
||||
csym->flags |= SYMBOL_DEF_USER;
|
||||
/* clear VALID to get value calculated */
|
||||
csym->flags &= ~(SYMBOL_VALID);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void set_all_choice_values(struct symbol *csym)
|
||||
{
|
||||
struct property *prop;
|
||||
@ -1199,147 +1160,3 @@ void set_all_choice_values(struct symbol *csym)
|
||||
/* clear VALID to get value calculated */
|
||||
csym->flags &= ~(SYMBOL_VALID | SYMBOL_NEED_SET_CHOICE_VALUES);
|
||||
}
|
||||
|
||||
bool conf_set_all_new_symbols(enum conf_def_mode mode)
|
||||
{
|
||||
struct symbol *sym, *csym;
|
||||
int i, cnt, pby, pty, ptm; /* pby: probability of bool = y
|
||||
* pty: probability of tristate = y
|
||||
* ptm: probability of tristate = m
|
||||
*/
|
||||
|
||||
pby = 50; pty = ptm = 33; /* can't go as the default in switch-case
|
||||
* below, otherwise gcc whines about
|
||||
* -Wmaybe-uninitialized */
|
||||
if (mode == def_random) {
|
||||
int n, p[3];
|
||||
char *env = getenv("KCONFIG_PROBABILITY");
|
||||
n = 0;
|
||||
while( env && *env ) {
|
||||
char *endp;
|
||||
int tmp = strtol( env, &endp, 10 );
|
||||
if( tmp >= 0 && tmp <= 100 ) {
|
||||
p[n++] = tmp;
|
||||
} else {
|
||||
errno = ERANGE;
|
||||
perror( "KCONFIG_PROBABILITY" );
|
||||
exit( 1 );
|
||||
}
|
||||
env = (*endp == ':') ? endp+1 : endp;
|
||||
if( n >=3 ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch( n ) {
|
||||
case 1:
|
||||
pby = p[0]; ptm = pby/2; pty = pby-ptm;
|
||||
break;
|
||||
case 2:
|
||||
pty = p[0]; ptm = p[1]; pby = pty + ptm;
|
||||
break;
|
||||
case 3:
|
||||
pby = p[0]; pty = p[1]; ptm = p[2];
|
||||
break;
|
||||
}
|
||||
|
||||
if( pty+ptm > 100 ) {
|
||||
errno = ERANGE;
|
||||
perror( "KCONFIG_PROBABILITY" );
|
||||
exit( 1 );
|
||||
}
|
||||
}
|
||||
bool has_changed = false;
|
||||
|
||||
sym_clear_all_valid();
|
||||
|
||||
for_all_symbols(i, sym) {
|
||||
if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID))
|
||||
continue;
|
||||
switch (sym_get_type(sym)) {
|
||||
case S_BOOLEAN:
|
||||
case S_TRISTATE:
|
||||
has_changed = true;
|
||||
switch (mode) {
|
||||
case def_yes:
|
||||
sym->def[S_DEF_USER].tri = yes;
|
||||
break;
|
||||
case def_mod:
|
||||
sym->def[S_DEF_USER].tri = mod;
|
||||
break;
|
||||
case def_no:
|
||||
if (sym->flags & SYMBOL_ALLNOCONFIG_Y)
|
||||
sym->def[S_DEF_USER].tri = yes;
|
||||
else
|
||||
sym->def[S_DEF_USER].tri = no;
|
||||
break;
|
||||
case def_random:
|
||||
sym->def[S_DEF_USER].tri = no;
|
||||
cnt = rand() % 100;
|
||||
if (sym->type == S_TRISTATE) {
|
||||
if (cnt < pty)
|
||||
sym->def[S_DEF_USER].tri = yes;
|
||||
else if (cnt < (pty+ptm))
|
||||
sym->def[S_DEF_USER].tri = mod;
|
||||
} else if (cnt < pby)
|
||||
sym->def[S_DEF_USER].tri = yes;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if (!(sym_is_choice(sym) && mode == def_random))
|
||||
sym->flags |= SYMBOL_DEF_USER;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* We have different type of choice blocks.
|
||||
* If curr.tri equals to mod then we can select several
|
||||
* choice symbols in one block.
|
||||
* In this case we do nothing.
|
||||
* If curr.tri equals yes then only one symbol can be
|
||||
* selected in a choice block and we set it to yes,
|
||||
* and the rest to no.
|
||||
*/
|
||||
if (mode != def_random) {
|
||||
for_all_symbols(i, csym) {
|
||||
if ((sym_is_choice(csym) && !sym_has_value(csym)) ||
|
||||
sym_is_choice_value(csym))
|
||||
csym->flags |= SYMBOL_NEED_SET_CHOICE_VALUES;
|
||||
}
|
||||
}
|
||||
|
||||
for_all_symbols(i, csym) {
|
||||
if (sym_has_value(csym) || !sym_is_choice(csym))
|
||||
continue;
|
||||
|
||||
sym_calc_value(csym);
|
||||
if (mode == def_random)
|
||||
has_changed = randomize_choice_values(csym);
|
||||
else {
|
||||
set_all_choice_values(csym);
|
||||
has_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
return has_changed;
|
||||
}
|
||||
|
||||
void conf_rewrite_mod_or_yes(enum conf_def_mode mode)
|
||||
{
|
||||
struct symbol *sym;
|
||||
int i;
|
||||
tristate old_val = (mode == def_y2m) ? yes : mod;
|
||||
tristate new_val = (mode == def_y2m) ? mod : yes;
|
||||
|
||||
for_all_symbols(i, sym) {
|
||||
if (sym_get_type(sym) == S_TRISTATE &&
|
||||
sym->def[S_DEF_USER].tri == old_val) {
|
||||
sym->def[S_DEF_USER].tri = new_val;
|
||||
sym_add_change_count(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,9 +156,6 @@ struct symbol {
|
||||
/* choice values need to be set before calculating this symbol value */
|
||||
#define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000
|
||||
|
||||
/* Set symbol to y if allnoconfig; used for symbols that hide others */
|
||||
#define SYMBOL_ALLNOCONFIG_Y 0x200000
|
||||
|
||||
#define SYMBOL_MAXLENGTH 256
|
||||
#define SYMBOL_HASHSIZE 9973
|
||||
|
||||
@ -282,15 +279,12 @@ struct jump_key {
|
||||
int index;
|
||||
};
|
||||
|
||||
#define JUMP_NB 9
|
||||
|
||||
extern struct file *file_list;
|
||||
extern struct file *current_file;
|
||||
struct file *lookup_file(const char *name);
|
||||
|
||||
extern struct symbol symbol_yes, symbol_no, symbol_mod;
|
||||
extern struct symbol *modules_sym;
|
||||
extern struct symbol *sym_defconfig_list;
|
||||
extern int cdebug;
|
||||
struct expr *expr_alloc_symbol(struct symbol *sym);
|
||||
struct expr *expr_alloc_one(enum expr_type type, struct expr *ce);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const char *xpm_load[] = {
|
||||
const char * const xpm_load[] = {
|
||||
"22 22 5 1",
|
||||
". c None",
|
||||
"# c #000000",
|
||||
@ -35,7 +35,7 @@ const char *xpm_load[] = {
|
||||
"###############.......",
|
||||
"......................"};
|
||||
|
||||
const char *xpm_save[] = {
|
||||
const char * const xpm_save[] = {
|
||||
"22 22 5 1",
|
||||
". c None",
|
||||
"# c #000000",
|
||||
@ -65,7 +65,7 @@ const char *xpm_save[] = {
|
||||
"..##################..",
|
||||
"......................"};
|
||||
|
||||
const char *xpm_back[] = {
|
||||
const char * const xpm_back[] = {
|
||||
"22 22 3 1",
|
||||
". c None",
|
||||
"# c #000083",
|
||||
@ -93,7 +93,7 @@ const char *xpm_back[] = {
|
||||
"......................",
|
||||
"......................"};
|
||||
|
||||
const char *xpm_tree_view[] = {
|
||||
const char * const xpm_tree_view[] = {
|
||||
"22 22 2 1",
|
||||
". c None",
|
||||
"# c #000000",
|
||||
@ -120,7 +120,7 @@ const char *xpm_tree_view[] = {
|
||||
"......................",
|
||||
"......................"};
|
||||
|
||||
const char *xpm_single_view[] = {
|
||||
const char * const xpm_single_view[] = {
|
||||
"22 22 2 1",
|
||||
". c None",
|
||||
"# c #000000",
|
||||
@ -147,7 +147,7 @@ const char *xpm_single_view[] = {
|
||||
"......................",
|
||||
"......................"};
|
||||
|
||||
const char *xpm_split_view[] = {
|
||||
const char * const xpm_split_view[] = {
|
||||
"22 22 2 1",
|
||||
". c None",
|
||||
"# c #000000",
|
||||
@ -174,7 +174,7 @@ const char *xpm_split_view[] = {
|
||||
"......................",
|
||||
"......................"};
|
||||
|
||||
const char *xpm_symbol_no[] = {
|
||||
const char * const xpm_symbol_no[] = {
|
||||
"12 12 2 1",
|
||||
" c white",
|
||||
". c black",
|
||||
@ -191,7 +191,7 @@ const char *xpm_symbol_no[] = {
|
||||
" .......... ",
|
||||
" "};
|
||||
|
||||
const char *xpm_symbol_mod[] = {
|
||||
const char * const xpm_symbol_mod[] = {
|
||||
"12 12 2 1",
|
||||
" c white",
|
||||
". c black",
|
||||
@ -208,7 +208,7 @@ const char *xpm_symbol_mod[] = {
|
||||
" .......... ",
|
||||
" "};
|
||||
|
||||
const char *xpm_symbol_yes[] = {
|
||||
const char * const xpm_symbol_yes[] = {
|
||||
"12 12 2 1",
|
||||
" c white",
|
||||
". c black",
|
||||
@ -225,7 +225,7 @@ const char *xpm_symbol_yes[] = {
|
||||
" .......... ",
|
||||
" "};
|
||||
|
||||
const char *xpm_choice_no[] = {
|
||||
const char * const xpm_choice_no[] = {
|
||||
"12 12 2 1",
|
||||
" c white",
|
||||
". c black",
|
||||
@ -242,7 +242,7 @@ const char *xpm_choice_no[] = {
|
||||
" .... ",
|
||||
" "};
|
||||
|
||||
const char *xpm_choice_yes[] = {
|
||||
const char * const xpm_choice_yes[] = {
|
||||
"12 12 2 1",
|
||||
" c white",
|
||||
". c black",
|
||||
@ -259,7 +259,7 @@ const char *xpm_choice_yes[] = {
|
||||
" .... ",
|
||||
" "};
|
||||
|
||||
const char *xpm_menu[] = {
|
||||
const char * const xpm_menu[] = {
|
||||
"12 12 2 1",
|
||||
" c white",
|
||||
". c black",
|
||||
@ -276,7 +276,7 @@ const char *xpm_menu[] = {
|
||||
" .......... ",
|
||||
" "};
|
||||
|
||||
const char *xpm_menu_inv[] = {
|
||||
const char * const xpm_menu_inv[] = {
|
||||
"12 12 2 1",
|
||||
" c white",
|
||||
". c black",
|
||||
@ -293,7 +293,7 @@ const char *xpm_menu_inv[] = {
|
||||
" .......... ",
|
||||
" "};
|
||||
|
||||
const char *xpm_menuback[] = {
|
||||
const char * const xpm_menuback[] = {
|
||||
"12 12 2 1",
|
||||
" c white",
|
||||
". c black",
|
||||
@ -310,7 +310,7 @@ const char *xpm_menuback[] = {
|
||||
" .......... ",
|
||||
" "};
|
||||
|
||||
const char *xpm_void[] = {
|
||||
const char * const xpm_void[] = {
|
||||
"12 12 2 1",
|
||||
" c white",
|
||||
". c black",
|
||||
|
||||
@ -10,21 +10,21 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const char *xpm_load[];
|
||||
extern const char *xpm_save[];
|
||||
extern const char *xpm_back[];
|
||||
extern const char *xpm_tree_view[];
|
||||
extern const char *xpm_single_view[];
|
||||
extern const char *xpm_split_view[];
|
||||
extern const char *xpm_symbol_no[];
|
||||
extern const char *xpm_symbol_mod[];
|
||||
extern const char *xpm_symbol_yes[];
|
||||
extern const char *xpm_choice_no[];
|
||||
extern const char *xpm_choice_yes[];
|
||||
extern const char *xpm_menu[];
|
||||
extern const char *xpm_menu_inv[];
|
||||
extern const char *xpm_menuback[];
|
||||
extern const char *xpm_void[];
|
||||
extern const char * const xpm_load[];
|
||||
extern const char * const xpm_save[];
|
||||
extern const char * const xpm_back[];
|
||||
extern const char * const xpm_tree_view[];
|
||||
extern const char * const xpm_single_view[];
|
||||
extern const char * const xpm_split_view[];
|
||||
extern const char * const xpm_symbol_no[];
|
||||
extern const char * const xpm_symbol_mod[];
|
||||
extern const char * const xpm_symbol_yes[];
|
||||
extern const char * const xpm_choice_no[];
|
||||
extern const char * const xpm_choice_yes[];
|
||||
extern const char * const xpm_menu[];
|
||||
extern const char * const xpm_menu_inv[];
|
||||
extern const char * const xpm_menuback[];
|
||||
extern const char * const xpm_void[];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
9
scripts/config/internal.h
Normal file
9
scripts/config/internal.h
Normal file
@ -0,0 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef INTERNAL_H
|
||||
#define INTERNAL_H
|
||||
|
||||
struct menu;
|
||||
|
||||
extern struct menu *current_menu, *current_entry;
|
||||
|
||||
#endif /* INTERNAL_H */
|
||||
@ -12,7 +12,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <glob.h>
|
||||
#include <libgen.h>
|
||||
|
||||
@ -38,7 +37,7 @@ struct buffer {
|
||||
YY_BUFFER_STATE state;
|
||||
};
|
||||
|
||||
struct buffer *current_buf;
|
||||
static struct buffer *current_buf;
|
||||
|
||||
static int last_ts, first_ts;
|
||||
|
||||
@ -94,7 +93,6 @@ n [A-Za-z0-9_-]
|
||||
[ \t]* /* whitespaces */
|
||||
\\\n /* escaped new line */
|
||||
\n return T_EOL;
|
||||
"allnoconfig_y" return T_ALLNOCONFIG_Y;
|
||||
"bool" return T_BOOL;
|
||||
"choice" return T_CHOICE;
|
||||
"comment" return T_COMMENT;
|
||||
@ -102,12 +100,11 @@ n [A-Za-z0-9_-]
|
||||
"def_bool" return T_DEF_BOOL;
|
||||
"def_tristate" return T_DEF_TRISTATE;
|
||||
"default" return T_DEFAULT;
|
||||
"defconfig_list" return T_DEFCONFIG_LIST;
|
||||
"depends" return T_DEPENDS;
|
||||
"endchoice" return T_ENDCHOICE;
|
||||
"endif" return T_ENDIF;
|
||||
"endmenu" return T_ENDMENU;
|
||||
"help"|"---help---" return T_HELP;
|
||||
"help" return T_HELP;
|
||||
"hex" return T_HEX;
|
||||
"if" return T_IF;
|
||||
"imply" return T_IMPLY;
|
||||
@ -117,7 +114,6 @@ n [A-Za-z0-9_-]
|
||||
"menuconfig" return T_MENUCONFIG;
|
||||
"modules" return T_MODULES;
|
||||
"on" return T_ON;
|
||||
"option" return T_OPTION;
|
||||
"optional" return T_OPTIONAL;
|
||||
"prompt" return T_PROMPT;
|
||||
"range" return T_RANGE;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,10 @@
|
||||
#ifndef LKC_H
|
||||
#define LKC_H
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "expr.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -16,10 +20,6 @@ extern "C" {
|
||||
|
||||
#define SRCTREE "srctree"
|
||||
|
||||
#ifndef PACKAGE
|
||||
#define PACKAGE "linux"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_
|
||||
#define CONFIG_ "CONFIG_"
|
||||
#endif
|
||||
@ -30,16 +30,6 @@ static inline const char *CONFIG_prefix(void)
|
||||
#undef CONFIG_
|
||||
#define CONFIG_ CONFIG_prefix()
|
||||
|
||||
enum conf_def_mode {
|
||||
def_default,
|
||||
def_yes,
|
||||
def_mod,
|
||||
def_y2m,
|
||||
def_m2y,
|
||||
def_no,
|
||||
def_random
|
||||
};
|
||||
|
||||
extern int yylineno;
|
||||
void zconfdump(FILE *out);
|
||||
void zconf_starthelp(void);
|
||||
@ -52,10 +42,6 @@ extern int recursive_is_error;
|
||||
|
||||
/* confdata.c */
|
||||
const char *conf_get_configname(void);
|
||||
void sym_set_change_count(int count);
|
||||
void sym_add_change_count(int count);
|
||||
bool conf_set_all_new_symbols(enum conf_def_mode mode);
|
||||
void conf_rewrite_mod_or_yes(enum conf_def_mode mode);
|
||||
void set_all_choice_values(struct symbol *csym);
|
||||
|
||||
/* confdata.c and expr.c */
|
||||
@ -67,24 +53,6 @@ static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out)
|
||||
fprintf(stderr, "Error in writing or end of file.\n");
|
||||
}
|
||||
|
||||
/* menu.c */
|
||||
void _menu_init(void);
|
||||
void menu_warn(struct menu *menu, const char *fmt, ...);
|
||||
struct menu *menu_add_menu(void);
|
||||
void menu_end_menu(void);
|
||||
void menu_add_entry(struct symbol *sym);
|
||||
void menu_add_dep(struct expr *dep);
|
||||
void menu_add_visibility(struct expr *dep);
|
||||
struct property *menu_add_prop(enum prop_type type, struct expr *expr, struct expr *dep);
|
||||
struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
|
||||
void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
|
||||
void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
|
||||
void menu_add_option_modules(void);
|
||||
void menu_add_option_defconfig_list(void);
|
||||
void menu_add_option_allnoconfig_y(void);
|
||||
void menu_finalize(struct menu *parent);
|
||||
void menu_set_type(int type);
|
||||
|
||||
/* util.c */
|
||||
struct file *file_lookup(const char *name);
|
||||
void *xmalloc(size_t size);
|
||||
@ -111,6 +79,34 @@ void str_append(struct gstr *gs, const char *s);
|
||||
void str_printf(struct gstr *gs, const char *fmt, ...);
|
||||
const char *str_get(struct gstr *gs);
|
||||
|
||||
/* menu.c */
|
||||
void _menu_init(void);
|
||||
void menu_warn(struct menu *menu, const char *fmt, ...);
|
||||
struct menu *menu_add_menu(void);
|
||||
void menu_end_menu(void);
|
||||
void menu_add_entry(struct symbol *sym);
|
||||
void menu_add_dep(struct expr *dep);
|
||||
void menu_add_visibility(struct expr *dep);
|
||||
struct property *menu_add_prop(enum prop_type type, struct expr *expr, struct expr *dep);
|
||||
struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
|
||||
void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
|
||||
void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
|
||||
void menu_finalize(struct menu *parent);
|
||||
void menu_set_type(int type);
|
||||
|
||||
extern struct menu rootmenu;
|
||||
|
||||
bool menu_is_empty(struct menu *menu);
|
||||
bool menu_is_visible(struct menu *menu);
|
||||
bool menu_has_prompt(struct menu *menu);
|
||||
const char *menu_get_prompt(struct menu *menu);
|
||||
struct menu *menu_get_root_menu(struct menu *menu);
|
||||
struct menu *menu_get_parent_menu(struct menu *menu);
|
||||
bool menu_has_help(struct menu *menu);
|
||||
const char *menu_get_help(struct menu *menu);
|
||||
struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head);
|
||||
void menu_get_ext_help(struct menu *menu, struct gstr *help);
|
||||
|
||||
/* symbol.c */
|
||||
void sym_clear_all_valid(void);
|
||||
struct symbol *sym_choice_default(struct symbol *sym);
|
||||
|
||||
@ -9,24 +9,11 @@ void conf_reset(int def);
|
||||
int conf_write_defconfig(const char *name);
|
||||
int conf_write(const char *name);
|
||||
int conf_write_autoconf(int overwrite);
|
||||
void conf_set_changed(bool val);
|
||||
bool conf_get_changed(void);
|
||||
void conf_set_changed_callback(void (*fn)(void));
|
||||
void conf_set_message_callback(void (*fn)(const char *s));
|
||||
|
||||
/* menu.c */
|
||||
extern struct menu rootmenu;
|
||||
|
||||
bool menu_is_empty(struct menu *menu);
|
||||
bool menu_is_visible(struct menu *menu);
|
||||
bool menu_has_prompt(struct menu *menu);
|
||||
const char * menu_get_prompt(struct menu *menu);
|
||||
struct menu * menu_get_root_menu(struct menu *menu);
|
||||
struct menu * menu_get_parent_menu(struct menu *menu);
|
||||
bool menu_has_help(struct menu *menu);
|
||||
const char * menu_get_help(struct menu *menu);
|
||||
struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head);
|
||||
void menu_get_ext_help(struct menu *menu, struct gstr *help);
|
||||
|
||||
/* symbol.c */
|
||||
extern struct symbol * symbol_hash[SYMBOL_HASHSIZE];
|
||||
|
||||
|
||||
@ -363,7 +363,7 @@ void print_title(WINDOW *dialog, const char *title, int width)
|
||||
/*
|
||||
* Print a string of text in a window, automatically wrap around to the
|
||||
* next line if the string is too long to fit on one line. Newline
|
||||
* characters '\n' are propperly processed. We start on a new line
|
||||
* characters '\n' are properly processed. We start on a new line
|
||||
* if there is no room for at least 4 nonblanks following a double-space.
|
||||
*/
|
||||
void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
|
||||
@ -541,7 +541,7 @@ int first_alpha(const char *string, const char *exempt)
|
||||
* lxdialog suggest <ESC> <ESC> which is correctly translated to two
|
||||
* times esc. But then we need to ignore the second esc to avoid stepping
|
||||
* out one menu too much. Filter away all escaped key sequences since
|
||||
* keypad(FALSE) turn off ncurses support for escape sequences - and thats
|
||||
* keypad(FALSE) turn off ncurses support for escape sequences - and that's
|
||||
* needed to make notimeout() do as expected.
|
||||
*/
|
||||
int on_key_esc(WINDOW *win)
|
||||
|
||||
@ -33,7 +33,9 @@ if [ -f /usr/include/ncurses/ncurses.h ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -f /usr/include/ncurses.h ]; then
|
||||
# As a final fallback before giving up, check if $HOSTCC knows of a default
|
||||
# ncurses installation (e.g. from a vendor-specific sysroot).
|
||||
if echo '#include <ncurses.h>' | ${HOSTCC} -E - >/dev/null 2>&1; then
|
||||
echo cflags=\"-D_GNU_SOURCE\"
|
||||
echo libs=\"-lncurses\"
|
||||
exit 0
|
||||
|
||||
@ -22,6 +22,8 @@
|
||||
#include "lkc.h"
|
||||
#include "lxdialog/dialog.h"
|
||||
|
||||
#define JUMP_NB 9
|
||||
|
||||
static const char mconf_readme[] =
|
||||
"OpenWrt config is based on Kernel kconfig\n"
|
||||
"so ipkg packages are referred here as modules.\n"
|
||||
@ -300,17 +302,12 @@ static char filename[PATH_MAX+1];
|
||||
static void set_config_filename(const char *config_filename)
|
||||
{
|
||||
static char menu_backtitle[PATH_MAX+128];
|
||||
int size;
|
||||
|
||||
size = snprintf(menu_backtitle, sizeof(menu_backtitle),
|
||||
"%s - %s", config_filename, rootmenu.prompt->text);
|
||||
if (size >= sizeof(menu_backtitle))
|
||||
menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
|
||||
snprintf(menu_backtitle, sizeof(menu_backtitle), "%s - %s",
|
||||
config_filename, rootmenu.prompt->text);
|
||||
set_dialog_backtitle(menu_backtitle);
|
||||
|
||||
size = snprintf(filename, sizeof(filename), "%s", config_filename);
|
||||
if (size >= sizeof(filename))
|
||||
filename[sizeof(filename)-1] = '\0';
|
||||
snprintf(filename, sizeof(filename), "%s", config_filename);
|
||||
}
|
||||
|
||||
struct subtitle_part {
|
||||
@ -921,7 +918,7 @@ static void conf_load(void)
|
||||
return;
|
||||
if (!conf_read(dialog_input_result)) {
|
||||
set_config_filename(dialog_input_result);
|
||||
sym_set_change_count(1);
|
||||
conf_set_changed(true);
|
||||
return;
|
||||
}
|
||||
show_textbox(NULL, "File does not exist!", 5, 38);
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "lkc.h"
|
||||
#include "internal.h"
|
||||
|
||||
static const char nohelp_text[] = "There is no help available for this option.";
|
||||
|
||||
@ -65,7 +66,8 @@ void menu_add_entry(struct symbol *sym)
|
||||
struct menu *menu_add_menu(void)
|
||||
{
|
||||
last_entry_ptr = ¤t_entry->list;
|
||||
return current_menu = current_entry;
|
||||
current_menu = current_entry;
|
||||
return current_menu;
|
||||
}
|
||||
|
||||
void menu_end_menu(void)
|
||||
@ -210,28 +212,6 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
|
||||
menu_add_prop(type, expr_alloc_symbol(sym), dep);
|
||||
}
|
||||
|
||||
void menu_add_option_modules(void)
|
||||
{
|
||||
if (modules_sym)
|
||||
zconf_error("symbol '%s' redefines option 'modules' already defined by symbol '%s'",
|
||||
current_entry->sym->name, modules_sym->name);
|
||||
modules_sym = current_entry->sym;
|
||||
}
|
||||
|
||||
void menu_add_option_defconfig_list(void)
|
||||
{
|
||||
if (!sym_defconfig_list)
|
||||
sym_defconfig_list = current_entry->sym;
|
||||
else if (sym_defconfig_list != current_entry->sym)
|
||||
zconf_error("trying to redefine defconfig symbol");
|
||||
sym_defconfig_list->flags |= SYMBOL_NO_WRITE;
|
||||
}
|
||||
|
||||
void menu_add_option_allnoconfig_y(void)
|
||||
{
|
||||
current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y;
|
||||
}
|
||||
|
||||
static int menu_validate_number(struct symbol *sym, struct symbol *sym2)
|
||||
{
|
||||
return sym2->type == S_INT || sym2->type == S_HEX ||
|
||||
|
||||
@ -271,7 +271,7 @@ static int mwin_max_cols;
|
||||
static MENU *curses_menu;
|
||||
static ITEM *curses_menu_items[MAX_MENU_ITEMS];
|
||||
static struct mitem k_menu_items[MAX_MENU_ITEMS];
|
||||
static int items_num;
|
||||
static unsigned int items_num;
|
||||
static int global_exit;
|
||||
/* the currently selected button */
|
||||
static const char *current_instructions = menu_instructions;
|
||||
@ -373,18 +373,18 @@ static void print_function_line(void)
|
||||
int lines = getmaxy(stdscr);
|
||||
|
||||
for (i = 0; i < function_keys_num; i++) {
|
||||
(void) wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]);
|
||||
wattrset(main_window, attr_function_highlight);
|
||||
mvwprintw(main_window, lines-3, offset,
|
||||
"%s",
|
||||
function_keys[i].key_str);
|
||||
(void) wattrset(main_window, attributes[FUNCTION_TEXT]);
|
||||
wattrset(main_window, attr_function_text);
|
||||
offset += strlen(function_keys[i].key_str);
|
||||
mvwprintw(main_window, lines-3,
|
||||
offset, "%s",
|
||||
function_keys[i].func);
|
||||
offset += strlen(function_keys[i].func) + skip;
|
||||
}
|
||||
(void) wattrset(main_window, attributes[NORMAL]);
|
||||
wattrset(main_window, attr_normal);
|
||||
}
|
||||
|
||||
/* help */
|
||||
@ -499,16 +499,20 @@ typedef enum {MATCH_TINKER_PATTERN_UP, MATCH_TINKER_PATTERN_DOWN,
|
||||
/* return the index of the matched item, or -1 if no such item exists */
|
||||
static int get_mext_match(const char *match_str, match_f flag)
|
||||
{
|
||||
int match_start = item_index(current_item(curses_menu));
|
||||
int index;
|
||||
int match_start, index;
|
||||
|
||||
/* Do not search if the menu is empty (i.e. items_num == 0) */
|
||||
match_start = item_index(current_item(curses_menu));
|
||||
if (match_start == ERR)
|
||||
return -1;
|
||||
|
||||
if (flag == FIND_NEXT_MATCH_DOWN)
|
||||
++match_start;
|
||||
else if (flag == FIND_NEXT_MATCH_UP)
|
||||
--match_start;
|
||||
|
||||
match_start = (match_start + items_num) % items_num;
|
||||
index = match_start;
|
||||
index = (index + items_num) % items_num;
|
||||
while (true) {
|
||||
char *str = k_menu_items[index].str;
|
||||
if (strcasestr(str, match_str) != NULL)
|
||||
@ -630,19 +634,12 @@ static int item_is_tag(char tag)
|
||||
|
||||
static char filename[PATH_MAX+1];
|
||||
static char menu_backtitle[PATH_MAX+128];
|
||||
static const char *set_config_filename(const char *config_filename)
|
||||
static void set_config_filename(const char *config_filename)
|
||||
{
|
||||
int size;
|
||||
snprintf(menu_backtitle, sizeof(menu_backtitle), "%s - %s",
|
||||
config_filename, rootmenu.prompt->text);
|
||||
|
||||
size = snprintf(menu_backtitle, sizeof(menu_backtitle),
|
||||
"%s - %s", config_filename, rootmenu.prompt->text);
|
||||
if (size >= sizeof(menu_backtitle))
|
||||
menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
|
||||
|
||||
size = snprintf(filename, sizeof(filename), "%s", config_filename);
|
||||
if (size >= sizeof(filename))
|
||||
filename[sizeof(filename)-1] = '\0';
|
||||
return menu_backtitle;
|
||||
snprintf(filename, sizeof(filename), "%s", config_filename);
|
||||
}
|
||||
|
||||
/* return = 0 means we are successful.
|
||||
@ -758,7 +755,6 @@ static void build_conf(struct menu *menu)
|
||||
switch (ptype) {
|
||||
case P_MENU:
|
||||
child_count++;
|
||||
prompt = prompt;
|
||||
if (single_menu_mode) {
|
||||
item_make(menu, 'm',
|
||||
"%s%*c%s",
|
||||
@ -960,16 +956,15 @@ static void show_menu(const char *prompt, const char *instructions,
|
||||
current_instructions = instructions;
|
||||
|
||||
clear();
|
||||
(void) wattrset(main_window, attributes[NORMAL]);
|
||||
print_in_middle(stdscr, 1, 0, getmaxx(stdscr),
|
||||
print_in_middle(stdscr, 1, getmaxx(stdscr),
|
||||
menu_backtitle,
|
||||
attributes[MAIN_HEADING]);
|
||||
attr_main_heading);
|
||||
|
||||
(void) wattrset(main_window, attributes[MAIN_MENU_BOX]);
|
||||
wattrset(main_window, attr_main_menu_box);
|
||||
box(main_window, 0, 0);
|
||||
(void) wattrset(main_window, attributes[MAIN_MENU_HEADING]);
|
||||
wattrset(main_window, attr_main_menu_heading);
|
||||
mvwprintw(main_window, 0, 3, " %s ", prompt);
|
||||
(void) wattrset(main_window, attributes[NORMAL]);
|
||||
wattrset(main_window, attr_normal);
|
||||
|
||||
set_menu_items(curses_menu, curses_menu_items);
|
||||
|
||||
@ -1072,7 +1067,6 @@ static int do_match(int key, struct match_state *state, int *ans)
|
||||
static void conf(struct menu *menu)
|
||||
{
|
||||
struct menu *submenu = NULL;
|
||||
const char *prompt = menu_get_prompt(menu);
|
||||
struct symbol *sym;
|
||||
int res;
|
||||
int current_index = 0;
|
||||
@ -1090,9 +1084,8 @@ static void conf(struct menu *menu)
|
||||
if (!child_count)
|
||||
break;
|
||||
|
||||
show_menu(prompt ? prompt : "Main Menu",
|
||||
menu_instructions,
|
||||
current_index, &last_top_row);
|
||||
show_menu(menu_get_prompt(menu), menu_instructions,
|
||||
current_index, &last_top_row);
|
||||
keypad((menu_win(curses_menu)), TRUE);
|
||||
while (!global_exit) {
|
||||
if (match_state.in_search) {
|
||||
@ -1418,7 +1411,7 @@ static void conf_load(void)
|
||||
return;
|
||||
if (!conf_read(dialog_input_result)) {
|
||||
set_config_filename(dialog_input_result);
|
||||
sym_set_change_count(1);
|
||||
conf_set_changed(true);
|
||||
return;
|
||||
}
|
||||
btn_dialog(main_window, "File does not exist!", 0);
|
||||
@ -1537,9 +1530,9 @@ int main(int ac, char **av)
|
||||
menu_opts_on(curses_menu, O_NONCYCLIC);
|
||||
menu_opts_on(curses_menu, O_IGNORECASE);
|
||||
set_menu_mark(curses_menu, " ");
|
||||
set_menu_fore(curses_menu, attributes[MAIN_MENU_FORE]);
|
||||
set_menu_back(curses_menu, attributes[MAIN_MENU_BACK]);
|
||||
set_menu_grey(curses_menu, attributes[MAIN_MENU_GREY]);
|
||||
set_menu_fore(curses_menu, attr_main_menu_fore);
|
||||
set_menu_back(curses_menu, attr_main_menu_back);
|
||||
set_menu_grey(curses_menu, attr_main_menu_grey);
|
||||
|
||||
set_config_filename(conf_get_configname());
|
||||
setup_windows();
|
||||
|
||||
@ -7,169 +7,120 @@
|
||||
#include "nconf.h"
|
||||
#include "lkc.h"
|
||||
|
||||
/* a list of all the different widgets we use */
|
||||
attributes_t attributes[ATTR_MAX+1] = {0};
|
||||
int attr_normal;
|
||||
int attr_main_heading;
|
||||
int attr_main_menu_box;
|
||||
int attr_main_menu_fore;
|
||||
int attr_main_menu_back;
|
||||
int attr_main_menu_grey;
|
||||
int attr_main_menu_heading;
|
||||
int attr_scrollwin_text;
|
||||
int attr_scrollwin_heading;
|
||||
int attr_scrollwin_box;
|
||||
int attr_dialog_text;
|
||||
int attr_dialog_menu_fore;
|
||||
int attr_dialog_menu_back;
|
||||
int attr_dialog_box;
|
||||
int attr_input_box;
|
||||
int attr_input_heading;
|
||||
int attr_input_text;
|
||||
int attr_input_field;
|
||||
int attr_function_text;
|
||||
int attr_function_highlight;
|
||||
|
||||
/* available colors:
|
||||
COLOR_BLACK 0
|
||||
COLOR_RED 1
|
||||
COLOR_GREEN 2
|
||||
COLOR_YELLOW 3
|
||||
COLOR_BLUE 4
|
||||
COLOR_MAGENTA 5
|
||||
COLOR_CYAN 6
|
||||
COLOR_WHITE 7
|
||||
*/
|
||||
static void set_normal_colors(void)
|
||||
{
|
||||
init_pair(NORMAL, -1, -1);
|
||||
init_pair(MAIN_HEADING, COLOR_MAGENTA, -1);
|
||||
#define COLOR_ATTR(_at, _fg, _bg, _hl) \
|
||||
{ .attr = &(_at), .has_color = true, .color_fg = _fg, .color_bg = _bg, .highlight = _hl }
|
||||
#define NO_COLOR_ATTR(_at, _hl) \
|
||||
{ .attr = &(_at), .has_color = false, .highlight = _hl }
|
||||
#define COLOR_DEFAULT -1
|
||||
|
||||
/* FORE is for the selected item */
|
||||
init_pair(MAIN_MENU_FORE, -1, -1);
|
||||
/* BACK for all the rest */
|
||||
init_pair(MAIN_MENU_BACK, -1, -1);
|
||||
init_pair(MAIN_MENU_GREY, -1, -1);
|
||||
init_pair(MAIN_MENU_HEADING, COLOR_GREEN, -1);
|
||||
init_pair(MAIN_MENU_BOX, COLOR_YELLOW, -1);
|
||||
struct nconf_attr_param {
|
||||
int *attr;
|
||||
bool has_color;
|
||||
int color_fg;
|
||||
int color_bg;
|
||||
int highlight;
|
||||
};
|
||||
|
||||
init_pair(SCROLLWIN_TEXT, -1, -1);
|
||||
init_pair(SCROLLWIN_HEADING, COLOR_GREEN, -1);
|
||||
init_pair(SCROLLWIN_BOX, COLOR_YELLOW, -1);
|
||||
static const struct nconf_attr_param color_theme_params[] = {
|
||||
COLOR_ATTR(attr_normal, COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL),
|
||||
COLOR_ATTR(attr_main_heading, COLOR_MAGENTA, COLOR_DEFAULT, A_BOLD | A_UNDERLINE),
|
||||
COLOR_ATTR(attr_main_menu_box, COLOR_YELLOW, COLOR_DEFAULT, A_NORMAL),
|
||||
COLOR_ATTR(attr_main_menu_fore, COLOR_DEFAULT, COLOR_DEFAULT, A_REVERSE),
|
||||
COLOR_ATTR(attr_main_menu_back, COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL),
|
||||
COLOR_ATTR(attr_main_menu_grey, COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL),
|
||||
COLOR_ATTR(attr_main_menu_heading, COLOR_GREEN, COLOR_DEFAULT, A_BOLD),
|
||||
COLOR_ATTR(attr_scrollwin_text, COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL),
|
||||
COLOR_ATTR(attr_scrollwin_heading, COLOR_GREEN, COLOR_DEFAULT, A_BOLD),
|
||||
COLOR_ATTR(attr_scrollwin_box, COLOR_YELLOW, COLOR_DEFAULT, A_BOLD),
|
||||
COLOR_ATTR(attr_dialog_text, COLOR_DEFAULT, COLOR_DEFAULT, A_BOLD),
|
||||
COLOR_ATTR(attr_dialog_menu_fore, COLOR_RED, COLOR_DEFAULT, A_STANDOUT),
|
||||
COLOR_ATTR(attr_dialog_menu_back, COLOR_YELLOW, COLOR_DEFAULT, A_NORMAL),
|
||||
COLOR_ATTR(attr_dialog_box, COLOR_YELLOW, COLOR_DEFAULT, A_BOLD),
|
||||
COLOR_ATTR(attr_input_box, COLOR_YELLOW, COLOR_DEFAULT, A_NORMAL),
|
||||
COLOR_ATTR(attr_input_heading, COLOR_GREEN, COLOR_DEFAULT, A_BOLD),
|
||||
COLOR_ATTR(attr_input_text, COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL),
|
||||
COLOR_ATTR(attr_input_field, COLOR_DEFAULT, COLOR_DEFAULT, A_UNDERLINE),
|
||||
COLOR_ATTR(attr_function_text, COLOR_YELLOW, COLOR_DEFAULT, A_REVERSE),
|
||||
COLOR_ATTR(attr_function_highlight, COLOR_DEFAULT, COLOR_DEFAULT, A_BOLD),
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
init_pair(DIALOG_TEXT, -1, -1);
|
||||
init_pair(DIALOG_BOX, COLOR_YELLOW, -1);
|
||||
init_pair(DIALOG_MENU_BACK, COLOR_YELLOW, -1);
|
||||
init_pair(DIALOG_MENU_FORE, COLOR_RED, -1);
|
||||
|
||||
init_pair(INPUT_BOX, COLOR_YELLOW, -1);
|
||||
init_pair(INPUT_HEADING, COLOR_GREEN, -1);
|
||||
init_pair(INPUT_TEXT, -1, -1);
|
||||
init_pair(INPUT_FIELD, -1, -1);
|
||||
|
||||
init_pair(FUNCTION_HIGHLIGHT, -1, -1);
|
||||
init_pair(FUNCTION_TEXT, COLOR_YELLOW, -1);
|
||||
}
|
||||
|
||||
/* available attributes:
|
||||
A_NORMAL Normal display (no highlight)
|
||||
A_STANDOUT Best highlighting mode of the terminal.
|
||||
A_UNDERLINE Underlining
|
||||
A_REVERSE Reverse video
|
||||
A_BLINK Blinking
|
||||
A_DIM Half bright
|
||||
A_BOLD Extra bright or bold
|
||||
A_PROTECT Protected mode
|
||||
A_INVIS Invisible or blank mode
|
||||
A_ALTCHARSET Alternate character set
|
||||
A_CHARTEXT Bit-mask to extract a character
|
||||
COLOR_PAIR(n) Color-pair number n
|
||||
*/
|
||||
static void normal_color_theme(void)
|
||||
{
|
||||
/* automatically add color... */
|
||||
#define mkattr(name, attr) do { \
|
||||
attributes[name] = attr | COLOR_PAIR(name); } while (0)
|
||||
mkattr(NORMAL, NORMAL);
|
||||
mkattr(MAIN_HEADING, A_BOLD | A_UNDERLINE);
|
||||
|
||||
mkattr(MAIN_MENU_FORE, A_REVERSE);
|
||||
mkattr(MAIN_MENU_BACK, A_NORMAL);
|
||||
mkattr(MAIN_MENU_GREY, A_NORMAL);
|
||||
mkattr(MAIN_MENU_HEADING, A_BOLD);
|
||||
mkattr(MAIN_MENU_BOX, A_NORMAL);
|
||||
|
||||
mkattr(SCROLLWIN_TEXT, A_NORMAL);
|
||||
mkattr(SCROLLWIN_HEADING, A_BOLD);
|
||||
mkattr(SCROLLWIN_BOX, A_BOLD);
|
||||
|
||||
mkattr(DIALOG_TEXT, A_BOLD);
|
||||
mkattr(DIALOG_BOX, A_BOLD);
|
||||
mkattr(DIALOG_MENU_FORE, A_STANDOUT);
|
||||
mkattr(DIALOG_MENU_BACK, A_NORMAL);
|
||||
|
||||
mkattr(INPUT_BOX, A_NORMAL);
|
||||
mkattr(INPUT_HEADING, A_BOLD);
|
||||
mkattr(INPUT_TEXT, A_NORMAL);
|
||||
mkattr(INPUT_FIELD, A_UNDERLINE);
|
||||
|
||||
mkattr(FUNCTION_HIGHLIGHT, A_BOLD);
|
||||
mkattr(FUNCTION_TEXT, A_REVERSE);
|
||||
}
|
||||
|
||||
static void no_colors_theme(void)
|
||||
{
|
||||
/* automatically add highlight, no color */
|
||||
#define mkattrn(name, attr) { attributes[name] = attr; }
|
||||
|
||||
mkattrn(NORMAL, NORMAL);
|
||||
mkattrn(MAIN_HEADING, A_BOLD | A_UNDERLINE);
|
||||
|
||||
mkattrn(MAIN_MENU_FORE, A_STANDOUT);
|
||||
mkattrn(MAIN_MENU_BACK, A_NORMAL);
|
||||
mkattrn(MAIN_MENU_GREY, A_NORMAL);
|
||||
mkattrn(MAIN_MENU_HEADING, A_BOLD);
|
||||
mkattrn(MAIN_MENU_BOX, A_NORMAL);
|
||||
|
||||
mkattrn(SCROLLWIN_TEXT, A_NORMAL);
|
||||
mkattrn(SCROLLWIN_HEADING, A_BOLD);
|
||||
mkattrn(SCROLLWIN_BOX, A_BOLD);
|
||||
|
||||
mkattrn(DIALOG_TEXT, A_NORMAL);
|
||||
mkattrn(DIALOG_BOX, A_BOLD);
|
||||
mkattrn(DIALOG_MENU_FORE, A_STANDOUT);
|
||||
mkattrn(DIALOG_MENU_BACK, A_NORMAL);
|
||||
|
||||
mkattrn(INPUT_BOX, A_BOLD);
|
||||
mkattrn(INPUT_HEADING, A_BOLD);
|
||||
mkattrn(INPUT_TEXT, A_NORMAL);
|
||||
mkattrn(INPUT_FIELD, A_UNDERLINE);
|
||||
|
||||
mkattrn(FUNCTION_HIGHLIGHT, A_BOLD);
|
||||
mkattrn(FUNCTION_TEXT, A_REVERSE);
|
||||
}
|
||||
static const struct nconf_attr_param no_color_theme_params[] = {
|
||||
NO_COLOR_ATTR(attr_normal, A_NORMAL),
|
||||
NO_COLOR_ATTR(attr_main_heading, A_BOLD | A_UNDERLINE),
|
||||
NO_COLOR_ATTR(attr_main_menu_box, A_NORMAL),
|
||||
NO_COLOR_ATTR(attr_main_menu_fore, A_STANDOUT),
|
||||
NO_COLOR_ATTR(attr_main_menu_back, A_NORMAL),
|
||||
NO_COLOR_ATTR(attr_main_menu_grey, A_NORMAL),
|
||||
NO_COLOR_ATTR(attr_main_menu_heading, A_BOLD),
|
||||
NO_COLOR_ATTR(attr_scrollwin_text, A_NORMAL),
|
||||
NO_COLOR_ATTR(attr_scrollwin_heading, A_BOLD),
|
||||
NO_COLOR_ATTR(attr_scrollwin_box, A_BOLD),
|
||||
NO_COLOR_ATTR(attr_dialog_text, A_NORMAL),
|
||||
NO_COLOR_ATTR(attr_dialog_menu_fore, A_STANDOUT),
|
||||
NO_COLOR_ATTR(attr_dialog_menu_back, A_NORMAL),
|
||||
NO_COLOR_ATTR(attr_dialog_box, A_BOLD),
|
||||
NO_COLOR_ATTR(attr_input_box, A_BOLD),
|
||||
NO_COLOR_ATTR(attr_input_heading, A_BOLD),
|
||||
NO_COLOR_ATTR(attr_input_text, A_NORMAL),
|
||||
NO_COLOR_ATTR(attr_input_field, A_UNDERLINE),
|
||||
NO_COLOR_ATTR(attr_function_text, A_REVERSE),
|
||||
NO_COLOR_ATTR(attr_function_highlight, A_BOLD),
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
void set_colors(void)
|
||||
{
|
||||
start_color();
|
||||
use_default_colors();
|
||||
set_normal_colors();
|
||||
const struct nconf_attr_param *p;
|
||||
int pair = 0;
|
||||
|
||||
if (has_colors()) {
|
||||
normal_color_theme();
|
||||
start_color();
|
||||
use_default_colors();
|
||||
p = color_theme_params;
|
||||
} else {
|
||||
/* give defaults */
|
||||
no_colors_theme();
|
||||
p = no_color_theme_params;
|
||||
}
|
||||
|
||||
for (; p->attr; p++) {
|
||||
int attr = p->highlight;
|
||||
|
||||
if (p->has_color) {
|
||||
pair++;
|
||||
init_pair(pair, p->color_fg, p->color_bg);
|
||||
attr |= COLOR_PAIR(pair);
|
||||
}
|
||||
|
||||
*p->attr = attr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* this changes the windows attributes !!! */
|
||||
void print_in_middle(WINDOW *win,
|
||||
int starty,
|
||||
int startx,
|
||||
int width,
|
||||
const char *string,
|
||||
chtype color)
|
||||
{ int length, x, y;
|
||||
float temp;
|
||||
|
||||
|
||||
if (win == NULL)
|
||||
win = stdscr;
|
||||
getyx(win, y, x);
|
||||
if (startx != 0)
|
||||
x = startx;
|
||||
if (starty != 0)
|
||||
y = starty;
|
||||
if (width == 0)
|
||||
width = 80;
|
||||
|
||||
length = strlen(string);
|
||||
temp = (width - length) / 2;
|
||||
x = startx + (int)temp;
|
||||
(void) wattrset(win, color);
|
||||
mvwprintw(win, y, x, "%s", string);
|
||||
refresh();
|
||||
void print_in_middle(WINDOW *win, int y, int width, const char *str, int attrs)
|
||||
{
|
||||
wattrset(win, attrs);
|
||||
mvwprintw(win, y, (width - strlen(str)) / 2, "%s", str);
|
||||
}
|
||||
|
||||
int get_line_no(const char *text)
|
||||
@ -294,14 +245,14 @@ int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...)
|
||||
msg_win = derwin(win, win_rows-2, msg_width, 1,
|
||||
1+(total_width+2-msg_width)/2);
|
||||
|
||||
set_menu_fore(menu, attributes[DIALOG_MENU_FORE]);
|
||||
set_menu_back(menu, attributes[DIALOG_MENU_BACK]);
|
||||
set_menu_fore(menu, attr_dialog_menu_fore);
|
||||
set_menu_back(menu, attr_dialog_menu_back);
|
||||
|
||||
(void) wattrset(win, attributes[DIALOG_BOX]);
|
||||
wattrset(win, attr_dialog_box);
|
||||
box(win, 0, 0);
|
||||
|
||||
/* print message */
|
||||
(void) wattrset(msg_win, attributes[DIALOG_TEXT]);
|
||||
wattrset(msg_win, attr_dialog_text);
|
||||
fill_window(msg_win, msg);
|
||||
|
||||
set_menu_win(menu, win);
|
||||
@ -405,16 +356,16 @@ int dialog_inputbox(WINDOW *main_window,
|
||||
form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2);
|
||||
keypad(form_win, TRUE);
|
||||
|
||||
(void) wattrset(form_win, attributes[INPUT_FIELD]);
|
||||
wattrset(form_win, attr_input_field);
|
||||
|
||||
(void) wattrset(win, attributes[INPUT_BOX]);
|
||||
wattrset(win, attr_input_box);
|
||||
box(win, 0, 0);
|
||||
(void) wattrset(win, attributes[INPUT_HEADING]);
|
||||
wattrset(win, attr_input_heading);
|
||||
if (title)
|
||||
mvwprintw(win, 0, 3, "%s", title);
|
||||
|
||||
/* print message */
|
||||
(void) wattrset(prompt_win, attributes[INPUT_TEXT]);
|
||||
wattrset(prompt_win, attr_input_text);
|
||||
fill_window(prompt_win, prompt);
|
||||
|
||||
mvwprintw(form_win, 0, 0, "%*s", prompt_width, " ");
|
||||
@ -576,7 +527,7 @@ void show_scroll_win(WINDOW *main_window,
|
||||
|
||||
/* create the pad */
|
||||
pad = newpad(total_lines+10, total_cols+10);
|
||||
(void) wattrset(pad, attributes[SCROLLWIN_TEXT]);
|
||||
wattrset(pad, attr_scrollwin_text);
|
||||
fill_window(pad, text);
|
||||
|
||||
win_lines = min(total_lines+4, lines-2);
|
||||
@ -591,9 +542,9 @@ void show_scroll_win(WINDOW *main_window,
|
||||
win = newwin(win_lines, win_cols, y, x);
|
||||
keypad(win, TRUE);
|
||||
/* show the help in the help window, and show the help panel */
|
||||
(void) wattrset(win, attributes[SCROLLWIN_BOX]);
|
||||
wattrset(win, attr_scrollwin_box);
|
||||
box(win, 0, 0);
|
||||
(void) wattrset(win, attributes[SCROLLWIN_HEADING]);
|
||||
wattrset(win, attr_scrollwin_heading);
|
||||
mvwprintw(win, 0, 3, " %s ", title);
|
||||
panel = new_panel(win);
|
||||
|
||||
@ -604,10 +555,9 @@ void show_scroll_win(WINDOW *main_window,
|
||||
text_cols, 0);
|
||||
print_in_middle(win,
|
||||
text_lines+2,
|
||||
0,
|
||||
text_cols,
|
||||
"<OK>",
|
||||
attributes[DIALOG_MENU_FORE]);
|
||||
attr_dialog_menu_fore);
|
||||
wrefresh(win);
|
||||
|
||||
res = wgetch(win);
|
||||
|
||||
@ -32,30 +32,26 @@
|
||||
typeof(b) _b = b;\
|
||||
_a < _b ? _a : _b; })
|
||||
|
||||
typedef enum {
|
||||
NORMAL = 1,
|
||||
MAIN_HEADING,
|
||||
MAIN_MENU_BOX,
|
||||
MAIN_MENU_FORE,
|
||||
MAIN_MENU_BACK,
|
||||
MAIN_MENU_GREY,
|
||||
MAIN_MENU_HEADING,
|
||||
SCROLLWIN_TEXT,
|
||||
SCROLLWIN_HEADING,
|
||||
SCROLLWIN_BOX,
|
||||
DIALOG_TEXT,
|
||||
DIALOG_MENU_FORE,
|
||||
DIALOG_MENU_BACK,
|
||||
DIALOG_BOX,
|
||||
INPUT_BOX,
|
||||
INPUT_HEADING,
|
||||
INPUT_TEXT,
|
||||
INPUT_FIELD,
|
||||
FUNCTION_TEXT,
|
||||
FUNCTION_HIGHLIGHT,
|
||||
ATTR_MAX
|
||||
} attributes_t;
|
||||
extern attributes_t attributes[];
|
||||
extern int attr_normal;
|
||||
extern int attr_main_heading;
|
||||
extern int attr_main_menu_box;
|
||||
extern int attr_main_menu_fore;
|
||||
extern int attr_main_menu_back;
|
||||
extern int attr_main_menu_grey;
|
||||
extern int attr_main_menu_heading;
|
||||
extern int attr_scrollwin_text;
|
||||
extern int attr_scrollwin_heading;
|
||||
extern int attr_scrollwin_box;
|
||||
extern int attr_dialog_text;
|
||||
extern int attr_dialog_menu_fore;
|
||||
extern int attr_dialog_menu_back;
|
||||
extern int attr_dialog_box;
|
||||
extern int attr_input_box;
|
||||
extern int attr_input_heading;
|
||||
extern int attr_input_text;
|
||||
extern int attr_input_field;
|
||||
extern int attr_function_text;
|
||||
extern int attr_function_highlight;
|
||||
|
||||
typedef enum {
|
||||
F_HELP = 1,
|
||||
@ -72,12 +68,7 @@ typedef enum {
|
||||
void set_colors(void);
|
||||
|
||||
/* this changes the windows attributes !!! */
|
||||
void print_in_middle(WINDOW *win,
|
||||
int starty,
|
||||
int startx,
|
||||
int width,
|
||||
const char *string,
|
||||
chtype color);
|
||||
void print_in_middle(WINDOW *win, int y, int width, const char *str, int attrs);
|
||||
int get_line_length(const char *line);
|
||||
int get_line_no(const char *text);
|
||||
const char *get_line(const char *text, int line_no);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,9 @@
|
||||
/* A Bison parser, made by GNU Bison 3.1. */
|
||||
/* A Bison parser, made by GNU Bison 3.7.6. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -15,7 +16,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
@ -30,6 +31,10 @@
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
|
||||
especially those whose name start with YY_ or yy_. They are
|
||||
private implementation details that can be changed or removed. */
|
||||
|
||||
#ifndef YY_YY_PARSER_TAB_H_INCLUDED
|
||||
# define YY_YY_PARSER_TAB_H_INCLUDED
|
||||
/* Debug traces. */
|
||||
@ -40,72 +45,72 @@
|
||||
extern int yydebug;
|
||||
#endif
|
||||
|
||||
/* Token type. */
|
||||
/* Token kinds. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
enum yytokentype
|
||||
{
|
||||
T_HELPTEXT = 258,
|
||||
T_WORD = 259,
|
||||
T_WORD_QUOTE = 260,
|
||||
T_ALLNOCONFIG_Y = 261,
|
||||
T_BOOL = 262,
|
||||
T_CHOICE = 263,
|
||||
T_CLOSE_PAREN = 264,
|
||||
T_COLON_EQUAL = 265,
|
||||
T_COMMENT = 266,
|
||||
T_CONFIG = 267,
|
||||
T_DEFAULT = 268,
|
||||
T_DEFCONFIG_LIST = 269,
|
||||
T_DEF_BOOL = 270,
|
||||
T_DEF_TRISTATE = 271,
|
||||
T_DEPENDS = 272,
|
||||
T_ENDCHOICE = 273,
|
||||
T_ENDIF = 274,
|
||||
T_ENDMENU = 275,
|
||||
T_HELP = 276,
|
||||
T_HEX = 277,
|
||||
T_IF = 278,
|
||||
T_IMPLY = 279,
|
||||
T_INT = 280,
|
||||
T_MAINMENU = 281,
|
||||
T_MENU = 282,
|
||||
T_MENUCONFIG = 283,
|
||||
T_MODULES = 284,
|
||||
T_ON = 285,
|
||||
T_OPEN_PAREN = 286,
|
||||
T_OPTION = 287,
|
||||
T_OPTIONAL = 288,
|
||||
T_PLUS_EQUAL = 289,
|
||||
T_PROMPT = 290,
|
||||
T_RANGE = 291,
|
||||
T_RESET = 292,
|
||||
T_SELECT = 293,
|
||||
T_SOURCE = 294,
|
||||
T_STRING = 295,
|
||||
T_TRISTATE = 296,
|
||||
T_VISIBLE = 297,
|
||||
T_EOL = 298,
|
||||
T_ASSIGN_VAL = 299,
|
||||
T_OR = 300,
|
||||
T_AND = 301,
|
||||
T_EQUAL = 302,
|
||||
T_UNEQUAL = 303,
|
||||
T_LESS = 304,
|
||||
T_LESS_EQUAL = 305,
|
||||
T_GREATER = 306,
|
||||
T_GREATER_EQUAL = 307,
|
||||
T_NOT = 308
|
||||
YYEMPTY = -2,
|
||||
YYEOF = 0, /* "end of file" */
|
||||
YYerror = 256, /* error */
|
||||
YYUNDEF = 257, /* "invalid token" */
|
||||
T_HELPTEXT = 258, /* T_HELPTEXT */
|
||||
T_WORD = 259, /* T_WORD */
|
||||
T_WORD_QUOTE = 260, /* T_WORD_QUOTE */
|
||||
T_BOOL = 261, /* T_BOOL */
|
||||
T_CHOICE = 262, /* T_CHOICE */
|
||||
T_CLOSE_PAREN = 263, /* T_CLOSE_PAREN */
|
||||
T_COLON_EQUAL = 264, /* T_COLON_EQUAL */
|
||||
T_COMMENT = 265, /* T_COMMENT */
|
||||
T_CONFIG = 266, /* T_CONFIG */
|
||||
T_DEFAULT = 267, /* T_DEFAULT */
|
||||
T_DEF_BOOL = 268, /* T_DEF_BOOL */
|
||||
T_DEF_TRISTATE = 269, /* T_DEF_TRISTATE */
|
||||
T_DEPENDS = 270, /* T_DEPENDS */
|
||||
T_ENDCHOICE = 271, /* T_ENDCHOICE */
|
||||
T_ENDIF = 272, /* T_ENDIF */
|
||||
T_ENDMENU = 273, /* T_ENDMENU */
|
||||
T_HELP = 274, /* T_HELP */
|
||||
T_HEX = 275, /* T_HEX */
|
||||
T_IF = 276, /* T_IF */
|
||||
T_IMPLY = 277, /* T_IMPLY */
|
||||
T_INT = 278, /* T_INT */
|
||||
T_MAINMENU = 279, /* T_MAINMENU */
|
||||
T_MENU = 280, /* T_MENU */
|
||||
T_MENUCONFIG = 281, /* T_MENUCONFIG */
|
||||
T_MODULES = 282, /* T_MODULES */
|
||||
T_ON = 283, /* T_ON */
|
||||
T_OPEN_PAREN = 284, /* T_OPEN_PAREN */
|
||||
T_OPTIONAL = 285, /* T_OPTIONAL */
|
||||
T_PLUS_EQUAL = 286, /* T_PLUS_EQUAL */
|
||||
T_PROMPT = 287, /* T_PROMPT */
|
||||
T_RANGE = 288, /* T_RANGE */
|
||||
T_RESET = 289, /* T_RESET */
|
||||
T_SELECT = 290, /* T_SELECT */
|
||||
T_SOURCE = 291, /* T_SOURCE */
|
||||
T_STRING = 292, /* T_STRING */
|
||||
T_TRISTATE = 293, /* T_TRISTATE */
|
||||
T_VISIBLE = 294, /* T_VISIBLE */
|
||||
T_EOL = 295, /* T_EOL */
|
||||
T_ASSIGN_VAL = 296, /* T_ASSIGN_VAL */
|
||||
T_OR = 297, /* T_OR */
|
||||
T_AND = 298, /* T_AND */
|
||||
T_EQUAL = 299, /* T_EQUAL */
|
||||
T_UNEQUAL = 300, /* T_UNEQUAL */
|
||||
T_LESS = 301, /* T_LESS */
|
||||
T_LESS_EQUAL = 302, /* T_LESS_EQUAL */
|
||||
T_GREATER = 303, /* T_GREATER */
|
||||
T_GREATER_EQUAL = 304, /* T_GREATER_EQUAL */
|
||||
T_NOT = 305 /* T_NOT */
|
||||
};
|
||||
typedef enum yytokentype yytoken_kind_t;
|
||||
#endif
|
||||
|
||||
/* Value type. */
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
|
||||
union YYSTYPE
|
||||
{
|
||||
|
||||
|
||||
char *string;
|
||||
struct symbol *symbol;
|
||||
struct expr *expr;
|
||||
@ -115,7 +120,6 @@ union YYSTYPE
|
||||
|
||||
|
||||
};
|
||||
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "lkc.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
|
||||
|
||||
@ -28,7 +29,7 @@ static bool zconf_endtoken(const char *tokenname,
|
||||
|
||||
struct symbol *symbol_hash[SYMBOL_HASHSIZE];
|
||||
|
||||
static struct menu *current_menu, *current_entry;
|
||||
struct menu *current_menu, *current_entry;
|
||||
|
||||
%}
|
||||
|
||||
@ -45,7 +46,6 @@ static struct menu *current_menu, *current_entry;
|
||||
%token <string> T_HELPTEXT
|
||||
%token <string> T_WORD
|
||||
%token <string> T_WORD_QUOTE
|
||||
%token T_ALLNOCONFIG_Y
|
||||
%token T_BOOL
|
||||
%token T_CHOICE
|
||||
%token T_CLOSE_PAREN
|
||||
@ -53,7 +53,6 @@ static struct menu *current_menu, *current_entry;
|
||||
%token T_COMMENT
|
||||
%token T_CONFIG
|
||||
%token T_DEFAULT
|
||||
%token T_DEFCONFIG_LIST
|
||||
%token T_DEF_BOOL
|
||||
%token T_DEF_TRISTATE
|
||||
%token T_DEPENDS
|
||||
@ -71,7 +70,6 @@ static struct menu *current_menu, *current_entry;
|
||||
%token T_MODULES
|
||||
%token T_ON
|
||||
%token T_OPEN_PAREN
|
||||
%token T_OPTION
|
||||
%token T_OPTIONAL
|
||||
%token T_PLUS_EQUAL
|
||||
%token T_PROMPT
|
||||
@ -120,20 +118,24 @@ mainmenu_stmt: T_MAINMENU T_WORD_QUOTE T_EOL
|
||||
|
||||
stmt_list:
|
||||
/* empty */
|
||||
| stmt_list common_stmt
|
||||
| stmt_list assignment_stmt
|
||||
| stmt_list choice_stmt
|
||||
| stmt_list comment_stmt
|
||||
| stmt_list config_stmt
|
||||
| stmt_list if_stmt
|
||||
| stmt_list menu_stmt
|
||||
| stmt_list menuconfig_stmt
|
||||
| stmt_list source_stmt
|
||||
| stmt_list T_WORD error T_EOL { zconf_error("unknown statement \"%s\"", $2); }
|
||||
| stmt_list error T_EOL { zconf_error("invalid statement"); }
|
||||
;
|
||||
|
||||
common_stmt:
|
||||
if_stmt
|
||||
| comment_stmt
|
||||
| config_stmt
|
||||
| menuconfig_stmt
|
||||
| source_stmt
|
||||
| assignment_stmt
|
||||
stmt_list_in_choice:
|
||||
/* empty */
|
||||
| stmt_list_in_choice comment_stmt
|
||||
| stmt_list_in_choice config_stmt
|
||||
| stmt_list_in_choice if_stmt_in_choice
|
||||
| stmt_list_in_choice error T_EOL { zconf_error("invalid statement"); }
|
||||
;
|
||||
|
||||
/* config/menuconfig entry */
|
||||
@ -215,19 +217,12 @@ config_option: T_RANGE symbol symbol if_expr T_EOL
|
||||
printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
|
||||
};
|
||||
|
||||
config_option: T_OPTION T_MODULES T_EOL
|
||||
config_option: T_MODULES T_EOL
|
||||
{
|
||||
menu_add_option_modules();
|
||||
};
|
||||
|
||||
config_option: T_OPTION T_DEFCONFIG_LIST T_EOL
|
||||
{
|
||||
menu_add_option_defconfig_list();
|
||||
};
|
||||
|
||||
config_option: T_OPTION T_ALLNOCONFIG_Y T_EOL
|
||||
{
|
||||
menu_add_option_allnoconfig_y();
|
||||
if (modules_sym)
|
||||
zconf_error("symbol '%s' redefines option 'modules' already defined by symbol '%s'",
|
||||
current_entry->sym->name, modules_sym->name);
|
||||
modules_sym = current_entry->sym;
|
||||
};
|
||||
|
||||
/* choice entry */
|
||||
@ -255,7 +250,7 @@ choice_end: end
|
||||
}
|
||||
};
|
||||
|
||||
choice_stmt: choice_entry choice_block choice_end
|
||||
choice_stmt: choice_entry stmt_list_in_choice choice_end
|
||||
;
|
||||
|
||||
choice_option_list:
|
||||
@ -311,11 +306,6 @@ default:
|
||||
| T_DEF_BOOL { $$ = S_BOOLEAN; }
|
||||
| T_DEF_TRISTATE { $$ = S_TRISTATE; }
|
||||
|
||||
choice_block:
|
||||
/* empty */
|
||||
| choice_block common_stmt
|
||||
;
|
||||
|
||||
/* if entry */
|
||||
|
||||
if_entry: T_IF expr T_EOL
|
||||
@ -337,6 +327,9 @@ if_end: end
|
||||
if_stmt: if_entry stmt_list if_end
|
||||
;
|
||||
|
||||
if_stmt_in_choice: if_entry stmt_list_in_choice if_end
|
||||
;
|
||||
|
||||
/* menu entry */
|
||||
|
||||
menu: T_MENU T_WORD_QUOTE T_EOL
|
||||
@ -517,7 +510,7 @@ void conf_parse(const char *name)
|
||||
}
|
||||
if (yynerrs)
|
||||
exit(1);
|
||||
sym_set_change_count(1);
|
||||
conf_set_changed(true);
|
||||
}
|
||||
|
||||
static bool zconf_endtoken(const char *tokenname,
|
||||
@ -723,5 +716,3 @@ void zconfdump(FILE *out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "menu.c"
|
||||
|
||||
@ -114,7 +114,7 @@ static char *do_error_if(int argc, char *argv[])
|
||||
if (!strcmp(argv[0], "y"))
|
||||
pperror("%s", argv[1]);
|
||||
|
||||
return NULL;
|
||||
return xstrdup("");
|
||||
}
|
||||
|
||||
static char *do_filename(int argc, char *argv[])
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
PKG="Qt5Core Qt5Gui Qt5Widgets"
|
||||
PKG2="QtCore QtGui"
|
||||
|
||||
if [ -z "$(command -v pkg-config)" ]; then
|
||||
echo >&2 "*"
|
||||
@ -12,21 +11,14 @@ if [ -z "$(command -v pkg-config)" ]; then
|
||||
fi
|
||||
|
||||
if pkg-config --exists $PKG; then
|
||||
echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)\"
|
||||
echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags $PKG)\"
|
||||
echo libs=\"$(pkg-config --libs $PKG)\"
|
||||
echo moc=\"$(pkg-config --variable=host_bins Qt5Core)/moc\"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if pkg-config --exists $PKG2; then
|
||||
echo cflags=\"$(pkg-config --cflags $PKG2)\"
|
||||
echo libs=\"$(pkg-config --libs $PKG2)\"
|
||||
echo moc=\"$(pkg-config --variable=moc_location QtCore)\"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo >&2 "*"
|
||||
echo >&2 "* Could not find Qt via pkg-config."
|
||||
echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"
|
||||
echo >&2 "* Could not find Qt5 via pkg-config."
|
||||
echo >&2 "* Please install Qt5 and make sure it's in PKG_CONFIG_PATH"
|
||||
echo >&2 "*"
|
||||
exit 1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -3,23 +3,22 @@
|
||||
* Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
|
||||
*/
|
||||
|
||||
#include <QTextBrowser>
|
||||
#include <QTreeWidget>
|
||||
#include <QMainWindow>
|
||||
#include <QHeaderView>
|
||||
#include <qsettings.h>
|
||||
#include <QPushButton>
|
||||
#include <QSettings>
|
||||
#include <QLineEdit>
|
||||
#include <QSplitter>
|
||||
#include <QCheckBox>
|
||||
#include <QDialog>
|
||||
#include <QHeaderView>
|
||||
#include <QLineEdit>
|
||||
#include <QMainWindow>
|
||||
#include <QPushButton>
|
||||
#include <QSettings>
|
||||
#include <QSplitter>
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QTextBrowser>
|
||||
#include <QTreeWidget>
|
||||
|
||||
#include "expr.h"
|
||||
|
||||
class ConfigView;
|
||||
class ConfigList;
|
||||
class ConfigItem;
|
||||
class ConfigLineEdit;
|
||||
class ConfigMainWindow;
|
||||
|
||||
class ConfigSettings : public QSettings {
|
||||
@ -30,7 +29,7 @@ public:
|
||||
};
|
||||
|
||||
enum colIdx {
|
||||
promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr
|
||||
promptColIdx, nameColIdx, dataColIdx
|
||||
};
|
||||
enum listMode {
|
||||
singleMode, menuMode, symbolMode, fullMode, listMode
|
||||
@ -43,13 +42,16 @@ class ConfigList : public QTreeWidget {
|
||||
Q_OBJECT
|
||||
typedef class QTreeWidget Parent;
|
||||
public:
|
||||
ConfigList(ConfigView* p, const char *name = 0);
|
||||
ConfigList(QWidget *parent, const char *name = 0);
|
||||
~ConfigList();
|
||||
void reinit(void);
|
||||
ConfigView* parent(void) const
|
||||
{
|
||||
return (ConfigView*)Parent::parent();
|
||||
}
|
||||
ConfigItem* findConfigItem(struct menu *);
|
||||
void setSelected(QTreeWidgetItem *item, bool enable) {
|
||||
for (int i = 0; i < selectedItems().size(); i++)
|
||||
selectedItems().at(i)->setSelected(false);
|
||||
|
||||
item->setSelected(enable);
|
||||
}
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *e);
|
||||
@ -63,61 +65,52 @@ protected:
|
||||
public slots:
|
||||
void setRootMenu(struct menu *menu);
|
||||
|
||||
void updateList(ConfigItem *item);
|
||||
void updateList();
|
||||
void setValue(ConfigItem* item, tristate val);
|
||||
void changeValue(ConfigItem* item);
|
||||
void updateSelection(void);
|
||||
void saveSettings(void);
|
||||
void setOptionMode(QAction *action);
|
||||
void setShowName(bool on);
|
||||
|
||||
signals:
|
||||
void menuChanged(struct menu *menu);
|
||||
void menuSelected(struct menu *menu);
|
||||
void itemSelected(struct menu *menu);
|
||||
void parentSelected(void);
|
||||
void gotFocus(struct menu *);
|
||||
void showNameChanged(bool on);
|
||||
|
||||
public:
|
||||
void updateListAll(void)
|
||||
{
|
||||
updateAll = true;
|
||||
updateList(NULL);
|
||||
updateList();
|
||||
updateAll = false;
|
||||
}
|
||||
ConfigList* listView()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
ConfigItem* firstChild() const
|
||||
{
|
||||
return (ConfigItem *)children().first();
|
||||
}
|
||||
void addColumn(colIdx idx)
|
||||
{
|
||||
showColumn(idx);
|
||||
}
|
||||
void removeColumn(colIdx idx)
|
||||
{
|
||||
hideColumn(idx);
|
||||
}
|
||||
void setAllOpen(bool open);
|
||||
void setParentMenu(void);
|
||||
|
||||
bool menuSkip(struct menu *);
|
||||
|
||||
void updateMenuList(ConfigItem *parent, struct menu*);
|
||||
void updateMenuList(ConfigList *parent, struct menu*);
|
||||
void updateMenuList(struct menu *menu);
|
||||
|
||||
bool updateAll;
|
||||
|
||||
QPixmap symbolYesPix, symbolModPix, symbolNoPix;
|
||||
QPixmap choiceYesPix, choiceNoPix;
|
||||
QPixmap menuPix, menuInvPix, menuBackPix, voidPix;
|
||||
|
||||
bool showName, showRange, showData;
|
||||
bool showName;
|
||||
enum listMode mode;
|
||||
enum optionMode optMode;
|
||||
struct menu *rootEntry;
|
||||
QPalette disabledColorGroup;
|
||||
QPalette inactivedColorGroup;
|
||||
QMenu* headerPopup;
|
||||
|
||||
static QList<ConfigList *> allLists;
|
||||
static void updateListForAll();
|
||||
static void updateListAllForAll();
|
||||
|
||||
static QAction *showNormalAction, *showAllAction, *showPromptAction;
|
||||
};
|
||||
|
||||
class ConfigItem : public QTreeWidgetItem {
|
||||
@ -140,7 +133,6 @@ public:
|
||||
}
|
||||
~ConfigItem(void);
|
||||
void init(void);
|
||||
void okRename(int col);
|
||||
void updateMenu(void);
|
||||
void testUpdateMenu(bool v);
|
||||
ConfigList* listView() const
|
||||
@ -165,82 +157,36 @@ public:
|
||||
|
||||
return ret;
|
||||
}
|
||||
void setText(colIdx idx, const QString& text)
|
||||
{
|
||||
Parent::setText(idx, text);
|
||||
}
|
||||
QString text(colIdx idx) const
|
||||
{
|
||||
return Parent::text(idx);
|
||||
}
|
||||
void setPixmap(colIdx idx, const QIcon &icon)
|
||||
{
|
||||
Parent::setIcon(idx, icon);
|
||||
}
|
||||
const QIcon pixmap(colIdx idx) const
|
||||
{
|
||||
return icon(idx);
|
||||
}
|
||||
// TODO: Implement paintCell
|
||||
|
||||
ConfigItem* nextItem;
|
||||
struct menu *menu;
|
||||
bool visible;
|
||||
bool goParent;
|
||||
|
||||
static QIcon symbolYesIcon, symbolModIcon, symbolNoIcon;
|
||||
static QIcon choiceYesIcon, choiceNoIcon;
|
||||
static QIcon menuIcon, menubackIcon;
|
||||
};
|
||||
|
||||
class ConfigLineEdit : public QLineEdit {
|
||||
Q_OBJECT
|
||||
typedef class QLineEdit Parent;
|
||||
class ConfigItemDelegate : public QStyledItemDelegate
|
||||
{
|
||||
private:
|
||||
struct menu *menu;
|
||||
public:
|
||||
ConfigLineEdit(ConfigView* parent);
|
||||
ConfigView* parent(void) const
|
||||
{
|
||||
return (ConfigView*)Parent::parent();
|
||||
}
|
||||
void show(ConfigItem *i);
|
||||
void keyPressEvent(QKeyEvent *e);
|
||||
|
||||
public:
|
||||
ConfigItem *item;
|
||||
};
|
||||
|
||||
class ConfigView : public QWidget {
|
||||
Q_OBJECT
|
||||
typedef class QWidget Parent;
|
||||
public:
|
||||
ConfigView(QWidget* parent, const char *name = 0);
|
||||
~ConfigView(void);
|
||||
static void updateList(ConfigItem* item);
|
||||
static void updateListAll(void);
|
||||
|
||||
bool showName(void) const { return list->showName; }
|
||||
bool showRange(void) const { return list->showRange; }
|
||||
bool showData(void) const { return list->showData; }
|
||||
public slots:
|
||||
void setShowName(bool);
|
||||
void setShowRange(bool);
|
||||
void setShowData(bool);
|
||||
void setOptionMode(QAction *);
|
||||
signals:
|
||||
void showNameChanged(bool);
|
||||
void showRangeChanged(bool);
|
||||
void showDataChanged(bool);
|
||||
public:
|
||||
ConfigList* list;
|
||||
ConfigLineEdit* lineEdit;
|
||||
|
||||
static ConfigView* viewList;
|
||||
ConfigView* nextView;
|
||||
|
||||
static QAction *showNormalAction;
|
||||
static QAction *showAllAction;
|
||||
static QAction *showPromptAction;
|
||||
ConfigItemDelegate(QObject *parent = nullptr)
|
||||
: QStyledItemDelegate(parent) {}
|
||||
QWidget *createEditor(QWidget *parent,
|
||||
const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const override;
|
||||
void setModelData(QWidget *editor, QAbstractItemModel *model,
|
||||
const QModelIndex &index) const override;
|
||||
};
|
||||
|
||||
class ConfigInfoView : public QTextBrowser {
|
||||
Q_OBJECT
|
||||
typedef class QTextBrowser Parent;
|
||||
QMenu *contextMenu;
|
||||
public:
|
||||
ConfigInfoView(QWidget* parent, const char *name = 0);
|
||||
bool showDebug(void) const { return _showDebug; }
|
||||
@ -249,6 +195,7 @@ public slots:
|
||||
void setInfo(struct menu *menu);
|
||||
void saveSettings(void);
|
||||
void setShowDebug(bool);
|
||||
void clicked (const QUrl &url);
|
||||
|
||||
signals:
|
||||
void showDebugChanged(bool);
|
||||
@ -260,8 +207,7 @@ protected:
|
||||
QString debug_info(struct symbol *sym);
|
||||
static QString print_filter(const QString &str);
|
||||
static void expr_print_help(void *data, struct symbol *sym, const char *str);
|
||||
QMenu *createStandardContextMenu(const QPoint & pos);
|
||||
void contextMenuEvent(QContextMenuEvent *e);
|
||||
void contextMenuEvent(QContextMenuEvent *event);
|
||||
|
||||
struct symbol *sym;
|
||||
struct menu *_menu;
|
||||
@ -272,7 +218,7 @@ class ConfigSearchWindow : public QDialog {
|
||||
Q_OBJECT
|
||||
typedef class QDialog Parent;
|
||||
public:
|
||||
ConfigSearchWindow(ConfigMainWindow* parent, const char *name = 0);
|
||||
ConfigSearchWindow(ConfigMainWindow *parent);
|
||||
|
||||
public slots:
|
||||
void saveSettings(void);
|
||||
@ -282,7 +228,7 @@ protected:
|
||||
QLineEdit* editField;
|
||||
QPushButton* searchButton;
|
||||
QSplitter* split;
|
||||
ConfigView* list;
|
||||
ConfigList *list;
|
||||
ConfigInfoView* info;
|
||||
|
||||
struct symbol **result;
|
||||
@ -298,6 +244,7 @@ public:
|
||||
ConfigMainWindow(void);
|
||||
public slots:
|
||||
void changeMenu(struct menu *);
|
||||
void changeItens(struct menu *);
|
||||
void setMenuLink(struct menu *);
|
||||
void listFocusChanged(void);
|
||||
void goBack(void);
|
||||
@ -316,12 +263,9 @@ protected:
|
||||
void closeEvent(QCloseEvent *e);
|
||||
|
||||
ConfigSearchWindow *searchWindow;
|
||||
ConfigView *menuView;
|
||||
ConfigList *menuList;
|
||||
ConfigView *configView;
|
||||
ConfigList *configList;
|
||||
ConfigInfoView *helpText;
|
||||
QToolBar *toolBar;
|
||||
QAction *backAction;
|
||||
QAction *singleViewAction;
|
||||
QAction *splitViewAction;
|
||||
|
||||
@ -3,11 +3,11 @@
|
||||
* Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <regex.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include "lkc.h"
|
||||
|
||||
@ -15,23 +15,28 @@ struct symbol symbol_yes = {
|
||||
.name = "y",
|
||||
.curr = { "y", yes },
|
||||
.flags = SYMBOL_CONST|SYMBOL_VALID,
|
||||
}, symbol_mod = {
|
||||
};
|
||||
|
||||
struct symbol symbol_mod = {
|
||||
.name = "m",
|
||||
.curr = { "m", mod },
|
||||
.flags = SYMBOL_CONST|SYMBOL_VALID,
|
||||
}, symbol_no = {
|
||||
};
|
||||
|
||||
struct symbol symbol_no = {
|
||||
.name = "n",
|
||||
.curr = { "n", no },
|
||||
.flags = SYMBOL_CONST|SYMBOL_VALID,
|
||||
}, symbol_empty = {
|
||||
};
|
||||
|
||||
static struct symbol symbol_empty = {
|
||||
.name = "",
|
||||
.curr = { "", no },
|
||||
.flags = SYMBOL_VALID,
|
||||
};
|
||||
|
||||
struct symbol *sym_defconfig_list;
|
||||
struct symbol *modules_sym;
|
||||
tristate modules_val;
|
||||
static tristate modules_val;
|
||||
int recursive_is_error;
|
||||
|
||||
enum symbol_type sym_get_type(struct symbol *sym)
|
||||
@ -222,7 +227,7 @@ static void sym_calc_visibility(struct symbol *sym)
|
||||
sym_set_changed(sym);
|
||||
}
|
||||
tri = no;
|
||||
if (sym->implied.expr && sym->dir_dep.tri != no)
|
||||
if (sym->implied.expr)
|
||||
tri = expr_calc_value(sym->implied.expr);
|
||||
if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
|
||||
tri = yes;
|
||||
@ -373,6 +378,8 @@ void sym_calc_value(struct symbol *sym)
|
||||
if (sym->implied.tri != no) {
|
||||
sym->flags |= SYMBOL_WRITE;
|
||||
newval.tri = EXPR_OR(newval.tri, sym->implied.tri);
|
||||
newval.tri = EXPR_AND(newval.tri,
|
||||
sym->dir_dep.tri);
|
||||
}
|
||||
}
|
||||
calc_newval:
|
||||
@ -381,8 +388,7 @@ void sym_calc_value(struct symbol *sym)
|
||||
else
|
||||
newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
|
||||
}
|
||||
if (newval.tri == mod &&
|
||||
(sym_get_type(sym) == S_BOOLEAN || sym->implied.tri == yes))
|
||||
if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
|
||||
newval.tri = yes;
|
||||
break;
|
||||
case S_STRING:
|
||||
@ -446,7 +452,7 @@ void sym_clear_all_valid(void)
|
||||
|
||||
for_all_symbols(i, sym)
|
||||
sym->flags &= ~SYMBOL_VALID;
|
||||
sym_add_change_count(1);
|
||||
conf_set_changed(true);
|
||||
sym_calc_value(modules_sym);
|
||||
}
|
||||
|
||||
@ -464,8 +470,6 @@ bool sym_tristate_within_range(struct symbol *sym, tristate val)
|
||||
return false;
|
||||
if (sym->visible <= sym->rev_dep.tri)
|
||||
return false;
|
||||
if (sym->implied.tri == yes && val == mod)
|
||||
return false;
|
||||
if (sym_is_choice_value(sym) && sym->visible == yes)
|
||||
return val == yes;
|
||||
return val >= sym->rev_dep.tri && val <= sym->visible;
|
||||
@ -812,7 +816,7 @@ struct symbol *sym_lookup(const char *name, int flags)
|
||||
memset(symbol, 0, sizeof(*symbol));
|
||||
symbol->name = new_name;
|
||||
symbol->type = S_UNKNOWN;
|
||||
symbol->flags |= flags;
|
||||
symbol->flags = flags;
|
||||
|
||||
symbol->next = symbol_hash[hash];
|
||||
symbol_hash[hash] = symbol;
|
||||
|
||||
@ -8,6 +8,7 @@ grep '^CONFIG_DEVEL=y' .config >> tmp/.diffconfig.head
|
||||
grep '^CONFIG_TOOLCHAINOPTS=y' .config >> tmp/.diffconfig.head
|
||||
grep '^CONFIG_BUSYBOX_CUSTOM=y' .config >> tmp/.diffconfig.head
|
||||
grep '^CONFIG_TARGET_PER_DEVICE_ROOTFS=y' .config >> tmp/.diffconfig.head
|
||||
make -s ./scripts/config/conf
|
||||
./scripts/config/conf --defconfig=tmp/.diffconfig.head -w tmp/.diffconfig.stage1 Config.in >/dev/null
|
||||
./scripts/kconfig.pl '>+' tmp/.diffconfig.stage1 .config >> tmp/.diffconfig.head
|
||||
./scripts/config/conf --defconfig=tmp/.diffconfig.head -w tmp/.diffconfig.stage2 Config.in >/dev/null
|
||||
|
||||
@ -130,7 +130,7 @@ config IN_SDK
|
||||
config MODULES
|
||||
bool
|
||||
default y
|
||||
option modules
|
||||
modules
|
||||
|
||||
source "Config-build.in"
|
||||
source "tmp/.config-package.in"
|
||||
|
||||
@ -7,12 +7,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gdb
|
||||
PKG_VERSION:=11.1
|
||||
PKG_VERSION:=11.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/gdb
|
||||
PKG_HASH:=cccfcc407b20d343fb320d4a9a2110776dd3165118ffd41f4b1b162340333f94
|
||||
PKG_HASH:=1497c36a71881b8671a9a84a0ee40faab788ca30d7ba19d8463c3cc787152e32
|
||||
GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR)
|
||||
|
||||
@ -25,7 +25,8 @@ HOST_CONFIGURE_VARS += \
|
||||
CC="$(HOSTCC_NOCACHE)" \
|
||||
CXX="$(HOSTCXX_NOCACHE)" \
|
||||
MAKEFLAGS="$(HOST_JOBS)" \
|
||||
CXXFLAGS="$(HOST_CFLAGS)"
|
||||
CXXFLAGS="$(HOST_CFLAGS)" \
|
||||
MAKE="$(STAGING_DIR_HOST)/bin/ninja"
|
||||
|
||||
HOST_CONFIGURE_ARGS := \
|
||||
$(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \
|
||||
|
||||
Loading…
Reference in New Issue
Block a user