#36 libre/iceweasel: update to 94.0 from upstreams
Closed 2 months ago by billauger. Opened 2 months ago by grizzlyuser.

Update libre/your-freedom
Parabola automatic package builder • 3 months ago  
systemd-249.5-2.parabola1: updating version
Omar Vega Ramos • 3 months ago  
Update libre/your-freedom
Parabola automatic package builder • 3 months ago  
Update libre/your-freedom
Parabola automatic package builder • 3 months ago  
Update libre/your-freedom
Parabola automatic package builder • 3 months ago  
@@ -2,7 +2,7 @@ 

  

  _target=arm-linux-gnueabi

  pkgname=$_target-binutils

- pkgver=2.36.1

+ pkgver=2.37

  pkgrel=1

  pkgdesc='A set of programs to assemble and manipulate binary and object files for the ARM GNU EABI little-endian target'

  arch=('x86_64' 'i686' 'armv7h')
@@ -10,7 +10,7 @@ 

  license=(GPL)

  depends=(zlib)

  source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2{,.sig})

- sha512sums=('5c40cfe05b922492627db71990dd2ba6030fd2de4bdba3f53a3f274543ff161fb56e2f6bdac107e0ffdcfd095e499c54e1157ee1865723baefa67b5b4d3da201'

+ sha512sums=('b3f5184697f77e94c95d48f6879de214eb5e17aa6ef8e96f65530d157e515b1ae2f290e98453e4ff126462520fa0f63852b6e1c8fbb397ed2e41984336bc78c6'

              'SKIP')

  validpgpkeys=('EAF1C276A747E9ED86210CBAC3126D3B4AE55E93'  # Tristan Gingold <gingold@adacore.com>

                '3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F') # Nick Clifton (Chief Binutils Maintainer) <nickc@redhat.com>

@@ -2,10 +2,10 @@ 

  

  _target=arm-linux-gnueabi

  pkgname=$_target-gcc

- _pkgver=10.2.0

- pkgver=$_pkgver

- _islver=0.22

+ pkgver=11.2.0

+ _islver=0.24

  pkgrel=1

+ #_snapshot=8-20210107

  pkgdesc='The GNU Compiler Collection - cross compiler for ARM GNU EABI little-endian target'

  arch=(x86_64 i686 armv7h)

  url='http://gcc.gnu.org/'
@@ -13,18 +13,19 @@ 

  depends=($_target-binutils libmpc zlib)

  makedepends=(gmp mpfr)

  options=(!emptydirs !strip)

- source=(https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgver/gcc-$_pkgver.tar.xz{,.sig}

-         http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)

- sha512sums=('42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e'

+ source=(https://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.xz{,.sig}

+         #https://gcc.gnu.org/pub/gcc/snapshots/$_snapshot/gcc-$_snapshot.tar.xz

+         https://libisl.sourceforge.io/isl-$_islver.tar.bz2)

+ sha512sums=('d53a0a966230895c54f01aea38696f818817b505f1e2bfa65e508753fcd01b2aedb4a61434f41f3a2ddbbd9f41384b96153c684ded3f0fa97c82758d9de5c7cf'

              'SKIP'

-             'fc2c9796979610dd51143dcefe4f5c989c4354571cc5a1fcc6b932fd41f42a54f6b43adfd289af61be7bd06f3a523fa6a7d7ee56680e32d8036beb4c188fa668')

+             'aab3bddbda96b801d0f56d2869f943157aad52a6f6e6a61745edd740234c635c38231af20bc3f1a08d416a5e973a90e18249078ed8e4ae2f1d5de57658738e95')

  validpgpkeys=(33C235A34C46AA3FFB293709A328C3A2C3C45C06  # Jakub Jelinek <jakub@redhat.com>

                13975A70E63C361C73AE69EF6EEB81F8981C74C7) # Richard Guenther <richard.guenther@gmail.com>

  

  if [ -n "$_snapshot" ]; then

    _basedir=gcc-$_snapshot

  else

-   _basedir=gcc-$_pkgver

+   _basedir=gcc-$pkgver

  fi

  

  prepare() {
@@ -33,7 +34,7 @@ 

    # link isl for in-tree builds

    ln -sf ../isl-$_islver isl

  

-   echo $_pkgver > gcc/BASE-VER

+   echo $pkgver > gcc/BASE-VER

  

    # hack! - some configure tests for header files using "$CPP $CPPFLAGS"

    sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" "$srcdir"/$_basedir/{libiberty,gcc}/configure
@@ -49,6 +50,11 @@ 

    CFLAGS=${CFLAGS/-pipe/}

    CXXFLAGS=${CXXFLAGS/-pipe/}

  

+   if [ "$CARCH" = i686 ]; then

+     # using -Werror=format-security causes i686 build to fail

+     CXXFLAGS+=' -Wno-error=format-security'

+   fi

+ 

    $srcdir/$_basedir/configure \

      --target=$_target \

      --prefix=/usr \

@@ -9,10 +9,10 @@ 

   2 files changed, 6 insertions(+), 12 deletions(-)

  

  diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp

- index 055be3e7a3554..f660bd26e331c 100644

+ index 332f340179d3..840ad794f606 100644

  --- a/toolkit/xre/nsAppRunner.cpp

  +++ b/toolkit/xre/nsAppRunner.cpp

- @@ -4304,11 +4304,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {

+ @@ -4285,11 +4285,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {

     // consistently.

   

     // Set program name to the one defined in application.ini.
@@ -26,7 +26,7 @@ 

     // Initialize GTK here for splash.

   

  diff --git a/widget/gtk/nsAppShell.cpp b/widget/gtk/nsAppShell.cpp

- index 60de473de07ab..004c066575c17 100644

+ index 60de473de07a..004c066575c1 100644

  --- a/widget/gtk/nsAppShell.cpp

  +++ b/widget/gtk/nsAppShell.cpp

  @@ -24,6 +24,8 @@

@@ -318,10 +318,12 @@ 

       const params = {

         ...filters,

         _expected: expectedTimestamp ?? 0,

- @@ -166,6 +166,9 @@ var Utils = {

+ @@ -273,7 +264,10 @@ var Utils = {

+            .map(([k, v]) => `${k}=${encodeURIComponent(v)}`)

             .join("&");

       }

-      const response = await fetch(url);

+ -    const response = await Utils.fetch(url);

+ +    const response = await fetch(url);

  +    const responseDate = new Date().toUTCString()

  +    response.headers.set("Date", responseDate);

  +    response.headers.set("Last-Modified", responseDate);
@@ -368,9 +370,9 @@ 

       "blocklists",

       "main",

  +    "monitor",

-      "pinning",

       "security-state",

   ]

+  

  -- 

  2.31.1

  
@@ -536,7 +538,7 @@ 

  -      signature: { x5u, signature },

  +      json_dump_metadata: { hash, size },

       } = metadata;

- -    const certChain = await (await fetch(x5u)).text();

+ -    const certChain = await (await Utils.fetch(x5u)).text();

       // Merge remote records with local ones and serialize as canonical JSON.

       const serialized = await RemoteSettingsWorker.canonicalStringify(

         records,
@@ -637,7 +639,7 @@ 

     IDBHelpers: "resource://services-settings/IDBHelpers.jsm",

     KintoHttpClient: "resource://services-common/kinto-http-client.js",

  @@ -30,6 +31,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {

-  XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);

+  });

   

   const TELEMETRY_COMPONENT = "remotesettings";

  +const DEFERRED_SYNC_DELAY_MILLISECONDS = 1000;

file modified
+9 -14
@@ -47,10 +47,10 @@ 

  

  pkgname=iceweasel

  epoch=1

- pkgver=92.0

+ pkgver=94.0

  pkgrel=1

  pkgrel+=.parabola1

- _brandingver=91.0-1

+ _brandingver=93.0-1

  pkgdesc="Standalone web browser derived from Mozilla Firefox"

  arch=(x86_64)

  arch+=(i686 armv7h)
@@ -79,25 +79,23 @@ 

           9003-FSDG-misc.patch

           process-json-files.py

           vendor.js.in)

- source_armv7h=(arm.patch

-                build-arm-libopus.patch)

+ source_armv7h=(build-arm-libopus.patch)

  source_i686=('avoid-libxul-OOM-python-check.patch'

               'rust-static-disable-network-test-on-static-libraries.patch')

- sha256sums=('299a472373021cc9194449c9f4bb962d5f74ef05e8af0448c589761ea34fbc84'

+ sha256sums=('b7bb8c5fcc74a74e9d2b55d1e9415b891305fe86520fb854cec25024d7e5de67'

              'SKIP'

-             'd7c7a65c4b7ec9ea40df129724ffb369d3f775b0514e3c267c52eec6d284b5e6'

+             '51cca2cab0fa9798f96b81ed24c238b2a7c98524f589ec500224bac9797b66fb'

              '9cdc2602661717712092d28bb494e5b48e518cb930898aca85eaf21f91f7ef58')

- sha256sums+=('b3cf2d984a979a1daf997efaa46358c601a7b3e957cbc21f4155ea0a72def8e5'

+ sha256sums+=('2b2dcb5f15dba7f4ce8bc19de260dbc75219a93b107931bb0f6aff705c579fe5'

               'SKIP'

-              '6ebbf18792cb57067f500fd4575c341d4708c5c0a232d676471f87dfa590621b'

+              'a4e3c3869085cb282cb5a0fcb64e816c0415f25d4792a62c4f1d599d3111b23c'

               'afeaeb6e9a6af901b57e25d85014e5c792efe4ff9dabb58663377f487b9d2887'

               '39e3a5e1ad137e21f842a44d7e3bd24050292d2b41fe59b4e7c7dfed52a195dd'

               '9386f1c50506cd20ab6d212335d5e4417faeb2aea371dd46f2d107d171e80b83'

               'c93ce98e1cb64033079343ff1f3037fab6a3bc6d3eb5bc14c5edb70e2d45965d')

  sha256sums_i686=('2f0c81a38c4578f68f5456b618fe84a78974072821488173eb55e0e72287e353'

                   '10c5276eab2e87f400a6ec15d7ffbef3b0407ee888dea36f1128927ca55b9041')

- sha256sums_armv7h=('bc00516032330760444939c516a60c78f868631e1b37f075f0fe71a53737b966'

-                    '2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9')

+ sha256sums_armv7h=('2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9')

  validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases <release@mozilla.com>

  validpgpkeys+=('BFA8008A8265677063B11BF47171986E4B745536') # Andreas Grapentin

  validpgpkeys+=('3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger
@@ -198,21 +196,18 @@ 

        cat >>../mozconfig <<END

  export CC=clang

  export CXX=clang++

- ac_add_options --disable-webrtc

  ac_add_options --disable-elf-hack

  

  # https://bugzilla.redhat.com/show_bug.cgi?id=1641623

  ac_add_options --disable-av1

  ac_add_options --enable-optimize="-g0 -O2"

- mk_add_options MOZ_MAKE_FLAGS='-j2'

+ mk_add_options MOZ_MAKE_FLAGS='-j1'

  END

  

        # mozbuild.configure.options.InvalidOptionError: --disable-eme is not available in this configuration

        # EME is disabled anyway in the built package, but better check if it exists for ARM each new release.

        sed -i 's|ac_add_options --disable-eme||' ../mozconfig

  

-       echo "applying arm.patch"

-       patch -p1 -i ../arm.patch

        echo "applying build-arm-libopus.patch"

        patch -p1 -i ../build-arm-libopus.patch

      ;;

@@ -1,15 +0,0 @@ 

- https://bugzilla.mozilla.org/show_bug.cgi?id=1526653

- 

- diff --git a/js/src/wasm/WasmSignalHandlers.cpp.orig b/js/src/wasm/WasmSignalHandlers.cpp

- index 636537f..0f3461a 100644

- --- a/js/src/wasm/WasmSignalHandlers.cpp.orig

- +++ b/js/src/wasm/WasmSignalHandlers.cpp

- @@ -244,7 +244,7 @@ using mozilla::DebugOnly;

-  // emulation here.

-  

-  #if defined(__linux__) && defined(__arm__)

- -#  define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS

- +//#  define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS

-  #endif

-  

-  #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS

@@ -1,4982 +0,0 @@ 

- From c164bf7f87f9081fee7e1a186dd7a87a9a020b9e Mon Sep 17 00:00:00 2001

- From: Jason Self <j@jxself.org>

- Date: Thu, 4 Jul 2019 15:12:33 -0700

- Subject: [PATCH 1/8] Update carl9170 to latest upstream

- 

- Based on commit 001384147050b9cd9daadb4d3115cc0f13f5b319

- Dated May 5 2019.

- ---

-  WHENCE                               |   4 +-

-  carl9170fw/carlfw/include/wl.h       |   2 +-

-  carl9170fw/carlfw/src/hostif.c       |   8 +-

-  carl9170fw/carlfw/src/printf.c       |   0

-  carl9170fw/carlfw/src/wlantx.c       |   5 +-

-  carl9170fw/config/CMakeLists.txt     |   6 +-

-  carl9170fw/config/conf.c             | 210 ++++++----

-  carl9170fw/config/confdata.c         | 329 +++++++++------

-  carl9170fw/config/expr.c             | 206 +++++++---

-  carl9170fw/config/expr.h             | 105 ++++-

-  carl9170fw/config/kconf_id.c         |  54 ---

-  carl9170fw/config/lkc.h              |  50 +--

-  carl9170fw/config/lkc_proto.h        |  19 +-

-  carl9170fw/config/menu.c             | 259 +++++++++---

-  carl9170fw/config/preprocess.c       | 573 +++++++++++++++++++++++++++

-  carl9170fw/config/symbol.c           | 255 ++++--------

-  carl9170fw/config/util.c             |  86 ++--

-  carl9170fw/config/zconf.l            | 336 ++++++++++------

-  carl9170fw/config/zconf.y            | 403 +++++++++----------

-  carl9170fw/include/linux/ieee80211.h |  24 +-

-  carl9170fw/include/shared/wlan.h     |   2 +-

-  carl9170fw/toolchain/Makefile        |   8 +-

-  carl9170fw/toolchain/SHA256SUMS      |  18 +-

-  23 files changed, 1942 insertions(+), 1020 deletions(-)

-  mode change 100755 => 100644 carl9170fw/carlfw/src/printf.c

-  delete mode 100644 carl9170fw/config/kconf_id.c

-  create mode 100644 carl9170fw/config/preprocess.c

- 

- diff --git a/WHENCE b/WHENCE

- index dd8ec20..2932155 100644

- --- a/WHENCE

- +++ b/WHENCE

- @@ -142,8 +142,8 @@ From https://git.kernel.org/pub/scm/utils/cis-tools/cis-tools.git

-  

-  Driver: carl9170 -- Atheros AR9170 802.11 draft-n USB driver

-  

- -Version: Based on commit 370b7919114a02149088c482c8709cafb9bf7478

- -dated May 2 2018.

- +Version: Based on commit 001384147050b9cd9daadb4d3115cc0f13f5b319

- +dated May 5 2019.

-  

-  Licence: GPLv2 or later.

-  

- diff --git a/carl9170fw/carlfw/include/wl.h b/carl9170fw/carlfw/include/wl.h

- index 8499ca2..5566be4 100644

- --- a/carl9170fw/carlfw/include/wl.h

- +++ b/carl9170fw/carlfw/include/wl.h

- @@ -237,7 +237,7 @@ static inline __inline void unhide_super(struct dma_desc *desc)

-  	desc->totalLen += sizeof(struct carl9170_tx_superdesc);

-  }

-  

- -static inline __inline __hot void read_tsf(uint32_t *tsf)

- +static inline __inline __hot void read_tsf(uint32_t tsf[static 2])

-  {

-  	/*

-  	 * "According to the [hardware] documentation:

- diff --git a/carl9170fw/carlfw/src/hostif.c b/carl9170fw/carlfw/src/hostif.c

- index 73e89c7..06726db 100644

- --- a/carl9170fw/carlfw/src/hostif.c

- +++ b/carl9170fw/carlfw/src/hostif.c

- @@ -213,10 +213,14 @@ void handle_cmd(struct carl9170_rsp *resp)

-  		fw.reboot = 1;

-  		break;

-  

- -	case CARL9170_CMD_READ_TSF:

- +	case CARL9170_CMD_READ_TSF: {

- +		uint32_t tmptsf[2];

- +

- +		read_tsf(tmptsf);

-  		resp->hdr.len = 8;

- -		read_tsf((uint32_t *)resp->tsf.tsf);

- +		memcpy(resp->tsf.tsf, tmptsf, sizeof(tmptsf));

-  		break;

- +		}

-  

-  	case CARL9170_CMD_RX_FILTER:

-  		resp->hdr.len = 0;

- diff --git a/carl9170fw/carlfw/src/printf.c b/carl9170fw/carlfw/src/printf.c

- old mode 100755

- new mode 100644

- diff --git a/carl9170fw/carlfw/src/wlantx.c b/carl9170fw/carlfw/src/wlantx.c

- index 474c040..a8d0952 100644

- --- a/carl9170fw/carlfw/src/wlantx.c

- +++ b/carl9170fw/carlfw/src/wlantx.c

- @@ -260,7 +260,7 @@ static void __wlan_tx(struct dma_desc *desc)

-  

-  	if (unlikely(super->s.fill_in_tsf)) {

-  		struct ieee80211_mgmt *mgmt = (void *) &super->f.data.i3e;

- -		uint32_t *tsf = (uint32_t *) &mgmt->u.probe_resp.timestamp;

- +		uint32_t tmptsf[2];

-  

-  		/*

-  		 * Truth be told: this is a hack.

- @@ -272,7 +272,8 @@ static void __wlan_tx(struct dma_desc *desc)

-  		 * (even, if it's got an accurate atomic clock source).

-  		 */

-  

- -		read_tsf(tsf);

- +		read_tsf(tmptsf);

- +		memcpy(&mgmt->u.probe_resp.timestamp, tmptsf, sizeof(tmptsf));

-  	}

-  

-  	wlan_tx_ampdu(super);

- diff --git a/carl9170fw/config/CMakeLists.txt b/carl9170fw/config/CMakeLists.txt

- index 0a96a82..23e7218 100644

- --- a/carl9170fw/config/CMakeLists.txt

- +++ b/carl9170fw/config/CMakeLists.txt

- @@ -11,13 +11,13 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})

-  

-  file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../include/generated")

-  

- -BISON_TARGET(zconf zconf.y zconf.tab.c COMPILE_FLAGS "-l -b zconf -p zconf -t")

- -FLEX_TARGET(zconfscan zconf.l zconf.lex.c COMPILE_FLAGS "-Pzconf -L")

- +BISON_TARGET(zconf zconf.y zconf.tab.c COMPILE_FLAGS "-l -b zconf -p yy -t")

- +FLEX_TARGET(zconfscan zconf.l zconf.lex.c COMPILE_FLAGS "-Pyy -L")

-  

-  SET(zconf_deps ${FLEX_zconfscan_OUTPUTS})

-  SET_SOURCE_FILES_PROPERTIES(${BISON_zconf_OUTPUTS}

-        PROPERTIES OBJECT_DEPENDS "${zconf_deps}")

-  

- -set(conf_src conf.c ${BISON_zconf_OUTPUTS})

- +set(conf_src conf.c symbol.c confdata.c expr.c preprocess.c ${BISON_zconf_OUTPUTS} ${FLEX_zconfscan_OUTPUTS})

-  

-  add_executable(conf ${conf_src})

- diff --git a/carl9170fw/config/conf.c b/carl9170fw/config/conf.c

- index 6be6143..2949b7d 100644

- --- a/carl9170fw/config/conf.c

- +++ b/carl9170fw/config/conf.c

- @@ -1,9 +1,8 @@

- +// SPDX-License-Identifier: GPL-2.0

-  /*

-   * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>

- - * Released under the terms of the GNU GPL v2.0.

-   */

-  

- -#include <locale.h>

-  #include <ctype.h>

-  #include <limits.h>

-  #include <stdio.h>

- @@ -20,10 +19,10 @@

-  

-  static void conf(struct menu *menu);

-  static void check_conf(struct menu *menu);

- -static void xfgets(char *str, int size, FILE *in);

-  

-  enum input_mode {

-  	oldaskconfig,

- +	syncconfig,

-  	oldconfig,

-  	allnoconfig,

-  	allyesconfig,

- @@ -33,12 +32,13 @@ enum input_mode {

-  	defconfig,

-  	savedefconfig,

-  	listnewconfig,

- -	oldnoconfig,

- -} input_mode = oldaskconfig;

- +	olddefconfig,

- +};

- +static enum input_mode input_mode = oldaskconfig;

-  

-  static int indent = 1;

-  static int tty_stdio;

- -static int valid_stdin = 1;

- +static int sync_kconfig;

-  static int conf_cnt;

-  static char line[PATH_MAX];

-  static struct menu *rootEntry;

- @@ -70,14 +70,14 @@ static void strip(char *str)

-  		*p-- = 0;

-  }

-  

- -static void check_stdin(void)

- +/* Helper function to facilitate fgets() by Jean Sacren. */

- +static void xfgets(char *str, int size, FILE *in)

-  {

- -	if (!valid_stdin) {

- -		printf(_("aborted!\n\n"));

- -		printf(_("Console input/output is redirected. "));

- -		printf(_("Run 'make config' to update configuration.\n\n"));

- -		exit(1);

- -	}

- +	if (!fgets(str, size, in))

- +		fprintf(stderr, "\nError in reading or end of file.\n");

- +

- +	if (!tty_stdio)

- +		printf("%s", str);

-  }

-  

-  static int conf_askvalue(struct symbol *sym, const char *def)

- @@ -85,7 +85,7 @@ 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) "));

- +		printf("(NEW) ");

-  

-  	line[0] = '\n';

-  	line[1] = 0;

- @@ -99,17 +99,15 @@ static int conf_askvalue(struct symbol *sym, const char *def)

-  

-  	switch (input_mode) {

-  	case oldconfig:

- +	case syncconfig:

-  		if (sym_has_value(sym)) {

-  			printf("%s\n", def);

-  			return 0;

-  		}

- -		check_stdin();

-  		/* fall through */

-  	case oldaskconfig:

-  		fflush(stdout);

-  		xfgets(line, sizeof(line), stdin);

- -		if (!tty_stdio)

- -			printf("\n");

-  		return 1;

-  	default:

-  		break;

- @@ -134,7 +132,7 @@ static int conf_string(struct menu *menu)

-  	const char *def;

-  

-  	while (1) {

- -		printf("%*s%s ", indent - 1, "", _(menu->prompt->text));

- +		printf("%*s%s ", indent - 1, "", menu->prompt->text);

-  		printf("(%s) ", sym->name);

-  		def = sym_get_string_value(sym);

-  		if (sym_get_string_value(sym))

- @@ -167,7 +165,7 @@ static int conf_sym(struct menu *menu)

-  	tristate oldval, newval;

-  

-  	while (1) {

- -		printf("%*s%s ", indent - 1, "", _(menu->prompt->text));

- +		printf("%*s%s ", indent - 1, "", menu->prompt->text);

-  		if (sym->name)

-  			printf("(%s) ", sym->name);

-  		putchar('[');

- @@ -189,9 +187,7 @@ static int conf_sym(struct menu *menu)

-  			printf("/m");

-  		if (oldval != yes && sym_tristate_within_range(sym, yes))

-  			printf("/y");

- -		if (menu_has_help(menu))

- -			printf("/?");

- -		printf("] ");

- +		printf("/?] ");

-  		if (!conf_askvalue(sym, sym_get_string_value(sym)))

-  			return 0;

-  		strip(line);

- @@ -254,7 +250,7 @@ static int conf_choice(struct menu *menu)

-  		case no:

-  			return 1;

-  		case mod:

- -			printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu)));

- +			printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));

