From 22db207e5c13ad254ff488b8be2601792aae8586 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 4 Mar 2014 21:14:25 +0100 Subject: disable package collections for bulk builds --- mk/build.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mk/build.mk b/mk/build.mk index 8efd7becc..f4d4a04f9 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -37,6 +37,8 @@ DEFCONFIG= ADK_DEBUG=n \ ADK_PACKAGE_OPENAFS=n \ ADK_PACKAGE_OPENJDK7=n \ ADK_PKG_XORG=n \ + ADK_PKG_CONSOLE=n \ + ADK_PKG_TEST=n \ ADK_PKG_MPDBOX=n \ ADK_PKG_DEVELOPMENT=n \ ADK_TOOLCHAIN_GCC_USE_SSP=n \ -- cgit v1.2.3 From 956b9e517b14cb6d86569f486ec7c9bdfcc8dffc Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 12 Mar 2014 15:13:17 +0100 Subject: hudson says: you forgot the patches --- package/squid/Makefile | 2 +- .../squid/patches/patch-acinclude_lib-checks_m4 | 72 ++++++++++++++++++++++ package/squid/patches/patch-src_Makefile_am | 11 ++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 package/squid/patches/patch-acinclude_lib-checks_m4 create mode 100644 package/squid/patches/patch-src_Makefile_am diff --git a/package/squid/Makefile b/package/squid/Makefile index 890e64328..f8e6aaf72 100644 --- a/package/squid/Makefile +++ b/package/squid/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= squid PKG_VERSION:= 3.4.4 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= b36ab3696485a86b43d9194ac9b6b7fe PKG_DESCR:= squid web and cache proxy PKG_SECTION:= proxy diff --git a/package/squid/patches/patch-acinclude_lib-checks_m4 b/package/squid/patches/patch-acinclude_lib-checks_m4 new file mode 100644 index 000000000..b44b4eb27 --- /dev/null +++ b/package/squid/patches/patch-acinclude_lib-checks_m4 @@ -0,0 +1,72 @@ +--- squid-3.4.4.orig/acinclude/lib-checks.m4 2014-03-09 10:40:56.000000000 +0100 ++++ squid-3.4.4/acinclude/lib-checks.m4 2014-03-11 19:44:28.088928982 +0100 +@@ -95,69 +95,6 @@ AC_DEFUN([SQUID_CHECK_LIBIPHLPAPI],[ + SQUID_STATE_ROLLBACK(iphlpapi) + ]) + +-dnl Checks whether the OpenSSL SSL_get_certificate crashes squid and if a +-dnl workaround can be used instead of using the SSL_get_certificate +-AC_DEFUN([SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS],[ +- AH_TEMPLATE(SQUID_SSLGETCERTIFICATE_BUGGY, "Define to 1 if the SSL_get_certificate crashes squid") +- AH_TEMPLATE(SQUID_USE_SSLGETCERTIFICATE_HACK, "Define to 1 to use squid workaround for SSL_get_certificate") +- SQUID_STATE_SAVE(check_SSL_get_certificate) +- LIBS="$SSLLIB $LIBS" +- if test "x$SSLLIBDIR" != "x"; then +- LIBS="$LIBS -Wl,-rpath -Wl,$SSLLIBDIR" +- fi +- +- AC_MSG_CHECKING(whether the SSL_get_certificate is buggy) +- AC_RUN_IFELSE([ +- AC_LANG_PROGRAM( +- [ +- #include +- #include +- ], +- [ +- SSLeay_add_ssl_algorithms(); +- SSL_CTX *sslContext = SSL_CTX_new(SSLv3_method()); +- SSL *ssl = SSL_new(sslContext); +- X509* cert = SSL_get_certificate(ssl); +- return 0; +- ]) +- ], +- [ +- AC_MSG_RESULT([no]) +- ], +- [ +- AC_DEFINE(SQUID_SSLGETCERTIFICATE_BUGGY, 1) +- AC_MSG_RESULT([yes]) +- ], +- []) +- +- AC_MSG_CHECKING(whether the workaround for SSL_get_certificate works) +- AC_RUN_IFELSE([ +- AC_LANG_PROGRAM( +- [ +- #include +- #include +- ], +- [ +- SSLeay_add_ssl_algorithms(); +- SSL_CTX *sslContext = SSL_CTX_new(SSLv3_method()); +- X509 ***pCert = (X509 ***)sslContext->cert; +- X509 *sslCtxCert = pCert && *pCert ? **pCert : (X509 *)0x1; +- if (sslCtxCert != NULL) +- return 1; +- return 0; +- ]) +- ], +- [ +- AC_MSG_RESULT([yes]) +- AC_DEFINE(SQUID_USE_SSLGETCERTIFICATE_HACK, 1) +- ], +- [ +- AC_MSG_RESULT([no]) +- ], +-[]) +- +-SQUID_STATE_ROLLBACK(check_SSL_get_certificate) +-]) + + dnl Checks whether the SSL_CTX_new and similar functions require + dnl a const 'SSL_METHOD *' argument diff --git a/package/squid/patches/patch-src_Makefile_am b/package/squid/patches/patch-src_Makefile_am new file mode 100644 index 000000000..9aec4eca3 --- /dev/null +++ b/package/squid/patches/patch-src_Makefile_am @@ -0,0 +1,11 @@ +--- squid-3.4.4.orig/src/Makefile.am 2014-03-09 10:40:56.000000000 +0100 ++++ squid-3.4.4/src/Makefile.am 2014-03-12 09:46:23.001434141 +0100 +@@ -981,7 +981,7 @@ cache_cf.o: cf_parser.cci + + # cf_gen builds the configuration files. + cf_gen$(EXEEXT): $(cf_gen_SOURCES) $(cf_gen_DEPENDENCIES) cf_gen_defines.cci +- $(HOSTCXX) -o $@ $(srcdir)/cf_gen.cc -I$(srcdir) -I$(top_builddir)/include/ -I$(top_builddir)/src ++ $(CXX_FOR_BUILD) -o $@ $(srcdir)/cf_gen.cc -I$(srcdir) -I$(top_builddir)/include/ -I$(top_builddir)/src + + # squid.conf.default is built by cf_gen when making cf_parser.cci + squid.conf.default squid.conf.documented: cf_parser.cci -- cgit v1.2.3 From 750cfae39c77e6f065190f7c9647ac43388952fb Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 12 Mar 2014 16:35:45 +0100 Subject: separate local and net mounts, ignore comments --- package/base-files/Makefile | 2 +- package/base-files/src/etc/init.d/fs | 53 ++------------------------------- package/base-files/src/etc/init.d/fsnet | 53 +++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 52 deletions(-) create mode 100644 package/base-files/src/etc/init.d/fsnet diff --git a/package/base-files/Makefile b/package/base-files/Makefile index f325d2210..81fb1f6df 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk PKG_NAME:= base-files PKG_VERSION:= 1.0 -PKG_RELEASE:= 69 +PKG_RELEASE:= 70 PKG_SECTION:= base PKG_DESCR:= basic files and scripts PKG_BUILDDEP:= pkgconf-host file-host diff --git a/package/base-files/src/etc/init.d/fs b/package/base-files/src/etc/init.d/fs index f79d9348d..75ae760e0 100644 --- a/package/base-files/src/etc/init.d/fs +++ b/package/base-files/src/etc/init.d/fs @@ -2,66 +2,17 @@ #INIT 60 [[ $1 = autostart ]] || exit 0 -# activate swap -[ -x /sbin/swapon ] && { swapon -a; } - -# activate any logical volumes -[ -x /usr/sbin/lvm ] && { lvm vgscan; lvm vgchange -ay; } - -# filesystem checks -[ -x /sbin/fsck.ext2 ] && { - for i in $(grep ext2 /etc/fstab|awk '{ print $1}');do fsck.ext2 $i;done; -} -[ -x /sbin/fsck.ext3 ] && { - for i in $(grep ext3 /etc/fstab|awk '{ print $1}');do fsck.ext3 $i;done; -} -[ -x /sbin/fsck.ext4 ] && { - for i in $(grep ext4 /etc/fstab|awk '{ print $1}');do fsck.ext4 $i;done; -} -[ -x /sbin/fsck.xfs ] && { - for i in $(grep xfs /etc/fstab|awk '{ print $1}');do xfs_repair $i;done; -} -# local filesystems -grep ext2 /proc/filesystems >/dev/null 2>&1 -if [ $? -eq 0 ];then - grep ext2 /etc/fstab >/dev/null 2>&1 - if [ $? -eq 0 ];then - mount -a -t ext2 - fi -fi -grep ext3 /proc/filesystems >/dev/null 2>&1 -if [ $? -eq 0 ];then - grep ext3 /etc/fstab >/dev/null 2>&1 - if [ $? -eq 0 ];then - mount -a -t ext3 - fi -fi -grep ext4 /proc/filesystems >/dev/null 2>&1 -if [ $? -eq 0 ];then - grep ext4 /etc/fstab >/dev/null 2>&1 - if [ $? -eq 0 ];then - mount -a -t ext4 - fi -fi -grep xfs /proc/filesystems >/dev/null 2>&1 -if [ $? -eq 0 ];then - grep xfs /etc/fstab >/dev/null 2>&1 - if [ $? -eq 0 ];then - mount -a -t xfs - fi -fi - # mount net filesystems (nfs/cifs) grep nfs /proc/filesystems >/dev/null 2>&1 if [ $? -eq 0 ];then - grep nfs /etc/fstab >/dev/null 2>&1 + grep -v "^#" /etc/fstab| grep nfs >/dev/null 2>&1 if [ $? -eq 0 ];then mount -a -t nfs fi fi grep cifs /proc/filesystems >/dev/null 2>&1 if [ $? -eq 0 ];then - grep cifs /etc/fstab >/dev/null 2>&1 + grep -v "^#" /etc/fstab| grep cifs >/dev/null 2>&1 if [ $? -eq 0 ];then mount -a -t cifs fi diff --git a/package/base-files/src/etc/init.d/fsnet b/package/base-files/src/etc/init.d/fsnet new file mode 100644 index 000000000..8f4397897 --- /dev/null +++ b/package/base-files/src/etc/init.d/fsnet @@ -0,0 +1,53 @@ +#!/bin/sh +#INIT 20 +[[ $1 = autostart ]] || exit 0 + +# activate swap +[ -x /sbin/swapon ] && { swapon -a; } + +# activate any logical volumes +[ -x /usr/sbin/lvm ] && { lvm vgscan; lvm vgchange -ay; } + +# filesystem checks +[ -x /sbin/fsck.ext2 ] && { + for i in $(grep -v "^#" /etc/fstab|grep ext2|awk '{ print $1}');do fsck.ext2 $i;done; +} +[ -x /sbin/fsck.ext3 ] && { + for i in $(grep -v "^#" /etc/fstab|grep ext3|awk '{ print $1}');do fsck.ext3 $i;done; +} +[ -x /sbin/fsck.ext4 ] && { + for i in $(grep -v "^#" /etc/fstab|grep ext4|awk '{ print $1}');do fsck.ext4 $i;done; +} +[ -x /sbin/fsck.xfs ] && { + for i in $(grep -v "^#" /etc/fstab|grep xfs|awk '{ print $1}');do xfs_repair $i;done; +} +# local filesystems +grep ext2 /proc/filesystems >/dev/null 2>&1 +if [ $? -eq 0 ];then + grep -v "^#" /etc/fstab |grep ext2 >/dev/null 2>&1 + if [ $? -eq 0 ];then + mount -a -t ext2 + fi +fi +grep ext3 /proc/filesystems >/dev/null 2>&1 +if [ $? -eq 0 ];then + grep -v "^#" /etc/fstab |grep ext3 >/dev/null 2>&1 + if [ $? -eq 0 ];then + mount -a -t ext3 + fi +fi +grep ext4 /proc/filesystems >/dev/null 2>&1 +if [ $? -eq 0 ];then + grep -v "^#" /etc/fstab |grep ext4 >/dev/null 2>&1 + if [ $? -eq 0 ];then + mount -a -t ext4 + fi +fi +grep xfs /proc/filesystems >/dev/null 2>&1 +if [ $? -eq 0 ];then + grep -v "^#" /etc/fstab |grep xfs >/dev/null 2>&1 + if [ $? -eq 0 ];then + mount -a -t xfs + fi +fi +exit 0 -- cgit v1.2.3 From b5fcbfdda3d3062ec894b03214c03fb9932346b4 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 12 Mar 2014 17:16:35 +0100 Subject: update to latest upstream --- package/samba/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/samba/Makefile b/package/samba/Makefile index f29bf52e0..34cbeec8a 100644 --- a/package/samba/Makefile +++ b/package/samba/Makefile @@ -4,9 +4,9 @@ include ${TOPDIR}/rules.mk PKG_NAME:= samba -PKG_VERSION:= 3.6.21 +PKG_VERSION:= 3.6.23 PKG_RELEASE:= 1 -PKG_MD5SUM:= faa67c625508dc495c082357913ccea6 +PKG_MD5SUM:= 2f7aee1dc5d31aefcb364600915b31dc PKG_DESCR:= NetBIOS/SMB file and print server PKG_SECTION:= net/fs PKG_BUILDDEP:= gettext-tiny util-linux popt -- cgit v1.2.3 From 5b03c6330ef063356668a328f5fd1b14848b0893 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 12 Mar 2014 18:21:55 +0100 Subject: update and fix packaging issue --- package/dosfstools/Makefile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/package/dosfstools/Makefile b/package/dosfstools/Makefile index 9b6c365a1..2235e73af 100644 --- a/package/dosfstools/Makefile +++ b/package/dosfstools/Makefile @@ -4,13 +4,15 @@ include ${TOPDIR}/rules.mk PKG_NAME:= dosfstools -PKG_VERSION:= 3.0.9 -PKG_RELEASE:= 2 -PKG_MD5SUM:= bd273cf8aa6341c0b52cbac72050bcf4 -PKG_DESCR:= Utilities to create and check MS-DOS FAT filesystems +PKG_VERSION:= 3.0.26 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 45012f5f56f2aae3afcd62120b9e5a08 +PKG_DESCR:= utilities to create and check FAT filesystems PKG_SECTION:= fs PKG_URL:= http://www.daniel-baumann.ch/software/dosfstools/ -PKG_SITES:= http://www.daniel-baumann.ch/software/dosfstools/ +PKG_SITES:= http://daniel-baumann.ch/files/software/dosfstools/ + +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz include ${TOPDIR}/mk/package.mk @@ -19,11 +21,11 @@ $(eval $(call PKG_template,DOSFSTOOLS,dosfstools,${PKG_VERSION}-${PKG_RELEASE},$ CONFIG_STYLE:= manual XAKE_FLAGS+= PREFIX="" OPTFLAGS="-D_FILE_OFFSET_BITS=64" -post-install: +dosfstools-install: ${INSTALL_DIR} ${IDIR_DOSFSTOOLS}/sbin ${CP} ${WRKINST}/sbin/dosfsck ${IDIR_DOSFSTOOLS}/sbin/ - ${CP} ${WRKINST}/sbin/fsck.{msdos,vfat} ${IDIR_DOSFSTOOLS}/sbin/ + ${CP} ${WRKINST}/sbin/fsck.{msdos,vfat,fat} ${IDIR_DOSFSTOOLS}/sbin/ ${CP} ${WRKINST}/sbin/mkdosfs ${IDIR_DOSFSTOOLS}/sbin/ - ${CP} ${WRKINST}/sbin/mkfs.{msdos,vfat} ${IDIR_DOSFSTOOLS}/sbin/ + ${CP} ${WRKINST}/sbin/mkfs.{msdos,vfat,fat} ${IDIR_DOSFSTOOLS}/sbin/ include ${TOPDIR}/mk/pkg-bottom.mk -- cgit v1.2.3 From fc66dfb4f12a226d6845fb5b0d4ceb7abc7e1b57 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 12 Mar 2014 19:34:01 +0100 Subject: fix runtime dependency --- package/xfsprogs/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/xfsprogs/Makefile b/package/xfsprogs/Makefile index 78e30a09a..c06803164 100644 --- a/package/xfsprogs/Makefile +++ b/package/xfsprogs/Makefile @@ -9,8 +9,9 @@ PKG_RELEASE:= 1 PKG_MD5SUM:= d6159f7a664d95b4c150d580399d4400 PKG_DESCR:= Utilities for XFS filesystems PKG_SECTION:= fs -PKG_BUILDDEP:= e2fsprogs util-linux +PKG_BUILDDEP:= e2fsprogs util-linux ncurses PKG_DEPENDS:= libuuid libpthread libblkid librt libgcc +PKG_DEPENDS+= libncurses PKG_URL:= http://oss.sgi.com/projects/xfs PKG_SITES:= ftp://oss.sgi.com/projects/xfs/cmd_tars/ \ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/ -- cgit v1.2.3 From 2708ff4af251bd016aa45971aa6c03a2eeaeeff1 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 12 Mar 2014 19:34:28 +0100 Subject: convert lemote yeelong to miniconfig --- mk/rootfs.mk | 2 +- target/config/Config.in | 3 +- target/linux/config/Config.in.audio | 5 +++- target/linux/config/Config.in.netdevice | 11 -------- target/linux/config/Config.in.usb | 48 +++++++++++++++----------------- target/linux/kernel.config | 1 + target/mips/Makefile | 2 +- target/mips/kernel/lemote-yeelong | 27 ++++++++++++++++++ target/mips/sys-available/lemote-yeelong | 3 +- 9 files changed, 59 insertions(+), 43 deletions(-) create mode 100644 target/mips/kernel/lemote-yeelong diff --git a/mk/rootfs.mk b/mk/rootfs.mk index 5ec5f3107..55830b23c 100644 --- a/mk/rootfs.mk +++ b/mk/rootfs.mk @@ -36,7 +36,7 @@ ROOTFS:= root=/dev/sda1 rootwait endif ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y) -USB:= rootwait +USB:= rootwait root=/dev/sdc1 else USB:= rootdelay=2 endif diff --git a/target/config/Config.in b/target/config/Config.in index c50fbd289..3de5e3a23 100644 --- a/target/config/Config.in +++ b/target/config/Config.in @@ -213,6 +213,7 @@ config ADK_TARGET_KERNEL_MINICONFIG default "cubox-i" if ADK_TARGET_SYSTEM_CUBOX_I default "raspberry-pi" if ADK_TARGET_SYSTEM_RASPBERRY_PI default "sharp-zaurus" if ADK_TARGET_SYSTEM_SHARP_ZAURUS + default "lemote-yeelong" if ADK_TARGET_SYSTEM_LEMOTE_YEELONG config ADK_QEMU_ARGS string @@ -612,7 +613,7 @@ config ADK_TARGET_CFLAGS config ADK_TARGET_CMDLINE string default "dwc_otg.fiq_split_enable=1" if ADK_TARGET_SYSTEM_RASPBERRY_PI - default "console=tty no_auto_cmd" if ADK_TARGET_SYSTEM_LEMOTE_YEELONG + default "console=tty0" if ADK_TARGET_SYSTEM_LEMOTE_YEELONG default "console=ttymxc0,115200" if ADK_TARGET_SYSTEM_CUBOX_I default "console=ttyS0,9600" if ADK_TARGET_SYSTEM_FON_FON2100 default "console=ttyS0,38400" if ADK_TARGET_SYSTEM_PCENGINES_WRAP diff --git a/target/linux/config/Config.in.audio b/target/linux/config/Config.in.audio index c466bed45..8a4198aee 100644 --- a/target/linux/config/Config.in.audio +++ b/target/linux/config/Config.in.audio @@ -4,6 +4,9 @@ depends on ADK_TARGET_WITH_PCI || ADK_TARGET_WITH_USB || ADK_TARGET_WITH_SOUND config ADK_KERNEL_SND_ARM boolean +config ADK_KERNEL_SND_PCI + boolean + config ADK_KERNEL_SND_USB boolean @@ -36,7 +39,6 @@ config ADK_KPACKAGE_KMOD_SND_RAWMIDI config ADK_KPACKAGE_KMOD_SND_AC97_CODEC tristate - depends on ADK_TARGET_WITH_PCI || ADK_TARGET_WITH_SOUND config ADK_KPACKAGE_KMOD_SND prompt "kmod-snd...................... ALSA sound support" @@ -93,6 +95,7 @@ config ADK_KPACKAGE_KMOD_SND_ENS1370 config ADK_KPACKAGE_KMOD_SND_CS5535AUDIO prompt "kmod-snd-cs5535audio.......... ALSA AMD CS5535 driver" tristate + select ADK_KERNEL_SND_PCI select ADK_KPACKAGE_KMOD_SND_AC97_CODEC select ADK_KPACKAGE_KMOD_SND default y if ADK_TARGET_SYSTEM_LEMOTE_YEELONG diff --git a/target/linux/config/Config.in.netdevice b/target/linux/config/Config.in.netdevice index 789b75b7d..7aabc0b7e 100644 --- a/target/linux/config/Config.in.netdevice +++ b/target/linux/config/Config.in.netdevice @@ -68,17 +68,6 @@ config ADK_KERNEL_NATSEMI default n help -config ADK_KERNEL_8139TOO - boolean - select ADK_KERNEL_NETDEVICES - select ADK_KERNEL_NET_ETHERNET - select ADK_KERNEL_NET_PCI - select ADK_KERNEL_MII - default y if ADK_TARGET_SYSTEM_LEMOTE_YEELONG - default n - help - - config ADK_KERNEL_VIA_RHINE boolean select ADK_KERNEL_NETDEVICES diff --git a/target/linux/config/Config.in.usb b/target/linux/config/Config.in.usb index f6fd22339..2d50e24b2 100644 --- a/target/linux/config/Config.in.usb +++ b/target/linux/config/Config.in.usb @@ -5,20 +5,23 @@ config ADK_KERNEL_USB_SUPPORT boolean config ADK_KERNEL_USB + boolean select ADK_KERNEL_USB_SUPPORT default y if ADK_TARGET_SYSTEM_QEMU_SH4 default y if ADK_TARGET_SYSTEM_QEMU_SH4EB - boolean + default n config ADK_KERNEL_USB_OHCI_HCD + boolean default y if ADK_TARGET_SYSTEM_QEMU_SH4 default y if ADK_TARGET_SYSTEM_QEMU_SH4EB - boolean + default n config ADK_KERNEL_USB_OHCI_HCD_PLATFORM + boolean default y if ADK_TARGET_SYSTEM_QEMU_SH4 default y if ADK_TARGET_SYSTEM_QEMU_SH4EB - boolean + default n config ADK_KERNEL_USB_LIBUSUAL tristate @@ -47,8 +50,6 @@ config ADK_KPACKAGE_KMOD_USB select ADK_KERNEL_NLS select ADK_KERNEL_USB_SUPPORT depends on !ADK_KERNEL_USB - default y if ADK_TARGET_SYSTEM_QEMU_I686 - default y if ADK_TARGET_SYSTEM_QEMU_X86_64 default y if ADK_TARGET_SYSTEM_PCENGINES_ALIX1C default y if ADK_TARGET_SYSTEM_PCENGINES_ALIX2D2 default y if ADK_TARGET_SYSTEM_PCENGINES_ALIX2D13 @@ -111,15 +112,12 @@ config ADK_KPACKAGE_KMOD_USB_OHCI_HCD tristate select ADK_PACKAGE_KMOD_USB_CONTROLLER depends on ADK_KPACKAGE_KMOD_USB - #depends on !ADK_TARGET_SYSTEM_ACMESYSTEMS_FOXG20 depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI default y if ADK_TARGET_SYSTEM_PCENGINES_ALIX1C default y if ADK_TARGET_SYSTEM_PCENGINES_ALIX2D2 default y if ADK_TARGET_SYSTEM_PCENGINES_ALIX2D13 default y if ADK_TARGET_SYSTEM_ACMESYSTEMS_FOXG20 default y if ADK_TARGET_SYSTEM_LEMOTE_YEELONG - default y if ADK_TARGET_SYSTEM_QEMU_SH4 - default y if ADK_TARGET_SYSTEM_QEMU_SH4EB default n help The Open Host Controller Interface (OHCI) is a standard for accessing @@ -176,8 +174,6 @@ config ADK_KPACKAGE_KMOD_USB_EHCI_HCD depends on !ADK_TARGET_SYSTEM_ACMESYSTEMS_FOXG20 depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI depends on ADK_KPACKAGE_KMOD_USB - default y if ADK_TARGET_SYSTEM_QEMU_I686 - default y if ADK_TARGET_SYSTEM_QEMU_X86_64 default y if ADK_TARGET_SYSTEM_PCENGINES_ALIX1C default y if ADK_TARGET_SYSTEM_PCENGINES_ALIX2D2 default y if ADK_TARGET_SYSTEM_PCENGINES_ALIX2D13 @@ -212,34 +208,34 @@ config ADK_PACKAGE_KMOD_USB_CONTROLLER config ADK_KPACKAGE_KMOD_USB_ACM prompt "kmod-usb-acm...................... Support for USB modems/isdn controllers" tristate - default n depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n config ADK_KPACKAGE_KMOD_USB_PEGASUS prompt "kmod-usb-pegasus.................. Support for USB Pegasus" tristate - default n depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n config ADK_KPACKAGE_KMOD_USB_HSO prompt "kmod-usb-hso...................... Support for USB HSO devices" tristate select ADK_KPACKAGE_KMOD_RFKILL select ADK_KPACKAGE_KMOD_USB_STORAGE - default n depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n config ADK_KPACKAGE_KMOD_USB_PRINTER prompt "kmod-usb-printer.................. Support for USB printers" tristate - default n depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n config ADK_KPACKAGE_KMOD_USB_SERIAL prompt "kmod-usb-serial................... Support for USB-to-serial converters" tristate - default n depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n help Say Y here if you have a USB device that provides normal serial ports, or acts like a serial device, and you want to connect it to @@ -253,8 +249,8 @@ config ADK_KPACKAGE_KMOD_USB_SERIAL config ADK_KPACKAGE_KMOD_USB_SERIAL_BELKIN prompt "kmod-usb-serial-belkin.......... Support for Belkin USB-to-serial converters" tristate - default n depends on ADK_KPACKAGE_KMOD_USB_SERIAL + default n help Say Y here if you want to use a Belkin USB Serial single port adaptor (F5U103 is one of the model numbers) or the Peracom single @@ -263,8 +259,8 @@ config ADK_KPACKAGE_KMOD_USB_SERIAL_BELKIN config ADK_KPACKAGE_KMOD_USB_SERIAL_FTDI_SIO prompt "kmod-usb-serial-ftdi............ Support for FTDI USB-to-serial converter" tristate - default n depends on ADK_KPACKAGE_KMOD_USB_SERIAL + default n help Say Y here if you want to use a FTDI SIO single port USB to serial converter device. The implementation I have is called the USC-1000. @@ -276,8 +272,8 @@ config ADK_KPACKAGE_KMOD_USB_SERIAL_FTDI_SIO config ADK_KPACKAGE_KMOD_USB_SERIAL_MCT_U232 prompt "kmod-usb-serial-mct-u232........ Support for Magic Control Technology USB-to-Serial converters" tristate - default n depends on ADK_KPACKAGE_KMOD_USB_SERIAL + default n help Say Y here if you want to use a USB Serial single port adapter from Magic Control Technology Corp. (U232 is one of the model numbers). @@ -288,8 +284,8 @@ config ADK_KPACKAGE_KMOD_USB_SERIAL_MCT_U232 config ADK_KPACKAGE_KMOD_USB_SERIAL_PL2303 prompt "kmod-usb-serial-pl2303.......... Support for Prolific PL2303 USB-to-Serial converters" tristate - default n depends on ADK_KPACKAGE_KMOD_USB_SERIAL + default n help Say Y here if you want to use the PL2303 USB Serial single port adapter from Prolific. @@ -297,8 +293,8 @@ config ADK_KPACKAGE_KMOD_USB_SERIAL_PL2303 config ADK_KPACKAGE_KMOD_USB_SERIAL_VISOR prompt "kmod-usb-serial-visor........... Support for Handspring Visor / Palm m50x / Sony Clie Driver" tristate - default n depends on ADK_KPACKAGE_KMOD_USB_SERIAL + default n help Say Y here if you want to connect to your HandSpring Visor, Palm m500 or m505 through its USB docking station. See @@ -308,43 +304,43 @@ config ADK_KPACKAGE_KMOD_USB_SERIAL_VISOR config ADK_KPACKAGE_KMOD_USB_STORAGE prompt "kmod-usb-storage.................. Support for USB storage devices" tristate - default n depends on ADK_PACKAGE_KMOD_USB_CONTROLLER depends on !ADK_KERNEL_USB_STORAGE select ADK_KPACKAGE_KMOD_SCSI if !ADK_KERNEL_SCSI select ADK_KPACKAGE_KMOD_BLK_DEV_SD if !ADK_KERNEL_SCSI + default n config ADK_KPACKAGE_KMOD_USB_ATM prompt "kmod-usb-atm...................... Support for USB ATM devices" tristate - default n depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n config ADK_KPACKAGE_KMOD_USB_ATM_SPEEDTOUCH prompt "kmod-usb-atm-speedtouch......... Support for USB Speedtouch ADSL modem" tristate - default n depends on ADK_KPACKAGE_KMOD_USB_ATM + default n config ADK_KPACKAGE_KMOD_USB_USBNET prompt "kmod-usb-usbnet................... Multi-purpose USB Networking Framework" tristate - default n depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n config ADK_KPACKAGE_KMOD_SND_USB_AUDIO prompt "kmod-snd-usb-audio................ USB sound adapter" tristate - default n select ADK_KERNEL_SND_USB select ADK_KPACKAGE_KMOD_SND select ADK_KPACKAGE_KMOD_SND_RAWMIDI depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n config ADK_KPACKAGE_KMOD_USB_SISUSBVGA prompt "kmod-usb-svga..................... USB 2.0 SVGA dongle support (Net2280/SiS315)" tristate - default n depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n endmenu diff --git a/target/linux/kernel.config b/target/linux/kernel.config index a28c2088b..9d9d7619e 100644 --- a/target/linux/kernel.config +++ b/target/linux/kernel.config @@ -25,6 +25,7 @@ CONFIG_EMBEDDED=y CONFIG_MODULES=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_SCRIPT=y +CONFIG_HOTPLUG=y CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_STANDALONE=y diff --git a/target/mips/Makefile b/target/mips/Makefile index ae51eaa8e..68c2ea0fe 100644 --- a/target/mips/Makefile +++ b/target/mips/Makefile @@ -137,7 +137,7 @@ imageinstall: $(FW_DIR)/$(ROOTFSTARBALL) ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y) @echo "Startup the netbook and type del to enter PMON:" @echo "PMON> load /dev/fs/ext2@usb0/boot/kernel" - @echo "PMON> g root=/dev/sdc1" + @echo "PMON> g" endif endif ifeq ($(ADK_TARGET_FS),cf) diff --git a/target/mips/kernel/lemote-yeelong b/target/mips/kernel/lemote-yeelong new file mode 100644 index 000000000..c37d40271 --- /dev/null +++ b/target/mips/kernel/lemote-yeelong @@ -0,0 +1,27 @@ +CONFIG_MIPS=y +CONFIG_MACH_LOONGSON=y +CONFIG_LEMOTE_MACH2F=y +CONFIG_CS5536=y +CONFIG_CPU_LOONGSON2F=y +CONFIG_CPU_NOP_WORKAROUNDS=y +CONFIG_CPU_JUMP_WORKAROUNDS=y +CONFIG_CPU_LOONGSON2F_WORKAROUNDS=y +CONFIG_64BIT=y +CONFIG_PAGE_SIZE_16KB=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_MIPS32_COMPAT=y +CONFIG_COMPAT=y +CONFIG_MIPS32_O32=y +CONFIG_MIPS32_N32=y +CONFIG_BLK_DEV=y +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +CONFIG_ETHERNET=y +CONFIG_NET_VENDOR_REALTEK=y +CONFIG_8139TOO=y +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_SERPORT=y +CONFIG_SERIO_LIBPS2=y + diff --git a/target/mips/sys-available/lemote-yeelong b/target/mips/sys-available/lemote-yeelong index 10db77945..62eeb88ee 100644 --- a/target/mips/sys-available/lemote-yeelong +++ b/target/mips/sys-available/lemote-yeelong @@ -5,8 +5,6 @@ config ADK_TARGET_SYSTEM_LEMOTE_YEELONG select ADK_lemote_yeelong select ADK_LINUX_64 select ADK_CPU_LOONGSON2F - select ADK_KERNEL_MACH_LOONGSON - select ADK_KERNEL_LEMOTE_MACH2F select ADK_TARGET_WITH_USB_BOOT select ADK_TARGET_WITH_USB select ADK_TARGET_WITH_VGA @@ -15,6 +13,7 @@ config ADK_TARGET_SYSTEM_LEMOTE_YEELONG select ADK_TARGET_WITH_HDD select ADK_TARGET_WITH_PCI select ADK_TARGET_KERNEL_VMLINUZ + select ADK_USE_KERNEL_MINICONFIG help System profile for Lemote Yeelong laptop. -- cgit v1.2.3 From f42fb988bae9d402b0b204614b54ba9b4261d877 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 13 Mar 2014 08:59:58 +0100 Subject: fix linking with iconv --- package/dosfstools/Makefile | 5 +++-- package/dosfstools/patches/patch-Makefile | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/package/dosfstools/Makefile b/package/dosfstools/Makefile index 2235e73af..1dd82182a 100644 --- a/package/dosfstools/Makefile +++ b/package/dosfstools/Makefile @@ -5,10 +5,11 @@ include ${TOPDIR}/rules.mk PKG_NAME:= dosfstools PKG_VERSION:= 3.0.26 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= 45012f5f56f2aae3afcd62120b9e5a08 PKG_DESCR:= utilities to create and check FAT filesystems PKG_SECTION:= fs +PKG_BUILDDEP:= libiconv-tiny PKG_URL:= http://www.daniel-baumann.ch/software/dosfstools/ PKG_SITES:= http://daniel-baumann.ch/files/software/dosfstools/ @@ -19,7 +20,7 @@ include ${TOPDIR}/mk/package.mk $(eval $(call PKG_template,DOSFSTOOLS,dosfstools,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) CONFIG_STYLE:= manual -XAKE_FLAGS+= PREFIX="" OPTFLAGS="-D_FILE_OFFSET_BITS=64" +XAKE_FLAGS+= PREFIX="" dosfstools-install: ${INSTALL_DIR} ${IDIR_DOSFSTOOLS}/sbin diff --git a/package/dosfstools/patches/patch-Makefile b/package/dosfstools/patches/patch-Makefile index c20b7f4dc..1d127acbc 100644 --- a/package/dosfstools/patches/patch-Makefile +++ b/package/dosfstools/patches/patch-Makefile @@ -1,11 +1,13 @@ ---- dosfstools-3.0.9.orig/Makefile 2009-10-04 11:03:23.000000000 +0200 -+++ dosfstools-3.0.9/Makefile 2011-01-07 21:50:15.000000000 +0100 -@@ -29,7 +29,7 @@ OPTFLAGS = -O2 -fomit-frame-pointer $(sh +--- dosfstools-3.0.26.orig/Makefile 2014-01-17 07:09:28.000000000 +0100 ++++ dosfstools-3.0.26/Makefile 2014-03-13 08:58:52.000000000 +0100 +@@ -32,7 +32,9 @@ OPTFLAGS = -O2 -fomit-frame-pointer -D_G #WARNFLAGS = -Wall -pedantic -std=c99 - WARNFLAGS = -Wall + WARNFLAGS = -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -Wmissing-prototypes -Wstrict-prototypes DEBUGFLAGS = -g -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) $(DEBUGFLAGS) ++CFLAGS ?= +CFLAGS += $(WARNFLAGS) ++LDLIBS = -liconv VPATH = src -- cgit v1.2.3 From 367a3fb4a28ada3dad0842baa731d29c7b6f8c26 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 13 Mar 2014 09:09:54 +0100 Subject: no newline --- target/sparc64/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/sparc64/Makefile b/target/sparc64/Makefile index 12900ec8c..8fe5ebbcc 100644 --- a/target/sparc64/Makefile +++ b/target/sparc64/Makefile @@ -19,8 +19,7 @@ ifeq ($(ADK_TARGET_SYSTEM_QEMU_SPARC64),y) @echo "./scripts/create.sh +g qemu-${CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)" @echo "Start qemu with following command line:" ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y) - @echo 'qemu-system-sparc64 -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) -drive file=qemu-${CPU_ARCH}.img,if=virtio,index=0 \ - -net nic,model=virtio -net user' + @echo 'qemu-system-sparc64 -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) -drive file=qemu-${CPU_ARCH}.img,if=virtio,index=0 -net nic,model=virtio -net user' else @echo 'qemu-system-sparc64 -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img' endif -- cgit v1.2.3 From c16eb800d935d903d2ab38b3da8270324284e973 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 13 Mar 2014 09:11:17 +0100 Subject: sync with uClibc master --- toolchain/uClibc/patches/uclibc-git-20140212.patch | 116822 ------------------ toolchain/uClibc/patches/uclibc-git-20140313.patch | 116105 +++++++++++++++++ .../uClibc/patches/xxx-n32-pread_pwrite.patch | 32 - 3 files changed, 116105 insertions(+), 116854 deletions(-) delete mode 100644 toolchain/uClibc/patches/uclibc-git-20140212.patch create mode 100644 toolchain/uClibc/patches/uclibc-git-20140313.patch delete mode 100644 toolchain/uClibc/patches/xxx-n32-pread_pwrite.patch diff --git a/toolchain/uClibc/patches/uclibc-git-20140212.patch b/toolchain/uClibc/patches/uclibc-git-20140212.patch deleted file mode 100644 index 049e3e5f3..000000000 --- a/toolchain/uClibc/patches/uclibc-git-20140212.patch +++ /dev/null @@ -1,116822 +0,0 @@ -diff -Nur uClibc-0.9.33.2/docs/man/arc4random.3 uClibc/docs/man/arc4random.3 ---- uClibc-0.9.33.2/docs/man/arc4random.3 1970-01-01 01:00:00.000000000 +0100 -+++ uClibc/docs/man/arc4random.3 2014-02-03 12:32:56.000000000 +0100 -@@ -0,0 +1,110 @@ -+.\" $OpenBSD: arc4random.3,v 1.19 2005/07/17 08:50:55 jaredy Exp $ -+.\" -+.\" Copyright 1997 Niels Provos -+.\" All rights reserved. -+.\" -+.\" Redistribution and use in source and binary forms, with or without -+.\" modification, are permitted provided that the following conditions -+.\" are met: -+.\" 1. Redistributions of source code must retain the above copyright -+.\" notice, this list of conditions and the following disclaimer. -+.\" 2. Redistributions in binary form must reproduce the above copyright -+.\" notice, this list of conditions and the following disclaimer in the -+.\" documentation and/or other materials provided with the distribution. -+.\" 3. All advertising materials mentioning features or use of this software -+.\" must display the following acknowledgement: -+.\" This product includes software developed by Niels Provos. -+.\" 4. The name of the author may not be used to endorse or promote products -+.\" derived from this software without specific prior written permission. -+.\" -+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+.\" -+.\" Manual page, using -mandoc macros -+.\" -+.Dd April 15, 1997 -+.Dt ARC4RANDOM 3 -+.Os -+.Sh NAME -+.Nm arc4random , -+.Nm arc4random_stir , -+.Nm arc4random_addrandom -+.Nd arc4 random number generator -+.Sh SYNOPSIS -+.Fd #include -+.Ft uint32_t -+.Fn arc4random "void" -+.Ft void -+.Fn arc4random_stir "void" -+.Ft void -+.Fn arc4random_addrandom "u_char *dat" "int datlen" -+.Sh DESCRIPTION -+The -+.Fn arc4random -+function provides a high quality 32-bit pseudo-random -+number very quickly. -+.Fn arc4random -+seeds itself on a regular basis from the kernel strong random number -+subsystem described in -+.Xr random 4 . -+On each call, an ARC4 generator is used to generate a new result. -+The -+.Fn arc4random -+function uses the ARC4 cipher key stream generator, -+which uses 8*8 8-bit S-Boxes. -+The S-Boxes can be in about (2**1700) states. -+.Pp -+.Fn arc4random -+fits into a middle ground not covered by other subsystems such as -+the strong, slow, and resource expensive random -+devices described in -+.Xr random 4 -+versus the fast but poor quality interfaces described in -+.Xr rand 3 , -+.Xr random 3 , -+and -+.Xr drand48 3 . -+.Pp -+The -+.Fn arc4random_stir -+function reads data from a pseudo-random device, usually -+.Pa /dev/urandom, -+and uses it to permute the S-Boxes via -+.Fn arc4random_addrandom . -+.Pp -+There is no need to call -+.Fn arc4random_stir -+before using -+.Fn arc4random , -+since -+.Fn arc4random -+automatically initializes itself. -+.Sh SEE ALSO -+.Xr rand 3 , -+.Xr rand48 3 , -+.Xr random 3 -+.Sh HISTORY -+An algorithm called -+.Pa RC4 -+was designed by RSA Data Security, Inc. -+It was considered a trade secret. -+Because it was a trade secret, it obviously could not be patented. -+A clone of this was posted anonymously to USENET and confirmed to -+be equivalent by several sources who had access to the original cipher. -+Because of the trade secret situation, RSA Data Security, Inc. can do -+nothing about the release of the ARC4 algorithm. -+Since -+.Pa RC4 -+used to be a trade secret, the cipher is now referred to as -+.Pa ARC4 . -+.Pp -+These functions first appeared in -+.Ox 2.1 . -diff -Nur uClibc-0.9.33.2/docs/PORTING uClibc/docs/PORTING ---- uClibc-0.9.33.2/docs/PORTING 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc/docs/PORTING 2014-02-03 12:32:56.000000000 +0100 -@@ -130,9 +130,6 @@ - ==================== - === Misc Cruft === - ==================== --- utils/readelf.c - not really needed generally speaking, but might as well -- add your arch to the giant EM_* list (describe_elf_hdr) -- - - MAINTAINERS - presumably you're going to submit this code back to mainline - and since you're the only one who cares about this arch (right now), you - should add yourself to the toplevel MAINTAINERS file. do it. -diff -Nur uClibc-0.9.33.2/extra/config/check.sh uClibc/extra/config/check.sh ---- uClibc-0.9.33.2/extra/config/check.sh 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc/extra/config/check.sh 2014-02-03 12:32:56.000000000 +0100 -@@ -1,6 +1,6 @@ - #!/bin/sh - # Needed for systems without gettext --$* -xc -o /dev/null - > /dev/null 2>&1 << EOF -+$* -x c -o /dev/null - > /dev/null 2>&1 << EOF - #include - int main() - { -diff -Nur uClibc-0.9.33.2/extra/config/conf.c uClibc/extra/config/conf.c ---- uClibc-0.9.33.2/extra/config/conf.c 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc/extra/config/conf.c 2014-02-03 12:32:56.000000000 +0100 -@@ -10,42 +10,48 @@ - #include - #include - #include -+#include - #include - #include -+#include - --#define LKC_DIRECT_LINK - #include "lkc.h" - - static void conf(struct menu *menu); - static void check_conf(struct menu *menu); -+static void xfgets(char *str, int size, FILE *in); - --enum { -- ask_all, -- ask_new, -- ask_silent, -- set_default, -- set_yes, -- set_mod, -- set_no, -- set_random --} input_mode = ask_all; --char *defconfig_file; -+enum input_mode { -+ oldaskconfig, -+ silentoldconfig, -+ oldconfig, -+ allnoconfig, -+ allyesconfig, -+ allmodconfig, -+ alldefconfig, -+ randconfig, -+ defconfig, -+ savedefconfig, -+ listnewconfig, -+ olddefconfig, -+} 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[128]; - static struct menu *rootEntry; - --static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); -- --static const char *get_help(struct menu *menu) -+static void print_help(struct menu *menu) - { -- if (menu_has_help(menu)) -- return _(menu_get_help(menu)); -- else -- return nohelp_text; -+ struct gstr help = str_new(); -+ -+ menu_get_ext_help(menu, &help); -+ -+ printf("\n%s\n", str_get(&help)); -+ str_free(&help); - } - - static void strip(char *str) -@@ -93,16 +99,19 @@ - } - - switch (input_mode) { -- case ask_new: -- case ask_silent: -+ case oldconfig: -+ case silentoldconfig: - if (sym_has_value(sym)) { - printf("%s\n", def); - return 0; - } - check_stdin(); -- case ask_all: -+ /* fall through */ -+ case oldaskconfig: - fflush(stdout); -- fgets(line, 128, stdin); -+ xfgets(line, 128, stdin); -+ if (!tty_stdio) -+ printf("\n"); - return 1; - default: - break; -@@ -121,7 +130,7 @@ - return 1; - } - --int conf_string(struct menu *menu) -+static int conf_string(struct menu *menu) - { - struct symbol *sym = menu->sym; - const char *def; -@@ -140,10 +149,11 @@ - case '?': - /* print help */ - if (line[1] == '\n') { -- printf("\n%s\n", get_help(menu)); -+ print_help(menu); - def = NULL; - break; - } -+ /* fall through */ - default: - line[strlen(line)-1] = 0; - def = line; -@@ -156,14 +166,12 @@ - static int conf_sym(struct menu *menu) - { - struct symbol *sym = menu->sym; -- int type; - tristate oldval, newval; - - while (1) { - printf("%*s%s ", indent - 1, "", _(menu->prompt->text)); - if (sym->name) - printf("(%s) ", sym->name); -- type = sym_get_type(sym); - putchar('['); - oldval = sym_get_tristate_value(sym); - switch (oldval) { -@@ -220,7 +228,7 @@ - if (sym_set_tristate_value(sym, newval)) - return 0; - help: -- printf("\n%s\n", get_help(menu)); -+ print_help(menu); - } - } - -@@ -228,11 +236,9 @@ - { - struct symbol *sym, *def_sym; - struct menu *child; -- int type; - bool is_new; - - sym = menu->sym; -- type = sym_get_type(sym); - is_new = !sym_has_value(sym); - if (sym_is_changable(sym)) { - conf_sym(menu); -@@ -294,20 +300,21 @@ - printf("?"); - printf("]: "); - switch (input_mode) { -- case ask_new: -- case ask_silent: -+ case oldconfig: -+ case silentoldconfig: - if (!is_new) { - cnt = def; - printf("%d\n", cnt); - break; - } - check_stdin(); -- case ask_all: -+ /* fall through */ -+ case oldaskconfig: - fflush(stdout); -- fgets(line, 128, stdin); -+ xfgets(line, 128, stdin); - strip(line); - if (line[0] == '?') { -- printf("\n%s\n", get_help(menu)); -+ print_help(menu); - continue; - } - if (!line[0]) -@@ -330,8 +337,8 @@ - } - if (!child) - continue; -- if (line[strlen(line) - 1] == '?') { -- printf("\n%s\n", get_help(child)); -+ if (line[0] && line[strlen(line) - 1] == '?') { -+ print_help(child); - continue; - } - sym_set_choice_value(sym, child->sym); -@@ -360,10 +367,14 @@ - - switch (prop->type) { - case P_MENU: -- if (input_mode == ask_silent && rootEntry != menu) { -+ if ((input_mode == silentoldconfig || -+ input_mode == listnewconfig || -+ input_mode == olddefconfig) && -+ rootEntry != menu) { - check_conf(menu); - return; - } -+ /* fall through */ - case P_COMMENT: - prompt = menu_get_prompt(menu); - if (prompt) -@@ -418,10 +429,16 @@ - if (sym && !sym_has_value(sym)) { - if (sym_is_changable(sym) || - (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) { -- if (!conf_cnt++) -- printf(_("*\n* Restart config...\n*\n")); -- rootEntry = menu_get_parent_menu(menu); -- conf(rootEntry); -+ if (input_mode == listnewconfig) { -+ if (sym->name && !sym_is_choice_value(sym)) { -+ printf("%s%s\n", CONFIG_, sym->name); -+ } -+ } else if (input_mode != olddefconfig) { -+ if (!conf_cnt++) -+ printf(_("*\n* Restart config...\n*\n")); -+ rootEntry = menu_get_parent_menu(menu); -+ conf(rootEntry); -+ } - } - } - -@@ -429,90 +446,170 @@ - check_conf(child); - } - -+#if 00 // || !defined __UCLIBC__ || \ -+ (defined UCLIBC_HAS_GETOPT_LONG || defined UCLIBC_HAS_GNU_GETOPT) -+static struct option long_opts[] = { -+ {"oldaskconfig", no_argument, NULL, oldaskconfig}, -+ {"oldconfig", no_argument, NULL, oldconfig}, -+ {"silentoldconfig", no_argument, NULL, silentoldconfig}, -+ {"defconfig", optional_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}, -+ {"olddefconfig", no_argument, NULL, olddefconfig}, -+ /* -+ * oldnoconfig is an alias of olddefconfig, because people already -+ * are dependent on its behavior(sets new symbols to their default -+ * value but not 'n') with the counter-intuitive name. -+ */ -+ {"oldnoconfig", no_argument, NULL, olddefconfig}, -+ {NULL, 0, NULL, 0} -+}; -+ -+static void conf_usage(const char *progname) -+{ -+ -+ printf("Usage: %s [option] \n", progname); -+ printf("[option] is _one_ of the following:\n"); -+ printf(" --listnewconfig List new options\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(" --silentoldconfig Same as oldconfig, but quietly, additionally update deps\n"); -+ printf(" --olddefconfig Same as silentoldconfig but sets new symbols to their default value\n"); -+ printf(" --oldnoconfig An alias of olddefconfig\n"); -+ printf(" --defconfig New config with default defined in \n"); -+ printf(" --savedefconfig Save the minimal current configuration to \n"); -+ printf(" --allnoconfig New config where all options are answered with no\n"); -+ printf(" --allyesconfig New config where all options are answered with yes\n"); -+ printf(" --allmodconfig New config where all options are answered with mod\n"); -+ printf(" --alldefconfig New config with all symbols set to default\n"); -+ printf(" --randconfig New config with random answer to all options\n"); -+} -+#else -+static void conf_usage(const char *progname) -+{ -+ -+ printf("Usage: %s [option] \n", progname); -+ printf("[option] is _one_ of the following:\n"); -+ printf(" -a, --oldaskconfig Start a new configuration using a line-oriented program\n"); -+ printf(" -s, --silentoldconfig Same as oldconfig, but quietly, additionally update deps\n"); -+ printf(" -o, --oldconfig Update a configuration using a provided .config as base\n"); -+ printf(" -n, --allnoconfig New config where all options are answered with no\n"); -+ printf(" -y, --allyesconfig New config where all options are answered with yes\n"); -+ printf(" -m, --allmodconfig New config where all options are answered with mod\n"); -+ printf(" -A, --alldefconfig New config with all symbols set to default\n"); -+ printf(" -r, --randconfig New config with random answer to all options\n"); -+ printf(" -D, --defconfig New config with default defined in \n"); -+ printf(" -S, --savedefconfig Save the minimal current configuration to \n"); -+ printf(" -l, --listnewconfig List new options\n"); -+ printf(" -d, --olddefconfig Same as silentoldconfig but sets new symbols to their default value\n"); -+ printf(" --oldnoconfig An alias of olddefconfig\n"); -+ -+} -+#endif -+ - int main(int ac, char **av) - { -+ const char *progname = av[0]; - int opt; -- const char *name; -- const char *configname = conf_get_configname(); -+ const char *name, *defconfig_file = NULL /* gcc uninit */; - struct stat tmpstat; - - setlocale(LC_ALL, ""); - bindtextdomain(PACKAGE, LOCALEDIR); - textdomain(PACKAGE); - -- while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) { -+ tty_stdio = isatty(0) && isatty(1) && isatty(2); -+ -+#if 00// !defined __UCLIBC__ || \ -+ (defined UCLIBC_HAS_GETOPT_LONG || defined UCLIBC_HAS_GNU_GETOPT) -+ while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) -+#else -+ char *gch = "asonymArDSld"; -+ while ((opt = getopt(ac, av, "asonymArD:S:ldh")) != -1) -+#endif -+ { -+ char *x = memchr(gch, opt, strlen(gch)); -+ if (x == NULL) -+ opt = '?'; -+ else -+ opt = x - gch; -+ input_mode = (enum input_mode)opt; - switch (opt) { -- case 'o': -- input_mode = ask_silent; -- break; -- case 's': -- input_mode = ask_silent; -+ case silentoldconfig: - sync_kconfig = 1; - break; -- case 'd': -- input_mode = set_default; -- break; -- case 'D': -- input_mode = set_default; -+ case defconfig: -+ case savedefconfig: - defconfig_file = optarg; - break; -- case 'n': -- input_mode = set_no; -- break; -- case 'm': -- input_mode = set_mod; -- break; -- case 'y': -- input_mode = set_yes; -- break; -- case 'r': -+ 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)); -- srand(seed); - -- input_mode = set_random; -+ 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 'h': -- printf(_("See README for usage info\n")); -- exit(0); -+ case oldaskconfig: -+ case oldconfig: -+ case allnoconfig: -+ case allyesconfig: -+ case allmodconfig: -+ case alldefconfig: -+ case listnewconfig: -+ case olddefconfig: - break; -- default: -- fprintf(stderr, _("See README for usage info\n")); -+ case '?': -+ conf_usage(progname); - exit(1); -+ break; - } - } - if (ac == optind) { - printf(_("%s: Kconfig file missing\n"), av[0]); -+ conf_usage(progname); - exit(1); - } - name = av[optind]; - conf_parse(name); - //zconfdump(stdout); - if (sync_kconfig) { -- if (stat(configname, &tmpstat)) { -+ name = conf_get_configname(); -+ if (stat(name, &tmpstat)) { - fprintf(stderr, _("***\n" -- "*** You have not yet configured!\n" -- "*** (missing .config file)\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")); -+ "***\n"), name); - exit(1); - } - } - - switch (input_mode) { -- case set_default: -+ case defconfig: - if (!defconfig_file) - defconfig_file = conf_get_default_confname(); - if (conf_read(defconfig_file)) { -@@ -522,31 +619,46 @@ - exit(1); - } - break; -- case ask_silent: -- case ask_all: -- case ask_new: -+ case savedefconfig: -+ case silentoldconfig: -+ case oldaskconfig: -+ case oldconfig: -+ case listnewconfig: -+ case olddefconfig: - conf_read(NULL); - break; -- case set_no: -- case set_mod: -- case set_yes: -- case set_random: -+ case allnoconfig: -+ case allyesconfig: -+ case allmodconfig: -+ case alldefconfig: -+ case randconfig: - name = getenv("KCONFIG_ALLCONFIG"); -- if (name && !stat(name, &tmpstat)) { -- conf_read_simple(name, S_DEF_USER); -+ if (!name) -+ break; -+ 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"), -+ name); -+ exit(1); -+ } - break; - } - switch (input_mode) { -- case set_no: name = "allno.config"; break; -- case set_mod: name = "allmod.config"; break; -- case set_yes: name = "allyes.config"; break; -- case set_random: name = "allrandom.config"; break; -+ case allnoconfig: name = "allno.config"; break; -+ case allyesconfig: name = "allyes.config"; break; -+ case allmodconfig: name = "allmod.config"; break; -+ case alldefconfig: name = "alldef.config"; break; -+ case randconfig: name = "allrandom.config"; break; - default: break; - } -- if (!stat(name, &tmpstat)) -- conf_read_simple(name, S_DEF_USER); -- else if (!stat("all.config", &tmpstat)) -- conf_read_simple("all.config", S_DEF_USER); -+ 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"), -+ name); -+ exit(1); -+ } - break; - default: - break; -@@ -557,41 +669,51 @@ - name = getenv("KCONFIG_NOSILENTUPDATE"); - if (name && *name) { - fprintf(stderr, -- _("\n*** configuration requires explicit update.\n\n")); -+ _("\n*** The configuration requires explicit update.\n\n")); - return 1; - } - } -- valid_stdin = isatty(0) && isatty(1) && isatty(2); -+ valid_stdin = tty_stdio; - } - - switch (input_mode) { -- case set_no: -+ case allnoconfig: - conf_set_all_new_symbols(def_no); - break; -- case set_yes: -+ case allyesconfig: - conf_set_all_new_symbols(def_yes); - break; -- case set_mod: -+ case allmodconfig: - conf_set_all_new_symbols(def_mod); - break; -- case set_random: -- conf_set_all_new_symbols(def_random); -+ case alldefconfig: -+ conf_set_all_new_symbols(def_default); -+ break; -+ case randconfig: -+ /* Really nothing to do in this loop */ -+ while (conf_set_all_new_symbols(def_random)) ; - break; -- case set_default: -+ case defconfig: - conf_set_all_new_symbols(def_default); - break; -- case ask_new: -- case ask_all: -+ case savedefconfig: -+ break; -+ case oldaskconfig: - rootEntry = &rootmenu; - conf(&rootmenu); -- input_mode = ask_silent; -+ input_mode = silentoldconfig; - /* fall through */ -- case ask_silent: -+ case oldconfig: -+ case listnewconfig: -+ case olddefconfig: -+ case silentoldconfig: - /* Update until a loop caused no more changes */ - do { - conf_cnt = 0; - check_conf(&rootmenu); -- } while (conf_cnt); -+ } while (conf_cnt && -+ (input_mode != listnewconfig && -+ input_mode != olddefconfig)); - break; - } - -@@ -607,7 +729,13 @@ - fprintf(stderr, _("\n*** Error during update of the configuration.\n\n")); - return 1; - } -- } else { -+ } else if (input_mode == savedefconfig) { -+ if (conf_write_defconfig(defconfig_file)) { -+ fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"), -+ defconfig_file); -+ return 1; -+ } -+ } else if (input_mode != listnewconfig) { - if (conf_write(NULL)) { - fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); - exit(1); -@@ -615,3 +743,12 @@ - } - 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 -Nur uClibc-0.9.33.2/extra/config/confdata.c uClibc/extra/config/confdata.c ---- uClibc-0.9.33.2/extra/config/confdata.c 2012-05-15 09:20:09.000000000 +0200 -+++ uClibc/extra/config/confdata.c 2014-02-03 12:32:56.000000000 +0100 -@@ -5,24 +5,27 @@ - - #include - #include -+#include - #include -+#include - #include - #include - #include - #include - #include --#include - --#define LKC_DIRECT_LINK - #include "lkc.h" - - static void conf_warning(const char *fmt, ...) - __attribute__ ((format (printf, 1, 2))); - -+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; - --const char conf_defname[] = "extra/Configs/defconfigs/$ARCH"; -+const char conf_defname[] = "arch/$ARCH/defconfig"; - - static void conf_warning(const char *fmt, ...) - { -@@ -35,6 +38,29 @@ - conf_warnings++; - } - -+static void conf_default_message_callback(const char *fmt, va_list ap) -+{ -+ printf("#\n# "); -+ vprintf(fmt, ap); -+ printf("\n#\n"); -+} -+ -+static void (*conf_message_callback) (const char *fmt, va_list ap) = -+ conf_default_message_callback; -+void conf_set_message_callback(void (*fn) (const char *fmt, va_list ap)) -+{ -+ conf_message_callback = fn; -+} -+ -+static void conf_message(const char *fmt, ...) -+{ -+ va_list ap; -+ -+ va_start(ap, fmt); -+ if (conf_message_callback) -+ conf_message_callback(fmt, ap); -+} -+ - const char *conf_get_configname(void) - { - char *name = getenv("KCONFIG_CONFIG"); -@@ -42,6 +68,13 @@ - return name ? name : ".config"; - } - -+const char *conf_get_autoconfig_name(void) -+{ -+ char *name = getenv("KCONFIG_AUTOCONFIG"); -+ -+ return name ? name : "include/config/auto.conf"; -+} -+ - static char *conf_expand_value(const char *in) - { - struct symbol *sym; -@@ -95,6 +128,7 @@ - sym->flags |= def_flags; - break; - } -+ /* fall through */ - case S_BOOLEAN: - if (p[0] == 'y') { - sym->def[def].tri = yes; -@@ -107,7 +141,7 @@ - break; - } - conf_warning("symbol value '%s' invalid for %s", p, sym->name); -- break; -+ return 1; - case S_OTHER: - if (*p != '"') { - for (p2 = p; *p2 && !isspace(*p2); p2++) -@@ -115,6 +149,7 @@ - sym->type = S_STRING; - goto done; - } -+ /* fall through */ - case S_STRING: - if (*p++ != '"') - break; -@@ -129,6 +164,7 @@ - conf_warning("invalid string found"); - return 1; - } -+ /* fall through */ - case S_INT: - case S_HEX: - done: -@@ -146,10 +182,66 @@ - return 0; - } - -+#define LINE_GROWTH 16 -+static int add_byte(int c, char **lineptr, size_t slen, size_t *n) -+{ -+ char *nline; -+ size_t new_size = slen + 1; -+ if (new_size > *n) { -+ new_size += LINE_GROWTH - 1; -+ new_size *= 2; -+ nline = realloc(*lineptr, new_size); -+ if (!nline) -+ return -1; -+ -+ *lineptr = nline; -+ *n = new_size; -+ } -+ -+ (*lineptr)[slen] = c; -+ -+ return 0; -+} -+ -+static ssize_t compat_getline(char **lineptr, size_t *n, FILE *stream) -+{ -+ char *line = *lineptr; -+ size_t slen = 0; -+ -+ for (;;) { -+ int c = getc(stream); -+ -+ switch (c) { -+ case '\n': -+ if (add_byte(c, &line, slen, n) < 0) -+ goto e_out; -+ slen++; -+ /* fall through */ -+ case EOF: -+ if (add_byte('\0', &line, slen, n) < 0) -+ goto e_out; -+ *lineptr = line; -+ if (slen == 0) -+ return -1; -+ return slen; -+ default: -+ if (add_byte(c, &line, slen, n) < 0) -+ goto e_out; -+ slen++; -+ } -+ } -+ -+e_out: -+ line[slen-1] = '\0'; -+ *lineptr = line; -+ return -1; -+} -+ - int conf_read_simple(const char *name, int def) - { - FILE *in = NULL; -- char line[1024]; -+ char *line = NULL; -+ size_t line_asize = 0; - char *p, *p2; - struct symbol *sym; - int i, def_flags; -@@ -164,8 +256,11 @@ - if (in) - goto load; - sym_add_change_count(1); -- if (!sym_defconfig_list) -+ if (!sym_defconfig_list) { -+ if (modules_sym) -+ sym_calc_value(modules_sym); - return 1; -+ } - - for_all_defaults(sym_defconfig_list, prop) { - if (expr_calc_value(prop->visible.expr) == no || -@@ -174,9 +269,8 @@ - name = conf_expand_value(prop->expr->left.sym->name); - in = zconf_fopen(name); - if (in) { -- printf(_("#\n" -- "# using defaults found in %s\n" -- "#\n"), name); -+ conf_message(_("using defaults found in %s"), -+ name); - goto load; - } - } -@@ -202,33 +296,33 @@ - case S_STRING: - if (sym->def[def].val) - free(sym->def[def].val); -+ /* fall through */ - default: - sym->def[def].val = NULL; - sym->def[def].tri = no; - } - } - -- while (fgets(line, sizeof(line), in)) { -+ while (compat_getline(&line, &line_asize, in) != -1) { - conf_lineno++; - sym = NULL; -- switch (line[0]) { -- case '#': -- if (line[1] != ' ') -+ if (line[0] == '#') { -+ if (memcmp(line + 2, CONFIG_, strlen(CONFIG_))) - continue; -- p = strchr(line + 2, ' '); -+ p = strchr(line + 2 + strlen(CONFIG_), ' '); - if (!p) - continue; - *p++ = 0; - if (strncmp(p, "is not set", 10)) - continue; - if (def == S_DEF_USER) { -- sym = sym_find(line + 2); -+ sym = sym_find(line + 2 + strlen(CONFIG_)); - if (!sym) { - sym_add_change_count(1); -- break; -+ goto setsym; - } - } else { -- sym = sym_lookup(line + 2, 0); -+ sym = sym_lookup(line + 2 + strlen(CONFIG_), 0); - if (sym->type == S_UNKNOWN) - sym->type = S_BOOLEAN; - } -@@ -244,13 +338,10 @@ - default: - ; - } -- break; -- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': -- p = strchr(line, '='); -- if (!p) { -- conf_warning("unexpected data '%s'", line); -+ } else if (memcmp(line, CONFIG_, strlen(CONFIG_)) == 0) { -+ p = strchr(line + strlen(CONFIG_), '='); -+ if (!p) - continue; -- } - *p++ = 0; - p2 = strchr(p, '\n'); - if (p2) { -@@ -259,13 +350,13 @@ - *p2 = 0; - } - if (def == S_DEF_USER) { -- sym = sym_find(line); -+ sym = sym_find(line + strlen(CONFIG_)); - if (!sym) { - sym_add_change_count(1); -- break; -+ goto setsym; - } - } else { -- sym = sym_lookup(line, 0); -+ sym = sym_lookup(line + strlen(CONFIG_), 0); - if (sym->type == S_UNKNOWN) - sym->type = S_OTHER; - } -@@ -274,14 +365,12 @@ - } - if (conf_set_sym_val(sym, def, def_flags, p)) - continue; -- break; -- case '\r': -- case '\n': -- break; -- default: -- conf_warning("unexpected data"); -+ } else { -+ if (line[0] != '\r' && line[0] != '\n') -+ conf_warning("unexpected data"); - 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) { -@@ -302,6 +391,7 @@ - cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); - } - } -+ free(line); - fclose(in); - - if (modules_sym) -@@ -311,10 +401,8 @@ - - int conf_read(const char *name) - { -- struct symbol *sym, *choice_sym; -- struct property *prop; -- struct expr *e; -- int i, flags; -+ struct symbol *sym; -+ int i; - - sym_set_change_count(0); - -@@ -324,7 +412,7 @@ - for_all_symbols(i, sym) { - sym_calc_value(sym); - if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) -- goto sym_ok; -+ continue; - if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { - /* check that calculated value agrees with saved value */ - switch (sym->type) { -@@ -333,29 +421,18 @@ - if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) - break; - if (!sym_is_choice(sym)) -- goto sym_ok; -+ continue; -+ /* fall through */ - default: - if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) -- goto sym_ok; -+ continue; - break; - } - } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) - /* no previous value and not saved */ -- goto sym_ok; -+ continue; - conf_unsaved++; - /* maybe print value in verbose mode... */ -- sym_ok: -- if (!sym_is_choice(sym)) -- continue; -- /* The choice symbol only has a set value (and thus is not new) -- * if all its visible childs have values. -- */ -- prop = sym_get_choice_prop(sym); -- flags = sym->flags; -- expr_list_for_each_sym(prop->expr, e, choice_sym) -- if (choice_sym->visible != no) -- flags &= choice_sym->flags; -- sym->flags &= flags | ~SYMBOL_DEF_USER; - } - - for_all_symbols(i, sym) { -@@ -388,43 +465,300 @@ - return 0; - } - -+/* -+ * Kconfig configuration printer -+ * -+ * This printer is used when generating the resulting configuration after -+ * kconfig invocation and `defconfig' files. Unset symbol might be omitted by -+ * passing a non-NULL argument to the printer. -+ * -+ */ -+static void -+kconfig_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg) -+{ -+ -+ switch (sym->type) { -+ case S_BOOLEAN: -+ case S_TRISTATE: -+ if (*value == 'n') { -+ bool skip_unset = (arg != NULL); -+ -+ if (!skip_unset) -+ fprintf(fp, "# %s%s is not set\n", -+ CONFIG_, sym->name); -+ return; -+ } -+ break; -+ default: -+ break; -+ } -+ -+ fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, value); -+} -+ -+static void -+kconfig_print_comment(FILE *fp, const char *value, void *arg) -+{ -+ const char *p = value; -+ size_t l; -+ -+ for (;;) { -+ l = strcspn(p, "\n"); -+ fprintf(fp, "#"); -+ if (l) { -+ fprintf(fp, " "); -+ xfwrite(p, l, 1, fp); -+ p += l; -+ } -+ fprintf(fp, "\n"); -+ if (*p++ == '\0') -+ break; -+ } -+} -+ -+static struct conf_printer kconfig_printer_cb = -+{ -+ .print_symbol = kconfig_print_symbol, -+ .print_comment = kconfig_print_comment, -+}; -+ -+/* -+ * Header printer -+ * -+ * This printer is used when generating the `include/generated/autoconf.h' file. -+ */ -+static void -+header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg) -+{ -+ -+ switch (sym->type) { -+ case S_BOOLEAN: -+ case S_TRISTATE: { -+ const char *suffix = ""; -+ -+ switch (*value) { -+ case 'n': -+ break; -+ case 'm': -+ suffix = "_MODULE"; -+ /* fall through */ -+ default: -+ fprintf(fp, "#define %s%s%s 1\n", -+ CONFIG_, sym->name, suffix); -+ } -+ break; -+ } -+ case S_HEX: { -+ const char *prefix = ""; -+ -+ if (value[0] != '0' || (value[1] != 'x' && value[1] != 'X')) -+ prefix = "0x"; -+ fprintf(fp, "#define %s%s %s%s\n", -+ CONFIG_, sym->name, prefix, value); -+ break; -+ } -+ case S_STRING: -+ case S_INT: -+ fprintf(fp, "#define %s%s %s\n", -+ CONFIG_, sym->name, value); -+ break; -+ default: -+ break; -+ } -+ -+} -+ -+static void -+header_print_comment(FILE *fp, const char *value, void *arg) -+{ -+ const char *p = value; -+ size_t l; -+ -+ fprintf(fp, "/*\n"); -+ for (;;) { -+ l = strcspn(p, "\n"); -+ fprintf(fp, " *"); -+ if (l) { -+ fprintf(fp, " "); -+ xfwrite(p, l, 1, fp); -+ p += l; -+ } -+ fprintf(fp, "\n"); -+ if (*p++ == '\0') -+ break; -+ } -+ fprintf(fp, " */\n"); -+} -+ -+static struct conf_printer header_printer_cb = -+{ -+ .print_symbol = header_print_symbol, -+ .print_comment = header_print_comment, -+}; -+ -+/* -+ * Tristate printer -+ * -+ * This printer is used when generating the `include/config/tristate.conf' file. -+ */ -+static void -+tristate_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg) -+{ -+ -+ if (sym->type == S_TRISTATE && *value != 'n') -+ fprintf(fp, "%s%s=%c\n", CONFIG_, sym->name, (char)toupper(*value)); -+} -+ -+static struct conf_printer tristate_printer_cb = -+{ -+ .print_symbol = tristate_print_symbol, -+ .print_comment = kconfig_print_comment, -+}; -+ -+static void conf_write_symbol(FILE *fp, struct symbol *sym, -+ struct conf_printer *printer, void *printer_arg) -+{ -+ const char *str; -+ -+ switch (sym->type) { -+ case S_OTHER: -+ case S_UNKNOWN: -+ break; -+ case S_STRING: -+ str = sym_get_string_value(sym); -+ str = sym_escape_string_value(str); -+ printer->print_symbol(fp, sym, str, printer_arg); -+ free((void *)str); -+ break; -+ default: -+ str = sym_get_string_value(sym); -+ printer->print_symbol(fp, sym, str, printer_arg); -+ } -+} -+ -+sta