-  			return 0;

-  		case yes:

-  			break;

- @@ -264,7 +260,7 @@ static int conf_choice(struct menu *menu)

-  	while (1) {

-  		int cnt, def;

-  

- -		printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu)));

- +		printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));

-  		def_sym = sym_get_choice_value(sym);

-  		cnt = def = 0;

-  		line[0] = 0;

- @@ -272,7 +268,7 @@ static int conf_choice(struct menu *menu)

-  			if (!menu_is_visible(child))

-  				continue;

-  			if (!child->sym) {

- -				printf("%*c %s\n", indent, '*', _(menu_get_prompt(child)));

- +				printf("%*c %s\n", indent, '*', menu_get_prompt(child));

-  				continue;

-  			}

-  			cnt++;

- @@ -281,30 +277,27 @@ static int conf_choice(struct menu *menu)

-  				printf("%*c", indent, '>');

-  			} else

-  				printf("%*c", indent, ' ');

- -			printf(" %d. %s", cnt, _(menu_get_prompt(child)));

- +			printf(" %d. %s", cnt, menu_get_prompt(child));

-  			if (child->sym->name)

-  				printf(" (%s)", child->sym->name);

-  			if (!sym_has_value(child->sym))

- -				printf(_(" (NEW)"));

- +				printf(" (NEW)");

-  			printf("\n");

-  		}

- -		printf(_("%*schoice"), indent - 1, "");

- +		printf("%*schoice", indent - 1, "");

-  		if (cnt == 1) {

-  			printf("[1]: 1\n");

-  			goto conf_childs;

-  		}

- -		printf("[1-%d", cnt);

- -		if (menu_has_help(menu))

- -			printf("?");

- -		printf("]: ");

- +		printf("[1-%d?]: ", cnt);

-  		switch (input_mode) {

-  		case oldconfig:

- +		case syncconfig:

-  			if (!is_new) {

-  				cnt = def;

-  				printf("%d\n", cnt);

-  				break;

-  			}

- -			check_stdin();

-  			/* fall through */

-  		case oldaskconfig:

-  			fflush(stdout);

- @@ -364,9 +357,11 @@ static void conf(struct menu *menu)

-  

-  		switch (prop->type) {

-  		case P_MENU:

- -			if ((input_mode == listnewconfig ||

- -			     input_mode == oldnoconfig) &&

- -			    rootEntry != menu) {

- +			/*

- +			 * Except in oldaskconfig mode, we show only menus that

- +			 * contain new symbols.

- +			 */

- +			if (input_mode != oldaskconfig && rootEntry != menu) {

-  				check_conf(menu);

-  				return;

-  			}

- @@ -376,7 +371,7 @@ static void conf(struct menu *menu)

-  			if (prompt)

-  				printf("%*c\n%*c %s\n%*c\n",

-  					indent, '*',

- -					indent, '*', _(prompt),

- +					indent, '*', prompt,

-  					indent, '*');

-  		default:

-  			;

- @@ -426,12 +421,22 @@ static void check_conf(struct menu *menu)

-  		if (sym_is_changable(sym) ||

-  		    (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {

-  			if (input_mode == listnewconfig) {

- -				if (sym->name && !sym_is_choice_value(sym)) {

- -					printf("%s%s\n", CONFIG_, sym->name);

- +				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 != oldnoconfig) {

- +			} else {

-  				if (!conf_cnt++)

- -					printf(_("*\n* Restart config...\n*\n"));

- +					printf("*\n* Restart config...\n*\n");

-  				rootEntry = menu_get_parent_menu(menu);

-  				conf(rootEntry);

-  			}

- @@ -443,8 +448,9 @@ static void check_conf(struct menu *menu)

-  }

-  

-  static struct option long_opts[] = {

- -	{"askconfig",       no_argument,       NULL, oldaskconfig},

- -	{"config",          no_argument,       NULL, oldconfig},

- +	{"oldaskconfig",    no_argument,       NULL, oldaskconfig},

- +	{"oldconfig",       no_argument,       NULL, oldconfig},

- +	{"syncconfig",      no_argument,       NULL, syncconfig},

-  	{"defconfig",       optional_argument, NULL, defconfig},

-  	{"savedefconfig",   required_argument, NULL, savedefconfig},

-  	{"allnoconfig",     no_argument,       NULL, allnoconfig},

- @@ -453,7 +459,7 @@ static struct option long_opts[] = {

-  	{"alldefconfig",    no_argument,       NULL, alldefconfig},

-  	{"randconfig",      no_argument,       NULL, randconfig},

-  	{"listnewconfig",   no_argument,       NULL, listnewconfig},

- -	{"noconfig",        no_argument,       NULL, oldnoconfig},

- +	{"olddefconfig",    no_argument,       NULL, olddefconfig},

-  	{NULL, 0, NULL, 0}

-  };

-  

- @@ -463,10 +469,11 @@ static void conf_usage(const char *progname)

-  	printf("Usage: %s [-s] [option] <kconfig-file>\n", progname);

-  	printf("[option] is _one_ of the following:\n");

-  	printf("  --listnewconfig         List new options\n");

- -	printf("  --askconfig             Start a new configuration using a line-oriented program\n");

- -	printf("  --config                Update a configuration using a provided .config as base\n");

- -	printf("  --silentconfig          Same as config, but quietly, additionally update deps\n");

- -	printf("  --noconfig              Same as silentconfig but set new symbols to no\n");

- +	printf("  --oldaskconfig          Start a new configuration using a line-oriented program\n");

- +	printf("  --oldconfig             Update a configuration using a provided .config as base\n");

- +	printf("  --syncconfig            Similar to oldconfig but generates configuration in\n"

- +	       "                          include/{generated/,config/}\n");

- +	printf("  --olddefconfig          Same as oldconfig but sets new symbols to their default value\n");

-  	printf("  --defconfig <file>      New config with default defined in <file>\n");

-  	printf("  --savedefconfig <file>  Save the minimal current configuration to <file>\n");

-  	printf("  --allnoconfig           New config where all options are answered with no\n");

- @@ -482,12 +489,9 @@ int main(int ac, char **av)

-  	int opt;

-  	const char *name, *defconfig_file = NULL /* gcc uninit */;

-  	struct stat tmpstat;

- +	int no_conf_write = 0;

-  

- -	setlocale(LC_ALL, "");

- -	bindtextdomain(PACKAGE, LOCALEDIR);

- -	textdomain(PACKAGE);

- -

- -	tty_stdio = isatty(0) && isatty(1) && isatty(2);

- +	tty_stdio = isatty(0) && isatty(1);

-  

-  	while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {

-  		if (opt == 's') {

- @@ -496,6 +500,14 @@ int main(int ac, char **av)

-  		}

-  		input_mode = (enum input_mode)opt;

-  		switch (opt) {

- +		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;

- @@ -532,7 +544,7 @@ int main(int ac, char **av)

-  		case allmodconfig:

-  		case alldefconfig:

-  		case listnewconfig:

- -		case oldnoconfig:

- +		case olddefconfig:

-  			break;

-  		case '?':

-  			conf_usage(progname);

- @@ -541,30 +553,45 @@ int main(int ac, char **av)

-  		}

-  	}

-  	if (ac == optind) {

- -		printf(_("%s: Kconfig file missing\n"), av[0]);

- +		fprintf(stderr, "%s: Kconfig file missing\n", av[0]);

-  		conf_usage(progname);

-  		exit(1);

-  	}

-  	name = av[optind];

-  	conf_parse(name);

-  	//zconfdump(stdout);

- +	if (sync_kconfig) {

- +		name = conf_get_configname();

- +		if (stat(name, &tmpstat)) {

- +			fprintf(stderr, "***\n"

- +				"*** Configuration file \"%s\" not found!\n"

- +				"***\n"

- +				"*** Please run some configurator (e.g. \"make oldconfig\" or\n"

- +				"*** \"make menuconfig\" or \"make xconfig\").\n"

- +				"***\n", name);

- +			exit(1);

- +		}

- +	}

-  

-  	switch (input_mode) {

-  	case defconfig:

-  		if (!defconfig_file)

-  			defconfig_file = conf_get_default_confname();

-  		if (conf_read(defconfig_file)) {

- -			printf(_("***\n"

- -				"*** Can't find default configuration \"%s\"!\n"

- -				"***\n"), defconfig_file);

- +			fprintf(stderr,

- +				"***\n"

- +				  "*** Can't find default configuration \"%s\"!\n"

- +				  "***\n",

- +				defconfig_file);

-  			exit(1);

-  		}

-  		break;

-  	case savedefconfig:

- +	case syncconfig:

-  	case oldaskconfig:

-  	case oldconfig:

-  	case listnewconfig:

- -	case oldnoconfig:

- +	case olddefconfig:

-  		conf_read(NULL);

-  		break;

-  	case allnoconfig:

- @@ -578,7 +605,7 @@ int main(int ac, char **av)

-  		if ((strcmp(name, "") != 0) && (strcmp(name, "1") != 0)) {

-  			if (conf_read_simple(name, S_DEF_USER)) {

-  				fprintf(stderr,

- -					_("*** Can't read seed configuration \"%s\"!\n"),

- +					"*** Can't read seed configuration \"%s\"!\n",

-  					name);

-  				exit(1);

-  			}

- @@ -595,7 +622,7 @@ int main(int ac, char **av)

-  		if (conf_read_simple(name, S_DEF_USER) &&

-  		    conf_read_simple("all.config", S_DEF_USER)) {

-  			fprintf(stderr,

- -				_("*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n"),

- +				"*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n",

-  				name);

-  			exit(1);

-  		}

- @@ -604,7 +631,17 @@ int main(int ac, char **av)

-  		break;

-  	}

-  

- -	valid_stdin = tty_stdio;

- +	if (sync_kconfig) {

- +		name = getenv("KCONFIG_NOSILENTUPDATE");

- +		if (name && *name) {

- +			if (conf_get_changed()) {

- +				fprintf(stderr,

- +					"\n*** The configuration requires explicit update.\n\n");

- +				return 1;

- +			}

- +			no_conf_write = 1;

- +		}

- +	}

-  

-  	switch (input_mode) {

-  	case allnoconfig:

- @@ -635,44 +672,51 @@ int main(int ac, char **av)

-  		/* fall through */

-  	case oldconfig:

-  	case listnewconfig:

- -	case oldnoconfig:

- +	case syncconfig:

-  		/* Update until a loop caused no more changes */

-  		do {

-  			conf_cnt = 0;

-  			check_conf(&rootmenu);

- -		} while (conf_cnt &&

- -			 (input_mode != listnewconfig &&

- -			  input_mode != oldnoconfig));

- +		} while (conf_cnt);

- +		break;

- +	case olddefconfig:

- +	default:

-  		break;

-  	}

-  

-  	if (input_mode == savedefconfig) {

-  		if (conf_write_defconfig(defconfig_file)) {

- -			fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"),

- +			fprintf(stderr, "n*** Error while saving defconfig to: %s\n\n",

-  				defconfig_file);

-  			return 1;

-  		}

-  	} else if (input_mode != listnewconfig) {

- -		/*

- -		 * build so we shall update autoconf.

- -		 */

- -		if (conf_write(NULL)) {

- -			fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));

- +		if (!no_conf_write && conf_write(NULL)) {

- +			fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");

-  			exit(1);

-  		}

- -		if (conf_write_autoconf()) {

- -			fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));

- +

- +		/*

- +		 * Create auto.conf if it does not exist.

- +		 * This prevents GNU Make 4.1 or older from emitting

- +		 * "include/generated/auto.conf: No such file or directory"

- +		 * in the top-level Makefile

- +		 *

- +		 * syncconfig always creates or updates auto.conf because it is

- +		 * used during the build.

- +		 */

- +

- +		/*

- +		 * In our cmake case, we always want to update the autogenerated

- +		 * files.

- +		 */

- +		sync_kconfig = 1;

- +

- +		if (conf_write_autoconf(sync_kconfig) && sync_kconfig) {

- +			fprintf(stderr,

- +				"\n*** Error during sync of the configuration.\n\n");

-  			return 1;

-  		}

-  	}

-  	return 0;

-  }

- -

- -/*

- - * Helper function to facilitate fgets() by Jean Sacren.

- - */

- -void xfgets(char *str, int size, FILE *in)

- -{

- -	if (fgets(str, size, in) == NULL)

- -		fprintf(stderr, "\nError in reading or end of file.\n");

- -}

- diff --git a/carl9170fw/config/confdata.c b/carl9170fw/config/confdata.c

- index e606f06..d67695d 100644

- --- a/carl9170fw/config/confdata.c

- +++ b/carl9170fw/config/confdata.c

- @@ -1,12 +1,13 @@

- +// SPDX-License-Identifier: GPL-2.0

-  /*

-   * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>

- - * Released under the terms of the GNU GPL v2.0.

-   */

-  

-  #include <sys/stat.h>

-  #include <ctype.h>

-  #include <errno.h>

-  #include <fcntl.h>

- +#include <limits.h>

-  #include <stdarg.h>

-  #include <stdio.h>

-  #include <stdlib.h>

- @@ -16,6 +17,105 @@

-  

-  #include "lkc.h"

-  

- +/* return true if 'path' exists, false otherwise */

- +static bool is_present(const char *path)

- +{

- +	struct stat st;

- +

- +	return !stat(path, &st);

- +}

- +

- +/* return true if 'path' exists and it is a directory, false otherwise */

- +static bool is_dir(const char *path)

- +{

- +	struct stat st;

- +

- +	if (stat(path, &st))

- +		return 0;

- +

- +	return S_ISDIR(st.st_mode);

- +}

- +

- +/*

- + * Create the parent directory of the given path.

- + *

- + * For example, if 'include/config/auto.conf' is given, create 'include/config'.

- + */

- +static int make_parent_dir(const char *path)

- +{

- +	char tmp[PATH_MAX + 1];

- +	char *p;

- +

- +	strncpy(tmp, path, sizeof(tmp));

- +	tmp[sizeof(tmp) - 1] = 0;

- +

- +	/* Remove the base name. Just return if nothing is left */

- +	p = strrchr(tmp, '/');

- +	if (!p)

- +		return 0;

- +	*(p + 1) = 0;

- +

- +	/* Just in case it is an absolute path */

- +	p = tmp;

- +	while (*p == '/')

- +		p++;

- +

- +	while ((p = strchr(p, '/'))) {

- +		*p = 0;

- +

- +		/* skip if the directory exists */

- +		if (!is_dir(tmp) && mkdir(tmp, 0755))

- +			return -1;

- +

- +		*p = '/';

- +		while (*p == '/')

- +			p++;

- +	}

- +

- +	return 0;

- +}

- +

- +static char depfile_path[PATH_MAX];

- +static size_t depfile_prefix_len;

- +

- +/* touch depfile for symbol 'name' */

- +static int conf_touch_dep(const char *name)

- +{

- +	int fd, ret;

- +	const char *s;

- +	char *d, c;

- +

- +	/* check overflow: prefix + name + ".h" + '\0' must fit in buffer. */

- +	if (depfile_prefix_len + strlen(name) + 3 > sizeof(depfile_path))

- +		return -1;

- +

- +	d = depfile_path + depfile_prefix_len;

- +	s = name;

- +

- +	while ((c = *s++))

- +		*d++ = (c == '_') ? '/' : tolower(c);

- +	strcpy(d, ".h");

- +

- +	/* Assume directory path already exists. */

- +	fd = open(depfile_path, O_WRONLY | O_CREAT | O_TRUNC, 0644);

- +	if (fd == -1) {

- +		if (errno != ENOENT)

- +			return -1;

- +

- +		ret = make_parent_dir(depfile_path);

- +		if (ret)

- +			return ret;

- +

- +		/* Try it again. */

- +		fd = open(depfile_path, O_WRONLY | O_CREAT | O_TRUNC, 0644);

- +		if (fd == -1)

- +			return -1;

- +	}

- +	close(fd);

- +

- +	return 0;

- +}

- +

-  struct conf_printer {

-  	void (*print_symbol)(FILE *, struct symbol *, const char *, void *);

-  	void (*print_comment)(FILE *, const char *, void *);

- @@ -28,7 +128,7 @@ static void conf_message(const char *fmt, ...)

-  	__attribute__ ((format (printf, 1, 2)));

-  

-  static const char *conf_filename;

- -static int conf_lineno, conf_warnings, conf_unsaved;

- +static int conf_lineno, conf_warnings;

-  

-  const char conf_defname[] = "include/generated/defconfig";

-  

- @@ -43,16 +143,16 @@ static void conf_warning(const char *fmt, ...)

-  	conf_warnings++;

-  }

-  

- -static void conf_default_message_callback(const char *fmt, va_list ap)

- +static void conf_default_message_callback(const char *s)

-  {

-  	printf("#\n# ");

- -	vprintf(fmt, ap);

- +	printf("%s", s);

-  	printf("\n#\n");

-  }

-  

- -static void (*conf_message_callback) (const char *fmt, va_list ap) =

- +static void (*conf_message_callback)(const char *s) =

-  	conf_default_message_callback;

- -void conf_set_message_callback(void (*fn) (const char *fmt, va_list ap))

- +void conf_set_message_callback(void (*fn)(const char *s))

-  {

-  	conf_message_callback = fn;

-  }

- @@ -60,10 +160,15 @@ void conf_set_message_callback(void (*fn) (const char *fmt, va_list ap))

-  static void conf_message(const char *fmt, ...)

-  {

-  	va_list ap;

- +	char buf[4096];

- +

- +	if (!conf_message_callback)

- +		return;

-  

-  	va_start(ap, fmt);

- -	if (conf_message_callback)

- -		conf_message_callback(fmt, ap);

- +

- +	vsnprintf(buf, sizeof(buf), fmt, ap);

- +	conf_message_callback(buf);

-  	va_end(ap);

-  }

-  

- @@ -81,43 +186,16 @@ const char *conf_get_autoconfig_name(void)

-  	return name ? name : "include/generated/auto.conf";

-  }

-  

- -static char *conf_expand_value(const char *in)

- -{

- -	struct symbol *sym;

- -	const char *src;

- -	static char res_value[SYMBOL_MAXLENGTH];

- -	char *dst, name[SYMBOL_MAXLENGTH];

- -

- -	res_value[0] = 0;

- -	dst = name;

- -	while ((src = strchr(in, '$'))) {

- -		strncat(res_value, in, src - in);

- -		src++;

- -		dst = name;

- -		while (isalnum(*src) || *src == '_')

- -			*dst++ = *src++;

- -		*dst = 0;

- -		sym = sym_lookup(name, 0);

- -		sym_calc_value(sym);

- -		strcat(res_value, sym_get_string_value(sym));

- -		in = src;

- -	}

- -	strcat(res_value, in);

- -

- -	return res_value;

- -}

- -

-  char *conf_get_default_confname(void)

-  {

- -	struct stat buf;

-  	static char fullname[PATH_MAX+1];

-  	char *env, *name;

-  

- -	name = conf_expand_value(conf_defname);

- +	name = expand_string(conf_defname);

-  	env = getenv(SRCTREE);

-  	if (env) {

-  		sprintf(fullname, "%s/%s", env, name);

- -		if (!stat(fullname, &buf))

- +		if (is_present(fullname))

-  			return fullname;

-  	}

-  	return name;

- @@ -150,14 +228,6 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)

-  			conf_warning("symbol value '%s' invalid for %s",

-  				     p, sym->name);

-  		return 1;

- -	case S_OTHER:

- -		if (*p != '"') {

- -			for (p2 = p; *p2 && !isspace(*p2); p2++)

- -				;

- -			sym->type = S_STRING;

- -			goto done;

- -		}

- -		/* fall through */

-  	case S_STRING:

-  		if (*p++ != '"')

-  			break;

- @@ -176,9 +246,8 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)

-  		/* fall through */

-  	case S_INT:

-  	case S_HEX:

- -	done:

-  		if (sym_string_valid(sym, p)) {

- -			sym->def[def].val = strdup(p);

- +			sym->def[def].val = xstrdup(p);

-  			sym->flags |= def_flags;

-  		} else {

-  			if (def != S_DEF_AUTO)

- @@ -201,7 +270,7 @@ static int add_byte(int c, char **lineptr, size_t slen, size_t *n)

-  	if (new_size > *n) {

-  		new_size += LINE_GROWTH - 1;

-  		new_size *= 2;

- -		nline = realloc(*lineptr, new_size);

- +		nline = xrealloc(*lineptr, new_size);

-  		if (!nline)

-  			return -1;

-  

- @@ -274,10 +343,11 @@ int conf_read_simple(const char *name, int def)

-  			if (expr_calc_value(prop->visible.expr) == no ||

-  			    prop->expr->type != E_SYMBOL)

-  				continue;

- -			name = conf_expand_value(prop->expr->left.sym->name);

- +			sym_calc_value(prop->expr->left.sym);

- +			name = sym_get_string_value(prop->expr->left.sym);

-  			in = zconf_fopen(name);

-  			if (in) {

- -				conf_message(_("using defaults found in %s"),

- +				conf_message("using defaults found in %s",

-  					 name);

-  				goto load;

-  			}

- @@ -290,7 +360,6 @@ load:

-  	conf_filename = name;

-  	conf_lineno = 0;

-  	conf_warnings = 0;

- -	conf_unsaved = 0;

-  

-  	def_flags = SYMBOL_DEF << def;

-  	for_all_symbols(i, sym) {

- @@ -327,7 +396,7 @@ load:

-  				sym = sym_find(line + 2 + strlen(CONFIG_));

-  				if (!sym) {

-  					sym_add_change_count(1);

- -					goto setsym;

- +					continue;

-  				}

-  			} else {

-  				sym = sym_lookup(line + 2 + strlen(CONFIG_), 0);

- @@ -357,17 +426,22 @@ load:

-  				if (*p2 == '\r')

-  					*p2 = 0;

-  			}

- -			if (def == S_DEF_USER) {

- -				sym = sym_find(line + strlen(CONFIG_));

- -				if (!sym) {

- +

- +			sym = sym_find(line + strlen(CONFIG_));

- +			if (!sym) {

- +				if (def == S_DEF_AUTO)

- +					/*

- +					 * 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.

- +					 */

- +					conf_touch_dep(line + strlen(CONFIG_));

- +				else

-  					sym_add_change_count(1);

- -					goto setsym;

- -				}

- -			} else {

- -				sym = sym_lookup(line + strlen(CONFIG_), 0);

- -				if (sym->type == S_UNKNOWN)

- -					sym->type = S_OTHER;

- +				continue;

-  			}

- +

-  			if (sym->flags & def_flags) {

-  				conf_warning("override: reassigning to symbol %s", sym->name);

-  			}

- @@ -380,7 +454,7 @@ load:

-  

-  			continue;

-  		}

- -setsym:

- +

-  		if (sym && sym_is_choice_value(sym)) {

-  			struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));

-  			switch (sym->def[def].tri) {

- @@ -409,6 +483,7 @@ setsym:

-  int conf_read(const char *name)

-  {

-  	struct symbol *sym;

- +	int conf_unsaved = 0;

-  	int i;

-  

-  	sym_set_change_count(0);

- @@ -422,7 +497,7 @@ int conf_read(const char *name)

-  

-  	for_all_symbols(i, sym) {

-  		sym_calc_value(sym);

- -		if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO))

- +		if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE))

-  			continue;

-  		if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) {

-  			/* check that calculated value agrees with saved value */

- @@ -678,7 +753,6 @@ static void conf_write_symbol(FILE *fp, struct symbol *sym,

-  	const char *str;

-  

-  	switch (sym->type) {

- -	case S_OTHER:

-  	case S_UNKNOWN:

-  		break;

-  	case S_STRING:

- @@ -791,15 +865,14 @@ int conf_write(const char *name)

-  	struct menu *menu;

-  	const char *basename;

-  	const char *str;

- -	char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];

- +	char dirname[PATH_MAX+1], tmpname[PATH_MAX+22], newname[PATH_MAX+8];

-  	char *env;

-  

-  	dirname[0] = 0;

-  	if (name && name[0]) {

- -		struct stat st;

-  		char *slash;

-  

- -		if (!stat(name, &st) && S_ISDIR(st.st_mode)) {

- +		if (is_dir(name)) {

-  			strcpy(dirname, name);

-  			strcat(dirname, "/");

-  			basename = conf_get_configname();

- @@ -877,33 +950,61 @@ next:

-  			return 1;

-  	}

-  

- -	conf_message(_("configuration written to %s"), newname);

- +	conf_message("configuration written to %s", newname);

-  

-  	sym_set_change_count(0);

-  

-  	return 0;

-  }

-  

- -static int conf_split_config(void)

- +/* write a dependency file as used by kbuild to track dependencies */

- +static int conf_write_dep(const char *name)

- +{

- +	struct file *file;

- +	FILE *out;

- +

- +	if (!name)

- +		name = ".kconfig.d";

- +	out = fopen("..config.tmp", "w");

- +	if (!out)

- +		return 1;

- +	fprintf(out, "deps_config := \\\n");

- +	for (file = file_list; file; file = file->next) {

- +		if (file->next)

- +			fprintf(out, "\t%s \\\n", file->name);

- +		else

- +			fprintf(out, "\t%s\n", file->name);

- +	}

- +	fprintf(out, "\n%s: \\\n"

- +		     "\t$(deps_config)\n\n", conf_get_autoconfig_name());

- +

- +	env_write_dep(out, conf_get_autoconfig_name());

- +

- +	fprintf(out, "\n$(deps_config): ;\n");

- +	fclose(out);

- +

- +	if (make_parent_dir(name))

- +		return 1;

- +	rename("..config.tmp", name);

- +	return 0;

- +}

- +

- +static int conf_touch_deps(void)

-  {

-  	const char *name;

- -	char path[PATH_MAX+1];

- -	char *s, *d, c;

-  	struct symbol *sym;

- -	struct stat sb;

- -	int res, i, fd;

- +	int res, i;

- +

- +	strcpy(depfile_path, "include/generated/");

- +	depfile_prefix_len = strlen(depfile_path);

-  

-  	name = conf_get_autoconfig_name();

-  	conf_read_simple(name, S_DEF_AUTO);

-  	sym_calc_value(modules_sym);

-  

- -	if (chdir("include/generated"))

- -		return 1;

- -

- -	res = 0;

-  	for_all_symbols(i, sym) {

-  		sym_calc_value(sym);

- -		if ((sym->flags & SYMBOL_AUTO) || !sym->name)

- +		if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)

-  			continue;

-  		if (sym->flags & SYMBOL_WRITE) {

-  			if (sym->flags & SYMBOL_DEF_AUTO) {

- @@ -952,63 +1053,30 @@ static int conf_split_config(void)

-  		 *	different from 'no').

-  		 */

-  

- -		/* Replace all '_' and append ".h" */

- -		s = sym->name;

- -		d = path;

- -		while ((c = *s++)) {

- -			c = tolower(c);

- -			*d++ = (c == '_') ? '/' : c;

- -		}

- -		strcpy(d, ".h");

- -

- -		/* Assume directory path already exists. */

- -		fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);

- -		if (fd == -1) {

- -			if (errno != ENOENT) {

- -				res = 1;

- -				break;

- -			}

- -			/*

- -			 * Create directory components,

- -			 * unless they exist already.

- -			 */

- -			d = path;

- -			while ((d = strchr(d, '/'))) {

- -				*d = 0;

- -				if (stat(path, &sb) && mkdir(path, 0755)) {

- -					res = 1;

- -					goto out;

- -				}

- -				*d++ = '/';

- -			}

- -			/* Try it again. */

- -			fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);

- -			if (fd == -1) {

- -				res = 1;

- -				break;

- -			}

- -		}

- -		close(fd);

- +		res = conf_touch_dep(sym->name);

- +		if (res)

- +			return res;

-  	}

- -out:

- -	if (chdir("../.."))

- -		return 1;

-  

- -	return res;

- +	return 0;

-  }

-  

- -int conf_write_autoconf(void)

- +int conf_write_autoconf(int overwrite)

-  {

-  	struct symbol *sym;

-  	const char *name;

- +	const char *autoconf_name = conf_get_autoconfig_name();

-  	FILE *out, *tristate, *out_h, *out_c;

-  	int i;

-  

- +	if (!overwrite && is_present(autoconf_name))

- +		return 0;

- +

-  	sym_clear_all_valid();

-  

- -	file_write_dep("include/generated/auto.conf.cmd");

- +	conf_write_dep("include/generated/auto.conf.cmd");

-  

- -	if (conf_split_config())

- +	if (conf_touch_deps())

-  		return 1;

-  

-  	out = fopen(".tmpconfig", "w");

- @@ -1065,24 +1133,35 @@ int conf_write_autoconf(void)

-  	name = getenv("KCONFIG_AUTOHEADER");

-  	if (!name)

-  		name = "include/generated/autoconf.h";

- +	if (make_parent_dir(name))

- +		return 1;

-  	if (rename(".tmpconfig.h", name))

-  		return 1;

- +

-  	name = getenv("KCONFIG_TRISTATE");

-  	if (!name)

-  		name = "include/generated/tristate.conf";

- +	if (make_parent_dir(name))

- +		return 1;

-  	if (rename(".tmpconfig_tristate", name))

-  		return 1;

- +

- +	if (make_parent_dir(autoconf_name))

- +		return 1;

- +

-  	name = getenv("KCONFIG_CMAKE");

-  	if (!name)

-  		name = "config.cmake";

- +	if (make_parent_dir(name))

- +		return 1;

-  	if (rename(".tmpconfig.cmake", name))

-  		return 1;

- -	name = conf_get_autoconfig_name();

- +

-  	/*

-  	 * This must be the last step, kbuild has a dependency on auto.conf

-  	 * and this marks the successful completion of the previous steps.

-  	 */

- -	if (rename(".tmpconfig", name))

- +	if (rename(".tmpconfig", autoconf_name))

-  		return 1;

-  

-  	return 0;

- @@ -1186,7 +1265,7 @@ void set_all_choice_values(struct symbol *csym)

-  bool conf_set_all_new_symbols(enum conf_def_mode mode)

-  {

-  	struct symbol *sym, *csym;

- -	int i, cnt, pby, pty, ptm;	/* pby: probability of boolean  = y

- +	int i, cnt, pby, pty, ptm;	/* pby: probability of bool     = y

-  					 * pty: probability of tristate = y

-  					 * ptm: probability of tristate = m

-  					 */

- diff --git a/carl9170fw/config/expr.c b/carl9170fw/config/expr.c

- index 8cee597..77ffff3 100644

- --- a/carl9170fw/config/expr.c

- +++ b/carl9170fw/config/expr.c

- @@ -1,8 +1,10 @@

- +// SPDX-License-Identifier: GPL-2.0

-  /*

-   * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>

- - * Released under the terms of the GNU GPL v2.0.

-   */

-  

- +#include <ctype.h>

- +#include <errno.h>

-  #include <stdio.h>

-  #include <stdlib.h>

-  #include <string.h>

- @@ -94,7 +96,7 @@ struct expr *expr_copy(const struct expr *org)

-  		e->right.expr = expr_copy(org->right.expr);

-  		break;

-  	default:

- -		printf("can't copy type %d\n", e->type);

- +		fprintf(stderr, "can't copy type %d\n", e->type);

-  		free(e);

-  		e = NULL;

-  		break;

- @@ -113,7 +115,7 @@ void expr_free(struct expr *e)

-  		break;

-  	case E_NOT:

-  		expr_free(e->left.expr);

- -		return;

- +		break;

-  	case E_EQUAL:

-  	case E_GEQ:

-  	case E_GTH:

- @@ -127,7 +129,7 @@ void expr_free(struct expr *e)

-  		expr_free(e->right.expr);

-  		break;

-  	default:

- -		printf("how to free type %d?\n", e->type);

- +		fprintf(stderr, "how to free type %d?\n", e->type);

-  		break;

-  	}

-  	free(e);

- @@ -138,8 +140,18 @@ static int trans_count;

-  #define e1 (*ep1)

-  #define e2 (*ep2)

-  

- +/*

- + * expr_eliminate_eq() helper.

- + *

- + * Walks the two expression trees given in 'ep1' and 'ep2'. Any node that does