kbuild-next content
Subsystems (4)
I have been offline for a while - but found some time this weekend to do some kbuild work.
This is the patches that has accumulated in kbuild-next so far.
I have almost everything applied that I had queued up. So if there is something missing assume I deleted it by mistake and resend it to me.
I have a number of patches sitting in my local trees but I need to look over them once more before they are ready for public review.
This is mostly related to generated headers and simplfied vmlinux.lds scripts (Tim is eagerly await this...).
Patches will follow.
Sam
Amerigo Wang (2):
kbuild/headers_check: refine extern check
kbuild: clean up scripts/headers.sh
Cheng Renquan (1):
kbuild: remove extra ifdef/endif of top Makefile
David VomLehn (1):
kbuild/Documentation: Incorrect makefile syntax in example
Frans Pop (9):
kbuild, deb-pkg: minor general improvements in builddeb script kbuild, deb-pkg: refactor code to reduce duplication
kbuild, deb-pkg: fix 'file not found' error when building .deb package for arm kbuild, deb-pkg: pass Debian maintainer script parameters to packaging hook scripts kbuild, deb-pkg: allow to specify a custom revision for .deb packages kbuild, deb-pkg: allow alternative hook scripts directory in .deb packages kbuild, deb-pkg: improve changelog entry and package descriptions kbuild, deb-pkg: generate debian/copyright file
kbuild, deb-pkg: improve Source field
Jan Beulich (1):
initconst adjustments
Jiri Slaby (1):
kbuild: allow docproc invocation from external
Manish Katiyar (1):
kernel/kallsyms.c: replace deprecated __initcall with device_initcall and fix whitespace
Markus Heidelberg (10):
kconfig: fix typo "mconfig" to "menuconfig" in a comment
kconfig: add a note about the deps to the 'silentoldconfig' help
kconfig: resort the documentation of the environment variables
gitignore: ignore Kconfig i18n files
kconfig qconf: fix -Wall compiler warnings
kconfig qconf: fix namespace for Horizontal and Vertical enum values kconfig qconf: add namespace for use of Key_ enum values kconfig qconf: fix the type of the desktop widget
kconfig: do not hardcode ".config" filename
kconfig: do not hardcode "include/config/auto.conf" filename
Mike Frysinger (1):
ignore *.patch files
Peter Korsgaard (1):
kconfig: handle comment entries within choice/endchoice
Randy Dunlap (1):
menu: fix embedded menu presentation
Robert P. J. Day (1):
scripts/headers_check.pl: correct RE in header CONFIG leak check
Sam Ravnborg (2):
kbuild: fix header export when __ASSEMBLY__ is used
kbuild: add hint about __refdata to modpost
Sergei Poselenov (1):
kbuild: fix "Argument list too long" error for "make headers_check",
dann frazier (1):
Remove bashisms from scripts
maximilian attems (5):
kbuild, deb-pkg: improve maintainer identification kbuild, deb-pkg: fix generated package name kbuild, deb-pkg: fix Provides field kbuild, deb-pkg: fix Section field kbuild, deb-pkg: bump standards version
.gitignore | 1 + Documentation/kbuild/kconfig.txt | 116 ++++++++++++++------------- Documentation/kbuild/modules.txt | 2 +- Makefile | 26 ++---- README | 1 + include/asm-generic/vmlinux.lds.h | 5 +- include/linux/init.h | 3 +- init/Kconfig | 16 ++-- kernel/kallsyms.c | 134 ++++++++++++++++++------------- scripts/Makefile.headersinst | 8 ++- scripts/basic/docproc.c | 13 ++- scripts/gcc-version.sh | 2 +- scripts/headers.sh | 7 -- scripts/headers_check.pl | 16 +++-- scripts/headers_install.pl | 2 +- scripts/kconfig/.gitignore | 3 + scripts/kconfig/Makefile | 4 +- scripts/kconfig/conf.c | 7 +- scripts/kconfig/confdata.c | 20 +++-- scripts/kconfig/lkc.h | 1 + scripts/kconfig/lxdialog/checklist.c | 3 +- scripts/kconfig/mconf.c | 10 ++- scripts/kconfig/qconf.cc | 48 ++++++----- scripts/kconfig/util.c | 6 +- scripts/mod/modpost.c | 50 +++++++++--- scripts/package/builddeb | 149 +++++++++++++++++++++++----------- scripts/ver_linux | 2 +- 27 files changed, 395 insertions(+), 260 deletions(-)
PATCH 1/39 kconfig: handle comment entries within choice/endchoice
From: Peter Korsgaard <[email protected]>
Implement support for comment entries within choice groups. Comment entries are displayed visually distinct from normal configs, and selecting them is a no-op.
--- scripts/kconfig/lxdialog/checklist.c | 3 ++- scripts/kconfig/mconf.c | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-)
scripts/kconfig/lxdialog/checklist.c +2 -1
@@ -41,7 +41,8 @@ static void print_item(WINDOW * win, int choice, int selected)wmove (win, choice, check_x);wattrset (win, selected ? dlg.check_selected.atr : dlg.check.atr); -wprintw (win,"(%c)" ,item_is_tag ('X' ) ?'X' :' ' ); +if (!item_is_tag (':' )) +wprintw (win,"(%c)" ,item_is_tag ('X' ) ?'X' :' ' );wattrset (win, selected ? dlg.tag_selected.atr : dlg.tag.atr);mvwaddch (win, choice, item_x,item_str ()[0 ]);
scripts/kconfig/mconf.c +9 -1
@@ -732,7 +732,12 @@ static void conf_choice(struct menu *menu)for (child = menu->list; child; child = child->next) {if (!menu_is_visible (child))continue ; -item_make ("%s" ,_ (menu_get_prompt (child))); +if (child->sym) +item_make ("%s" ,_ (menu_get_prompt (child))); +else { +item_make ("*** %s ***" ,_ (menu_get_prompt (child))); +item_set_tag (':' ); + }item_set_data (child);if (child->sym == active)item_set_selected (1 );
@@ -748,6 +753,9 @@ static void conf_choice(struct menu *menu)case 0 :if (selected) { child =item_data (); +if (!child->sym) +break ; +sym_set_tristate_value (child->sym, yes); }return ;
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 2/39 kbuild, deb-pkg: minor general improvements in builddeb script
In reply to Sam RavnborgFrom: Frans Pop <[email protected]>
Minor coding style improvements and typo fix in leading comment.
--- scripts/package/builddeb | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-)
scripts/package/builddeb +10 -11
@@ -4,7 +4,7 @@ # Copyright 2003 Wichert Akkerman <[email protected]> # # Simple script to generate a deb package for a Linux kernel. All the -# complexity of what to do with a kernel after it is installer or removed +# complexity of what to do with a kernel after it is installed or removed # is left to other scripts and packages: they can install scripts in the # /etc/kernel/{pre,post}{inst,rm}.d/ directories that will be called on # package install and removal.
@@ -13,13 +13,13 @@ set -e # Some variables and settings used throughout the script version=$KERNELRELEASE -revision=`cat .version` +revision=$(cat .version) tmpdir="$objtree/debian/tmp" fwdir="$objtree/debian/fwtmp" packagename=linux-$version fwpackagename=linux-firmware-image -if [ "$ARCH" == "um" ] ; then +if [ "$ARCH" = "um" ] ; then packagename=user-mode-linux-$version fi
@@ -27,12 +27,12 @@ fi rm -rf "$tmpdir" "$fwdir" mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" -if [ "$ARCH" == "um" ] ; then +if [ "$ARCH" = "um" ] ; then mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin" fi # Build and install the kernel -if [ "$ARCH" == "um" ] ; then +if [ "$ARCH" = "um" ] ; then $MAKE linux cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" cp .config "$tmpdir/usr/share/doc/$packagename/config"
@@ -46,7 +46,7 @@ fi if grep -q '^CONFIG_MODULES=y' .config ; then INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install - if [ "$ARCH" == "um" ] ; then + if [ "$ARCH" = "um" ] ; then mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/" rmdir "$tmpdir/lib/modules/$version" fi
@@ -77,9 +77,8 @@ linux ($version-$revision) unstable; urgency=low EOF # Generate a control file -if [ "$ARCH" == "um" ]; then - -cat <<EOF > debian/control +if [ "$ARCH" = "um" ]; then + cat <<EOF > debian/control Source: linux Section: base Priority: optional
@@ -101,7 +100,7 @@ Description: User Mode Linux kernel, version $version EOF else -cat <<EOF > debian/control + cat <<EOF > debian/control Source: linux Section: base Priority: optional
@@ -116,6 +115,7 @@ Description: Linux kernel, version $version This package contains the Linux kernel, modules and corresponding other files version $version EOF + fi # Fix some ownership and permissions
@@ -143,4 +143,3 @@ dpkg-gencontrol -isp -p$packagename dpkg --build "$tmpdir" .. exit 0 -
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 3/39 kbuild, deb-pkg: refactor code to reduce duplication
In reply to Sam RavnborgFrom: Frans Pop <[email protected]>
Factor out code to build package into separate function and only write "source" section for the debian/control file once.
--- scripts/package/builddeb | 37 ++++++++++++++++++++----------------- 1 files changed, 20 insertions(+), 17 deletions(-)
scripts/package/builddeb +20 -17
@@ -11,6 +11,18 @@ set -e +create_package() { + local pname="$1" pdir="$2" + + # Fix ownership and permissions + chown -R root:root "$pdir" + chmod -R go-w "$pdir" + + # Create the package + dpkg-gencontrol -isp -p$pname -P"$pdir" + dpkg --build "$pdir" .. +} + # Some variables and settings used throughout the script version=$KERNELRELEASE revision=$(cat .version)
@@ -77,13 +89,16 @@ linux ($version-$revision) unstable; urgency=low EOF # Generate a control file -if [ "$ARCH" = "um" ]; then - cat <<EOF > debian/control +cat <<EOF > debian/control Source: linux Section: base Priority: optional Maintainer: $name Standards-Version: 3.6.1 +EOF + +if [ "$ARCH" = "um" ]; then + cat <<EOF >> debian/control Package: $packagename Provides: kernel-image-$version, linux-image-$version
@@ -100,12 +115,7 @@ Description: User Mode Linux kernel, version $version EOF else - cat <<EOF > debian/control -Source: linux -Section: base -Priority: optional -Maintainer: $name -Standards-Version: 3.6.1 + cat <<EOF >> debian/control Package: $packagename Provides: kernel-image-$version, linux-image-$version
@@ -118,10 +128,6 @@ EOF fi -# Fix some ownership and permissions -chown -R root:root "$tmpdir" -chmod -R go-w "$tmpdir" - # Do we have firmware? Move it out of the way and build it into a package. if [ -e "$tmpdir/lib/firmware" ]; then mv "$tmpdir/lib/firmware" "$fwdir/lib/"
@@ -134,12 +140,9 @@ Description: Linux kernel firmware, version $version This package contains firmware from the Linux kernel, version $version EOF - dpkg-gencontrol -isp -p$fwpackagename -P"$fwdir" - dpkg --build "$fwdir" .. + create_package "$fwpackagename" "$fwdir" fi -# Perform the final magic -dpkg-gencontrol -isp -p$packagename -dpkg --build "$tmpdir" .. +create_package "$packagename" "$tmpdir" exit 0
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 4/39 kbuild, deb-pkg: fix 'file not found' error when building .deb package for arm
In reply to Sam RavnborgFrom: Frans Pop <[email protected]>
Not all architectures prepend the $(boot) path in $(KBUILD_IMAGE). Allow for that fact in the builddeb script. Example is arm.
--- scripts/package/builddeb | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
scripts/package/builddeb +4 -1
@@ -53,7 +53,10 @@ if [ "$ARCH" = "um" ] ; then else cp System.map "$tmpdir/boot/System.map-$version" cp .config "$tmpdir/boot/config-$version" - cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" + # Not all arches include the boot path in KBUILD_IMAGE + if ! cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"; then + cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" + fi fi if grep -q '^CONFIG_MODULES=y' .config ; then
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 5/39 kbuild, deb-pkg: pass Debian maintainer script parameters to packaging hook scripts
In reply to Sam RavnborgFrom: Frans Pop <[email protected]>
The Debian packaging scripts created by the deb-pkg target do not pass on the standard Debian maintainer script parameters to hook scripts, which means that those scripts cannot tell whether they are being called during e.g. install vs. upgrade, or removal vs. purge of the package.
As there are several variantions in how hook scripts are called from kernel packages, we pass the parameters in the environment variable DEB_MAINT_PARAMS rather than as extra arguments.
Bump version of builddep script to 1.3.
--- scripts/package/builddeb | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
scripts/package/builddeb +4 -1
@@ -1,6 +1,6 @@ #!/bin/sh # -# builddeb 1.2 +# builddeb 1.3 # Copyright 2003 Wichert Akkerman <[email protected]> # # Simple script to generate a deb package for a Linux kernel. All the
@@ -75,6 +75,9 @@ for script in postinst postrm preinst prerm ; do set -e +# Pass maintainer script parameters to hook scripts +export DEB_MAINT_PARAMS="\$@" + test -d /etc/kernel/$script.d && run-parts --arg="$version" /etc/kernel/$script.d exit 0 EOF
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 6/39 kbuild, deb-pkg: allow to specify a custom revision for .deb packages
In reply to Sam RavnborgFrom: Frans Pop <[email protected]>
Allow to specify a custom revision for the generated .deb by exporting the environment variable KDEB_PKGVERSION.
--- scripts/package/builddeb | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
scripts/package/builddeb +6 -1
@@ -26,6 +26,11 @@ create_package() { # Some variables and settings used throughout the script version=$KERNELRELEASE revision=$(cat .version) +if [ -n "$KDEB_PKGVERSION" ]; then + packageversion=$KDEB_PKGVERSION +else + packageversion=$version-$revision +fi tmpdir="$objtree/debian/tmp" fwdir="$objtree/debian/fwtmp" packagename=linux-$version
@@ -87,7 +92,7 @@ done name="Kernel Compiler <$(id -nu)@$(hostname -f)>" # Generate a simple changelog template cat <<EOF > debian/changelog -linux ($version-$revision) unstable; urgency=low +linux ($packageversion) unstable; urgency=low * A standard release
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 7/39 kbuild, deb-pkg: allow alternative hook scripts directory in .deb packages
In reply to Sam RavnborgFrom: Frans Pop <[email protected]>
Hook scripts in the default directory /etc/kernel are also executed by official Debian kernel packages as well as kernel packages created using make-kpkg. Allow to specify an alternative hook scripts directory by exporting the environment variable KDEB_HOOKDIR.
--- scripts/package/builddeb | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
scripts/package/builddeb +8 -4
@@ -6,8 +6,9 @@ # Simple script to generate a deb package for a Linux kernel. All the # complexity of what to do with a kernel after it is installed or removed # is left to other scripts and packages: they can install scripts in the -# /etc/kernel/{pre,post}{inst,rm}.d/ directories that will be called on -# package install and removal. +# /etc/kernel/{pre,post}{inst,rm}.d/ directories (or an alternative location +# specified in KDEB_HOOKDIR) that will be called on package install and +# removal. set -e
@@ -73,8 +74,11 @@ if grep -q '^CONFIG_MODULES=y' .config ; then fi # Install the maintainer scripts +# Note: hook scripts under /etc/kernel are also executed by official Debian +# kernel packages, as well as kernel packages built using make-kpkg +debhookdir=${KDEB_HOOKDIR:-/etc/kernel} for script in postinst postrm preinst prerm ; do - mkdir -p "$tmpdir/etc/kernel/$script.d" + mkdir -p "$tmpdir$debhookdir/$script.d" cat <<EOF > "$tmpdir/DEBIAN/$script" #!/bin/sh
@@ -83,7 +87,7 @@ set -e # Pass maintainer script parameters to hook scripts export DEB_MAINT_PARAMS="\$@" -test -d /etc/kernel/$script.d && run-parts --arg="$version" /etc/kernel/$script.d +test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d exit 0 EOF chmod 755 "$tmpdir/DEBIAN/$script"
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 8/39 kbuild, deb-pkg: improve changelog entry and package descriptions
In reply to Sam RavnborgFrom: Frans Pop <[email protected]>
--- scripts/package/builddeb | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
scripts/package/builddeb +4 -4
@@ -98,7 +98,7 @@ name="Kernel Compiler <$(id -nu)@$(hostname -f)>" cat <<EOF > debian/changelog linux ($packageversion) unstable; urgency=low - * A standard release + * Custom built Linux kernel. -- $name $(date -R) EOF
@@ -126,7 +126,7 @@ Description: User Mode Linux kernel, version $version many other things. . This package contains the Linux kernel, modules and corresponding other - files version $version + files, version: $version. EOF else
@@ -138,7 +138,7 @@ Suggests: $fwpackagename Architecture: any Description: Linux kernel, version $version This package contains the Linux kernel, modules and corresponding other - files version $version + files, version: $version. EOF fi
@@ -152,7 +152,7 @@ if [ -e "$tmpdir/lib/firmware" ]; then Package: $fwpackagename Architecture: all Description: Linux kernel firmware, version $version - This package contains firmware from the Linux kernel, version $version + This package contains firmware from the Linux kernel, version $version. EOF create_package "$fwpackagename" "$fwdir"
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 9/39 kbuild, deb-pkg: generate debian/copyright file
In reply to Sam RavnborgFrom: Frans Pop <[email protected]>
On Thursday 23 April 2009, Frans Pop wrote:
Add a basic debian/copyright to the binary packages.
Based on an earlier patch from Maximilian Attems.
--- scripts/package/builddeb | 28 +++++++++++++++++++++++++--- 1 files changed, 25 insertions(+), 3 deletions(-)
scripts/package/builddeb +25 -3
@@ -15,6 +15,8 @@ set -e create_package() { local pname="$1" pdir="$2" + cp debian/copyright "$pdir/usr/share/doc/$pname/" + # Fix ownership and permissions chown -R root:root "$pdir" chmod -R go-w "$pdir"
@@ -43,10 +45,10 @@ fi # Setup the directory structure rm -rf "$tmpdir" "$fwdir" -mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" -mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" +mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" "$tmpdir/usr/share/doc/$packagename" +mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" "$fwdir/usr/share/doc/$fwpackagename" if [ "$ARCH" = "um" ] ; then - mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin" + mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin" fi # Build and install the kernel
@@ -103,6 +105,26 @@ linux ($packageversion) unstable; urgency=low -- $name $(date -R) EOF +# Generate copyright file +cat <<EOF > debian/copyright +This is a packacked upstream version of the Linux kernel. + +The sources may be found at most Linux ftp sites, including: +ftp://ftp.kernel.org/pub/linux/kernel + +Copyright: 1991 - 2009 Linus Torvalds and others. + +The git repository for mainline kernel development is at: +git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 dated June, 1991. + +On Debian GNU/Linux systems, the complete text of the GNU General Public +License version 2 can be found in \`/usr/share/common-licenses/GPL-2'. +EOF + # Generate a control file cat <<EOF > debian/control Source: linux
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 10/39 kbuild, deb-pkg: improve maintainer identification
In reply to Sam RavnborgFrom: maximilian attems <[email protected]>
Try harder to find email and maintainer name.
Debian's own devscripts all use DEBEMAIL or DEBFULLNAME prior to an eventual EMAIL or NAME environment variable. Match their logic.
"Anonymous" sounds nicer then "Kernel Compiler" if no name is found.
--- scripts/package/builddeb | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-)
scripts/package/builddeb +19 -3
@@ -95,14 +95,30 @@ EOF chmod 755 "$tmpdir/DEBIAN/$script" done -name="Kernel Compiler <$(id -nu)@$(hostname -f)>" +# Try to determine maintainer and email values +if [ -n "$DEBEMAIL" ]; then + email=$DEBEMAIL +elif [ -n "$EMAIL" ]; then + email=$EMAIL +else + email=$(id -nu)@$(hostname -f) +fi +if [ -n "$DEBFULLNAME" ]; then + name=$DEBFULLNAME +elif [ -n "$NAME" ]; then + name=$NAME +else + name="Anonymous" +fi +maintainer="$name <$email>" + # Generate a simple changelog template cat <<EOF > debian/changelog linux ($packageversion) unstable; urgency=low * Custom built Linux kernel. - -- $name $(date -R) + -- $maintainer $(date -R) EOF # Generate copyright file
@@ -130,7 +146,7 @@ cat <<EOF > debian/control Source: linux Section: base Priority: optional -Maintainer: $name +Maintainer: $maintainer Standards-Version: 3.6.1 EOF
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 11/39 kbuild, deb-pkg: improve Source field
In reply to Sam RavnborgFrom: Frans Pop <[email protected]>
The Source: field is defined as the source package in the package archive from which a binary packages are built. As deb-pkg does not generate a source package, we should avoid to use any existing source packages here.
--- scripts/package/builddeb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
scripts/package/builddeb +2 -2
@@ -114,7 +114,7 @@ maintainer="$name <$email>" # Generate a simple changelog template cat <<EOF > debian/changelog -linux ($packageversion) unstable; urgency=low +linux-upstream ($packageversion) unstable; urgency=low * Custom built Linux kernel.
@@ -143,7 +143,7 @@ EOF # Generate a control file cat <<EOF > debian/control -Source: linux +Source: linux-upstream Section: base Priority: optional Maintainer: $maintainer
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 12/39 kbuild, deb-pkg: fix generated package name
In reply to Sam RavnborgFrom: maximilian attems <[email protected]>
The binary package that make deb-pkg creates is a linux-image. To be fixed may also be the addition of $DEB_ARCH.
--- scripts/package/builddeb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/package/builddeb +1 -1
@@ -36,7 +36,7 @@ else fi tmpdir="$objtree/debian/tmp" fwdir="$objtree/debian/fwtmp" -packagename=linux-$version +packagename=linux-image-$version fwpackagename=linux-firmware-image if [ "$ARCH" = "um" ] ; then
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 13/39 kbuild, deb-pkg: fix Provides field
In reply to Sam RavnborgFrom: maximilian attems <[email protected]>
kernel-image naming has been dropped for the Lenny release and was only transitional for Etch.
As it builds modules it provides linux-modules-$version.
--- scripts/package/builddeb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
scripts/package/builddeb +2 -2
@@ -154,7 +154,7 @@ if [ "$ARCH" = "um" ]; then cat <<EOF >> debian/control Package: $packagename -Provides: kernel-image-$version, linux-image-$version +Provides: linux-image, linux-image-2.6, linux-modules-$version Architecture: any Description: User Mode Linux kernel, version $version User-mode Linux is a port of the Linux kernel to its own system call
@@ -171,7 +171,7 @@ else cat <<EOF >> debian/control Package: $packagename -Provides: kernel-image-$version, linux-image-$version +Provides: linux-image, linux-image-2.6, linux-modules-$version Suggests: $fwpackagename Architecture: any Description: Linux kernel, version $version
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 14/39 kbuild, deb-pkg: fix Section field
In reply to Sam RavnborgFrom: maximilian attems <[email protected]>
Section "base" has been removed, the base is defined by Priority field.
For Squeeze the section should be "kernel", but as that's not yet supported for Sarge and Etch we stay with admin for now.
--- scripts/package/builddeb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/package/builddeb +1 -1
@@ -144,7 +144,7 @@ EOF # Generate a control file cat <<EOF > debian/control Source: linux-upstream -Section: base +Section: admin Priority: optional Maintainer: $maintainer Standards-Version: 3.6.1
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 15/39 kbuild, deb-pkg: bump standards version
In reply to Sam RavnborgFrom: maximilian attems <[email protected]>
Latest Debian policy is 3.8.1.
Even if we are not yet compliant to it strive for the latest.
--- scripts/package/builddeb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/package/builddeb +1 -1
@@ -147,7 +147,7 @@ Source: linux-upstream Section: admin Priority: optional Maintainer: $maintainer -Standards-Version: 3.6.1 +Standards-Version: 3.8.1 EOF if [ "$ARCH" = "um" ]; then
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 16/39 initconst adjustments
In reply to Sam RavnborgFrom: Jan Beulich <[email protected]>
- add .init.rodata to INIT_DATA, and group all initconst flavors together
- move strings generated from __setup_param() into .init.rodata
- add .*init.rodata to modpost's sets of init sections
- make modpost warn about references between meminit and cpuinit as well as memexit and cpuexit sections (as CPU and memory hotplug are independently selectable features)
--- include/asm-generic/vmlinux.lds.h | 5 ++- include/linux/init.h | 3 +- scripts/mod/modpost.c | 48 +++++++++++++++++++++++++++++------- 3 files changed, 43 insertions(+), 13 deletions(-)
include/asm-generic/vmlinux.lds.h +3 -2
@@ -336,10 +336,11 @@#define INIT_DATA \ *(.init.data) \ DEV_DISCARD(init.data) \ - DEV_DISCARD(init.rodata) \ CPU_DISCARD(init.data) \ - CPU_DISCARD(init.rodata) \ MEM_DISCARD(init.data) \ + *(.init.rodata) \ + DEV_DISCARD(init.rodata) \ + CPU_DISCARD(init.rodata) \ MEM_DISCARD(init.rodata)#define INIT_TEXT \
include/linux/init.h +2 -1
@@ -225,7 +225,8 @@ struct obs_kernel_param {* obs_kernel_param "array" too far apart in .init.setup. */ #define __setup_param (str, unique_id, fn, early) \ - static char __setup_str_##unique_id[] __initdata __aligned(1) = str; \ + static const char __setup_str_##unique_id[] __initconst \ + __aligned(1) = str; \ static struct obs_kernel_param __setup_##unique_id \ __used __section(.init.setup) \ __attribute__((aligned((sizeof(long))))) \
scripts/mod/modpost.c +38 -10
77 lines not on this page · raw message
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 17/39 kbuild: fix header export when __ASSEMBLY__ is used
In reply to Sam Ravnborgunifdef got confused by:
Because it does not know __ASSEMBLY__ it does not detect that htis is not for userspace.
This caused too much code to be exported, and headers_check barfed over this code.
For arm this fixes following "make headers_check" warning:/usr/include/asm/hwcap.h:29: extern's make no sense in userspace
Russell King suggested to undefine __ASSEMBLY__ to fix this warning.
--- scripts/headers_install.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/headers_install.pl +1 -1
@@ -20,7 +20,7 @@ use strict; my ($readdir, $installdir, $arch, @files) = @ARGV; -my $unifdef = "scripts/unifdef -U__KERNEL__"; +my $unifdef = "scripts/unifdef -U__KERNEL__ -U__ASSEMBLY__"; foreach my $file (@files) { local *INFILE;
Signature · 1 line
1.6.3.rc3.40.g75b44
Arnd Bergmann
maintainerRe: [PATCH 17/39] kbuild: fix header export when __ASSEMBLY__ is used
Quoted 7 lines · Sam Ravnborg
Because it does not know
__ASSEMBLY__it does not detect that htis is not for userspace.
This caused too much code to be exported, andheaders_checkbarfed over this code.For arm this fixes following "make
headers_check" warning:/usr/include/asm/hwcap.h:29: extern's make no sense in userspace
Are you sure that this is safe for all user space? If a user application for instance includes asm/signal.h or asm/types.h from assembly (for whatever reason), it now breaks.
I can't think of a good reason why anyone would do such a thing, but it used to be possible.
Arnd <><
Re: [PATCH 17/39] kbuild: fix header export when __ASSEMBLY__ is used
Hello Sam, Russell,
Quoted 9 lines · Arnd Bergmann
Quoted 7 lines · Sam Ravnborg
Because it does not know
__ASSEMBLY__it does not detect that htis is not for userspace.
This caused too much code to be exported, andheaders_checkbarfed over this code.For arm this fixes following "make
headers_check" warning:/usr/include/asm/hwcap.h:29: extern's make no sense in userspace
Quoted 7 lines
Are you sure that this is safe for all user space? If a user application for instance includes
asm/signal.horasm/types.hfrom assembly (for whatever reason), it now breaks.I can't think of a good reason why anyone would do such a thing, but it used to be possible.
I also want to add :
__KERNEL__ and __ASSEMBLY__ is used for specific purpose, please do not mix them otherwise it leads to confusion and people will start using interchangeably. It seems to me that you are introducing Pink traffic light for stoppage so my request is to respect the protocols.
I do not think it is safe and this will screw some user-space apps and then later on kernel.
Thanks,
--
JSR
Re: [PATCH 17/39] kbuild: fix header export when __ASSEMBLY__ is used
In reply to Arnd BergmannQuoted 6 lines · Arnd Bergmann
Quoted 5 lines · Sam Ravnborg
Because it does not know
__ASSEMBLY__it does not detect that htis is not for userspace.
This caused too much code to be exported, andheaders_checkbarfed over this code.
Quoted 6 lines
Quoted 2 lines
For arm this fixes following "make
headers_check" warning:/usr/include/asm/hwcap.h:29: extern's make no sense in userspaceAre you sure that this is safe for all user space? If a user application for instance includes
asm/signal.horasm/types.hfrom assembly (for whatever reason), it now breaks.
I had not thought about this implication.
I will drop the patch as this most likely
will break some userspace.
Sam
Re: [PATCH 17/39] kbuild: fix header export when __ASSEMBLY__ is used
Quoted 10 lines · Sam Ravnborg
Quoted 9 lines · Arnd Bergmann
Quoted 7 lines · Sam Ravnborg
Because it does not know
__ASSEMBLY__it does not detect that htis is not for userspace.
This caused too much code to be exported, andheaders_checkbarfed over this code.For arm this fixes following "make
headers_check" warning:/usr/include/asm/hwcap.h:29: extern's make no sense in userspace
Quoted 7 lines
Quoted 3 lines
Are you sure that this is safe for all user space? If a user application for instance includes
asm/signal.horasm/types.hfrom assembly (for whatever reason), it now breaks.I had not thought about this implication.
I will drop the patch as this most likely
will break some userspace.
So now go back and re-read my original email. I was not suggesting to undefine __ASSEMBLY__ - I was more detailed in my _question_ which I was making, and there were _two_ possibilities.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
PATCH 18/39 kbuild/headers_check: refine extern check
In reply to Sam RavnborgFrom: Amerigo Wang <[email protected]>
'extern' checking information is not clear, refine it. Plus, fix a comment.
--- scripts/headers_check.pl | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
scripts/headers_check.pl +9 -5
@@ -2,7 +2,7 @@ # # headers_check.pl execute a number of trivial consistency checks # -# Usage: headers_check.pl dir [files...] +# Usage: headers_check.pl dir arch [files...] # dir: dir to look for included files # arch: architecture # files: list of files to check
@@ -37,7 +37,7 @@ foreach my $file (@files) { &check_include(); &check_asm_types(); &check_sizetypes(); - &check_prototypes(); + &check_declarations(); # Dropped for now. Too much noise &check_config(); } close FH;
@@ -61,10 +61,14 @@ sub check_include } } -sub check_prototypes +sub check_declarations { - if ($line =~ m/^\s*extern\b/) { - printf STDERR "$filename:$lineno: extern's make no sense in userspace\n"; + if ($line =~m/^\s*extern\b/) { + if ($line =~ m/^\s*extern\b.*\(.*\)/) { + printf STDERR "$filename:$lineno: extern's make no sense in userspace\n"; + } else { + printf STDERR "$filename:$lineno: exporting global variable to userspace is suspicious\n"; + } } }
Signature · 1 line
1.6.3.rc3.40.g75b44
Arnd Bergmann
maintainerRe: [PATCH 18/39] kbuild/headers_check: refine extern check
Quoted 7 lines · Sam Ravnborg
From: Amerigo Wang <[email protected]>
'extern' checking information is not clear, refine it. Plus, fix a comment.
Signed-off-by WANG Cong <[email protected]>Signed-off-by Sam Ravnborg <[email protected]>
I still think this is pointless and should just be removed (or replaced with a patch to kill the apostrophe in there).
Arnd <><
Re: [PATCH 18/39] kbuild/headers_check: refine extern check
Quoted 11 lines · Arnd Bergmann
Quoted 7 lines · Sam Ravnborg
From: Amerigo Wang <[email protected]>
'extern' checking information is not clear, refine it. Plus, fix a comment.
Signed-off-by WANG Cong <[email protected]>Signed-off-by Sam Ravnborg <[email protected]>I still think this is pointless and should just be removed (or replaced with a patch to kill the apostrophe in there).
So you wanted me to visit that link...
I redid it like this:
Subject: kbuild/headers_check: refine extern check
'extern' checking information is not clear, refine it. Plus, fix a comment.
---
scripts/headers_check.pl +7 -5
@@ -2,7 +2,7 @@ # # headers_check.pl execute a number of trivial consistency checks # -# Usage: headers_check.pl dir [files...] +# Usage: headers_check.pl dir arch [files...] # dir: dir to look for included files # arch: architecture # files: list of files to check
@@ -37,7 +37,7 @@ foreach my $file (@files) { &check_include(); &check_asm_types(); &check_sizetypes(); - &check_prototypes(); + &check_declarations(); # Dropped for now. Too much noise &check_config(); } close FH;
@@ -61,10 +61,12 @@ sub check_include } } -sub check_prototypes +sub check_declarations { - if ($line =~ m/^\s*extern\b/) { - printf STDERR "$filename:$lineno: extern's make no sense in userspace\n"; + if ($line =~m/^\s*extern\b/) { + printf STDERR "$filename:$lineno: " . + "userspace cannot call function or variable " . + "defined in the kernel\n"; } }
Re: [PATCH 18/39] kbuild/headers_check: refine extern check
Quoted 4 lines · Sam Ravnborg
Subject: kbuild/headers_check: refine extern check
'extern' checking information is not clear, refine it. Plus, fix a comment.
Thanks!
Quoted 3 lines
Signed-off-by WANG Cong <[email protected]>[sam: redid the extern error message]Signed-off-by Sam Ravnborg <[email protected]>
Re: [PATCH 18/39] kbuild/headers_check: refine extern check
In reply to Sam RavnborgQuoted 19 lines · Sam Ravnborg
Quoted 4 lines · Arnd Bergmann
Quoted 2 lines · Sam Ravnborg
From: Amerigo Wang <[email protected]>
Quoted 9 lines
Quoted 6 lines
'extern' checking information is not clear, refine it. Plus, fix a comment.
Signed-off-by WANG Cong <[email protected]>Signed-off-by Sam Ravnborg <[email protected]>I still think this is pointless and should just be removed (or replaced with a patch to kill the apostrophe in there).
So you wanted me to visit that link...
I redid it like this:
Quoted 9 lines
Subject: kbuild/headers_check: refine extern check
'extern' checking information is not clear, refine it. Plus, fix a comment.
Signed-off-by WANG Cong <[email protected]>[sam: redid the extern error message]Signed-off-by Sam Ravnborg <[email protected]>
Yeah, after reading Arnd's comments, I agree on this patch.
Thanks, Sam!
Quoted 40 lines
---
scripts/headers_check.pl +7
-5@@ -2,7 +2,7 @@ # # headers_check.pl execute a number of trivial consistency checks # -# Usage: headers_check.pl dir [files...] +# Usage: headers_check.pl dir arch [files...] # dir: dir to look for included files # arch: architecture # files: list of files to check@@ -37,7 +37,7 @@ foreach my $file (@files) { &check_include(); &check_asm_types(); &check_sizetypes(); - &check_prototypes(); + &check_declarations(); # Dropped for now. Too much noise &check_config(); } close FH;@@ -61,10 +61,12 @@ sub check_include } } -sub check_prototypes +sub check_declarations { - if ($line =~ m/^\s*extern\b/) { - printf STDERR "$filename:$lineno: extern's make no sense in userspace\n"; + if ($line =~m/^\s*extern\b/) { + printf STDERR "$filename:$lineno: " . + "userspace cannot call function or variable " . + "defined in the kernel\n"; } }
PATCH 19/39 kbuild: clean up scripts/headers.sh
In reply to Sam RavnborgFrom: Amerigo Wang <[email protected]>
'drop' variable is unused.
'ppc' and 'sparc64' directories don't exist in arch/, and I think their headers can be well exported now, so just remove them.
--- scripts/headers.sh | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)
scripts/headers.sh +0 -7
@@ -15,19 +15,12 @@ do_command() fi } -# Do not try this architecture -drop="generic um ppc sparc64 cris" - archs=$(ls ${srctree}/arch) for arch in ${archs}; do case ${arch} in um) # no userspace export ;; - ppc) # headers exported by powerpc - ;; - sparc64) # headers exported by sparc - ;; cris) # headers export are known broken ;; *)
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 20/39 kbuild: allow docproc invocation from external
In reply to Sam RavnborgFrom: Jiri Slaby <[email protected]>
- getcwd returns path without a slash at the end, add the slash
- add KBUILD_SRC env support, so that we can specify path for kernel (to know where scripts/kernel-doc resides) and SRCTREE (for searching files referenced in .tmpl) separately
[v2]
- use KBUILD_SRC instead of a newly introduced environment variable
--- scripts/basic/docproc.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
scripts/basic/docproc.c +9 -4
@@ -69,7 +69,7 @@ FILELINE * docsection;#define NOFUNCTION "-nofunction"#define NODOCSECTIONS "-no-doc-sections" -char *srctree; +static char *srctree, *kernsrctree;void usage (void ) {
@@ -77,7 +77,8 @@ void usage (void)fprintf (stderr,"Input is read from file.tmpl. Output is sent to stdout\n" );fprintf (stderr,"doc: frontend when generating kernel documentation\n" );fprintf (stderr,"depend: generate list of files referenced within file\n" ); -fprintf (stderr,"Environment variable SRCTREE: absolute path to kernel source tree.\n" ); +fprintf (stderr,"Environment variable SRCTREE: absolute path to sources.\n" ); +fprintf (stderr," KBUILD_SRC: absolute path to kernel source tree.\n" ); }/*
@@ -96,8 +97,8 @@ void exec_kernel_doc(char **svec)exit (1 );case 0 :memset (real_filename,0 ,sizeof (real_filename)); -strncat (real_filename, srctree,PATH_MAX ); - strncat(real_filename, KERNELDOCPATH KERNELDOC, +strncat (real_filename, kernsrctree,PATH_MAX ); +strncat (real_filename,"/" KERNELDOCPATH KERNELDOC ,PATH_MAX -strlen (real_filename));execvp (real_filename, svec);fprintf (stderr,"exec " );
@@ -178,6 +179,7 @@ void find_export_symbols(char * filename)char real_filename[PATH_MAX +1 ];memset (real_filename,0 ,sizeof (real_filename));strncat (real_filename, srctree,PATH_MAX ); +strncat (real_filename,"/" ,PATH_MAX -strlen (real_filename));strncat (real_filename, filename,PATH_MAX -strlen (real_filename)); sym =add_new_file (filename);
@@ -382,6 +384,9 @@ int main(int argc, char *argv[]) srctree =getenv ("SRCTREE" );if (!srctree) srctree =getcwd (NULL ,0 ); + kernsrctree =getenv ("KBUILD_SRC" ); +if (!kernsrctree) + kernsrctree = srctree;if (argc !=3 ) {usage ();exit (1 );
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 21/39 kbuild/Documentation: Incorrect makefile syntax in example
In reply to Sam RavnborgFrom: David VomLehn <[email protected]>
There is an error in the make syntax for one of the kbuild examples
--- Documentation/kbuild/modules.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/kbuild/modules.txt +1 -1
@@ -275,7 +275,7 @@ following files: KERNELDIR := /lib/modules/`uname -r`/build all:: - $(MAKE) -C $KERNELDIR M=`pwd` $@ + $(MAKE) -C $(KERNELDIR) M=`pwd` $@ # Module specific targets genbin:
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 22/39 kbuild: remove extra ifdef/endif of top Makefile
In reply to Sam RavnborgFrom: Cheng Renquan <[email protected]>
The GNU make's origin function know undefined variable well, so the outer ifdef/endif conditional checking is unneeded.
From info make documentation, origin will return
`undefined'
if VARIABLE was never defined.
`command line'
if VARIABLE was defined on the command line.
...
Therefore, $(origin V) will get a value anyway, killing ifdef/endif is viable and safe.
Furthermore, I've checked the minimal requirements from Documentation/Changes is GNU make 3.79.1, and that version of GNU make has support of origin function well already, so now it's safe to kill the outer conditional checking, without upgrading the minimal requirements.
--- Makefile | 26 +++++++++----------------- 1 files changed, 9 insertions(+), 17 deletions(-)
Makefile +9 -17
@@ -35,10 +35,8 @@ MAKEFLAGS += -rR --no-print-directory # To put more focus on warnings, be less verbose as default # Use 'make V=1' to see the full commands -ifdef V - ifeq ("$(origin V)", "command line") - KBUILD_VERBOSE = $(V) - endif +ifeq ("$(origin V)", "command line") + KBUILD_VERBOSE = $(V) endif ifndef KBUILD_VERBOSE KBUILD_VERBOSE = 0
@@ -54,10 +52,8 @@ endif # See the file "Documentation/sparse.txt" for more details, including # where to get the "sparse" utility. -ifdef C - ifeq ("$(origin C)", "command line") - KBUILD_CHECKSRC = $(C) - endif +ifeq ("$(origin C)", "command line") + KBUILD_CHECKSRC = $(C) endif ifndef KBUILD_CHECKSRC KBUILD_CHECKSRC = 0
@@ -69,12 +65,10 @@ endif ifdef SUBDIRS KBUILD_EXTMOD ?= $(SUBDIRS) endif -ifdef M - ifeq ("$(origin M)", "command line") - KBUILD_EXTMOD := $(M) - endif -endif +ifeq ("$(origin M)", "command line") + KBUILD_EXTMOD := $(M) +endif # kbuild supports saving output files in a separate directory. # To locate output files in a separate directory two syntaxes are supported.
@@ -98,10 +92,8 @@ ifeq ($(KBUILD_SRC),) # OK, Make called in directory where kernel src resides # Do we want to locate output files in a separate directory? -ifdef O - ifeq ("$(origin O)", "command line") - KBUILD_OUTPUT := $(O) - endif +ifeq ("$(origin O)", "command line") + KBUILD_OUTPUT := $(O) endif # That's our default target when none is given on the command line
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 23/39 kconfig: fix typo "mconfig" to "menuconfig" in a comment
In reply to Sam RavnborgFrom: Markus Heidelberg <[email protected]>
--- scripts/kconfig/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/kconfig/Makefile +1 -1
@@ -104,7 +104,7 @@ HOST_EXTRACFLAGS += -DLOCALE # =========================================================================== # Shared Makefile for the various kconfig executables: # conf: Used for defconfig, oldconfig and related targets -# mconf: Used for the mconfig target. +# mconf: Used for the menuconfig target # Utilizes the lxdialog package # qconf: Used for the xconfig target # Based on QT which needs to be installed to compile it
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 24/39 kconfig: add a note about the deps to the 'silentoldconfig' help
In reply to Sam RavnborgFrom: Markus Heidelberg <[email protected]>
--- README | 1 + scripts/kconfig/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-)
README +1 -0
@@ -174,6 +174,7 @@ CONFIGURING the kernel: "make silentoldconfig" Like above, but avoids cluttering the screen with questions already answered. + Additionally updates the dependencies. "make defconfig" Create a ./.config file by using the default symbol values from arch/$ARCH/defconfig. "make allyesconfig"
scripts/kconfig/Makefile +1 -1
@@ -83,7 +83,7 @@ help: @echo ' xconfig - Update current config utilising a QT based front-end' @echo ' gconfig - Update current config utilising a GTK based front-end' @echo ' oldconfig - Update current config utilising a provided .config as base' - @echo ' silentoldconfig - Same as oldconfig, but quietly' + @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' @echo ' randconfig - New config with random answer to all options' @echo ' defconfig - New config with default answer to all options' @echo ' allmodconfig - New config selecting modules when possible'
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 25/39 kconfig: resort the documentation of the environment variables
In reply to Sam RavnborgFrom: Markus Heidelberg <[email protected]>
All the KCONFIG_ environment variables were previously located in a section "Environment variables in 'menuconfig'", but neither are they restricted to 'menuconfig' nor are they all used by 'menuconfig'.
Introduce the following three sections for these variables:
* Environment variables for '*config'
* Environment variables for '{allyes/allmod/allno/rand}config'
* Environment variables for 'silentoldconfig'
Furthermore this puts MENUCONFIG_MODE next to MENUCONFIG_COLOR into a common section "User interface options for 'menuconfig'".
--- Documentation/kbuild/kconfig.txt | 116 +++++++++++++++++++------------------ 1 files changed, 60 insertions(+), 56 deletions(-)
Documentation/kbuild/kconfig.txt +60 -56
@@ -35,48 +35,26 @@ new .config files to see the differences: (Yes, we need something better here.) - -====================================================================== -menuconfig --------------------------------------------------- - -SEARCHING for CONFIG symbols - -Searching in menuconfig: - - The Search function searches for kernel configuration symbol - names, so you have to know something close to what you are - looking for. - - Example: - /hotplug - This lists all config symbols that contain "hotplug", - e.g., HOTPLUG, HOTPLUG_CPU, MEMORY_HOTPLUG. - - For search help, enter / followed TAB-TAB-TAB (to highlight - <Help>) and Enter. This will tell you that you can also use - regular expressions (regexes) in the search string, so if you - are not interested in MEMORY_HOTPLUG, you could try - - /^hotplug - - ______________________________________________________________________ -Color Themes for 'menuconfig' +Environment variables for '*config' -It is possible to select different color themes using the variable -MENUCONFIG_COLOR. To select a theme use: +KCONFIG_CONFIG +-------------------------------------------------- +This environment variable can be used to specify a default kernel config +file name to override the default name of ".config". - make MENUCONFIG_COLOR=<theme> menuconfig +KCONFIG_OVERWRITECONFIG +-------------------------------------------------- +If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not +break symlinks when .config is a symlink to somewhere else. -Available themes are: - mono => selects colors suitable for monochrome displays - blackbg => selects a color scheme with black background - classic => theme with blue background. The classic look - bluetitle => a LCD friendly version of classic. (default) +KCONFIG_NOTIMESTAMP +-------------------------------------------------- +If this environment variable exists and is non-null, the timestamp line +in generated .config files is omitted. ______________________________________________________________________ -Environment variables in 'menuconfig' +Environment variables for '{allyes/allmod/allno/rand}config' KCONFIG_ALLCONFIG --------------------------------------------------
@@ -95,8 +73,7 @@ values. This enables you to create "miniature" config (miniconfig) or custom config files containing just the config symbols that you are interested in. Then the kernel config system generates the full .config file, -including dependencies of your miniconfig file, based on the miniconfig -file. +including symbols of your miniconfig file. This 'KCONFIG_ALLCONFIG' file is a config file which contains (usually a subset of all) preset config symbols. These variable
@@ -113,26 +90,14 @@ These examples will disable most options (allnoconfig) but enable or disable the options that are explicitly listed in the specified mini-config files. +______________________________________________________________________ +Environment variables for 'silentoldconfig' + KCONFIG_NOSILENTUPDATE -------------------------------------------------- If this variable has a non-blank value, it prevents silent kernel config udpates (requires explicit updates). -KCONFIG_CONFIG --------------------------------------------------- -This environment variable can be used to specify a default kernel config -file name to override the default name of ".config". - -KCONFIG_OVERWRITECONFIG --------------------------------------------------- -If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not -break symlinks when .config is a symlink to somewhere else. - -KCONFIG_NOTIMESTAMP --------------------------------------------------- -If this environment variable exists and is non-null, the timestamp line -in generated .config files is omitted. - KCONFIG_AUTOCONFIG -------------------------------------------------- This environment variable can be set to specify the path & name of the
@@ -143,15 +108,54 @@ KCONFIG_AUTOHEADER This environment variable can be set to specify the path & name of the "autoconf.h" (header) file. Its default value is "include/linux/autoconf.h". + +====================================================================== +menuconfig +-------------------------------------------------- + +SEARCHING for CONFIG symbols + +Searching in menuconfig: + + The Search function searches for kernel configuration symbol + names, so you have to know something close to what you are + looking for. + + Example: + /hotplug + This lists all config symbols that contain "hotplug", + e.g., HOTPLUG, HOTPLUG_CPU, MEMORY_HOTPLUG. + + For search help, enter / followed TAB-TAB-TAB (to highlight + <Help>) and Enter. This will tell you that you can also use + regular expressions (regexes) in the search string, so if you + are not interested in MEMORY_HOTPLUG, you could try + + /^hotplug + ______________________________________________________________________ -menuconfig User Interface Options ----------------------------------------------------------------------- +User interface options for 'menuconfig' + +MENUCONFIG_COLOR +-------------------------------------------------- +It is possible to select different color themes using the variable +MENUCONFIG_COLOR. To select a theme use: + + make MENUCONFIG_COLOR=<theme> menuconfig + +Available themes are: + mono => selects colors suitable for monochrome displays + blackbg => selects a color scheme with black background + classic => theme with blue background. The classic look + bluetitle => a LCD friendly version of classic. (default) + MENUCONFIG_MODE -------------------------------------------------- This mode shows all sub-menus in one large tree. Example: - MENUCONFIG_MODE=single_menu make menuconfig + make MENUCONFIG_MODE=single_menu menuconfig + ====================================================================== xconfig
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 26/39 gitignore: ignore Kconfig i18n files
In reply to Sam RavnborgFrom: Markus Heidelberg <[email protected]>
--- scripts/kconfig/.gitignore | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
scripts/kconfig/.gitignore +3 -0
@@ -8,6 +8,9 @@ lex.*.c zconf.hash.c *.moc lkc_defs.h +gconf.glade.h +*.pot +*.mo # # configuration programs
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 27/39 kconfig qconf: fix -Wall compiler warnings
In reply to Sam RavnborgFrom: Markus Heidelberg <[email protected]>
These compiler warnings occure when adding -Wall to HOSTCXXFLAGS in /Makefile
scripts/kconfig/qconf.h: In constructor ‘ConfigInfoView::ConfigInfoView(QWidget*, const char*)’:scripts/kconfig/qconf.h:274: warning: ‘ConfigInfoView::menu’ will be initialized afterscripts/kconfig/qconf.h:273: warning: ‘symbol* ConfigInfoView::sym’scripts/kconfig/qconf.cc:922: warning: when initialized here
scripts/kconfig/qconf.cc: In member function ‘void ConfigMainWindow::setMenuLink(menu*)’:scripts/kconfig/qconf.cc:1498: warning: enumeration value ‘menuMode’ not handled in switch scripts/kconfig/qconf.cc:1498: warning: enumeration value ‘listMode’ not handled in switch
scripts/kconfig/qconf.cc: In member function ‘void ConfigMainWindow::saveSettings()’:scripts/kconfig/qconf.cc:1664: warning: enumeration value ‘menuMode’ not handled in switch scripts/kconfig/qconf.cc:1664: warning: enumeration value ‘listMode’ not handled in switch
--- scripts/kconfig/qconf.cc | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
scripts/kconfig/qconf.cc +6 -1
@@ -920,7 +920,7 @@ void ConfigView::updateListAll(void) } ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) - : Parent(parent, name), menu(0), sym(0) + : Parent(parent, name), sym(0), menu(0) { if (name) { configSettings->beginGroup(name);
@@ -1524,6 +1524,8 @@ void ConfigMainWindow::setMenuLink(struct menu *menu) case fullMode: list = configList; break; + default: + break; } if (list) {
@@ -1673,6 +1675,9 @@ void ConfigMainWindow::saveSettings(void) case fullMode : entry = "full"; break; + + default: + break; } configSettings->writeEntry("/listMode", entry);
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 28/39 kconfig qconf: fix namespace for Horizontal and Vertical enum values
In reply to Sam RavnborgFrom: Markus Heidelberg <[email protected]>
They were used as QSplitter::Horizontal resp. QSplitter::Vertical, but are defined in the 'Qt' namespace.
Fixes the following compiler errors after a quick conversion with 'qt3to4', which occured with g++ 3.4.6 and 4.1.2, but not anymore with 4.3.2.
scripts/kconfig/qconf.cc: In constructor 'ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow*, const char*)':scripts/kconfig/qconf.cc:1213: error: 'Vertical' is not a member of 'QSplitter'
scripts/kconfig/qconf.cc: In constructor 'ConfigMainWindow::ConfigMainWindow()':scripts/kconfig/qconf.cc:1304: error: 'Horizontal' is not a member of 'QSplitter' scripts/kconfig/qconf.cc:1311: error: 'Vertical' is not a member of 'QSplitter'
--- scripts/kconfig/qconf.cc | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
scripts/kconfig/qconf.cc +3 -3
@@ -1199,7 +1199,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam layout1->addLayout(layout2); split = new QSplitter(this); - split->setOrientation(QSplitter::Vertical); + split->setOrientation(Qt::Vertical); list = new ConfigView(split, name); list->list->mode = listMode; info = new ConfigInfoView(split, name);
@@ -1290,14 +1290,14 @@ ConfigMainWindow::ConfigMainWindow(void) move(x, y); split1 = new QSplitter(this); - split1->setOrientation(QSplitter::Horizontal); + split1->setOrientation(Qt::Horizontal); setCentralWidget(split1); menuView = new ConfigView(split1, "menu"); menuList = menuView->list; split2 = new QSplitter(split1); - split2->setOrientation(QSplitter::Vertical); + split2->setOrientation(Qt::Vertical); // create config tree configView = new ConfigView(split2, "config");
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 29/39 kconfig qconf: add namespace for use of Key_ enum values
In reply to Sam RavnborgFrom: Markus Heidelberg <[email protected]>
They are defined in the 'Qt' namespace.
Fixes the following compiler errors after a quick conversion with 'qt3to4', which occured with g++ 3.4.6 and 4.1.2, but not anymore with 4.3.2.
scripts/kconfig/qconf.cc: In member function 'virtual void ConfigLineEdit::keyPressEvent(QKeyEvent*)':scripts/kconfig/qconf.cc:311: error: 'Key_Escape' was not declared in this scope scripts/kconfig/qconf.cc:313: error: 'Key_Return' was not declared in this scope scripts/kconfig/qconf.cc:314: error: 'Key_Enter' was not declared in this scope
scripts/kconfig/qconf.cc: In member function 'virtual void ConfigList::keyPressEvent(QKeyEvent*)':scripts/kconfig/qconf.cc:653: error: 'Key_Escape' was not declared in this scope scripts/kconfig/qconf.cc:666: error: 'Key_Return' was not declared in this scope scripts/kconfig/qconf.cc:667: error: 'Key_Enter' was not declared in this scope scripts/kconfig/qconf.cc:681: error: 'Key_Space' was not declared in this scope scripts/kconfig/qconf.cc:684: error: 'Key_N' was not declared in this scope scripts/kconfig/qconf.cc:687: error: 'Key_M' was not declared in this scope scripts/kconfig/qconf.cc:690: error: 'Key_Y' was not declared in this scope
scripts/kconfig/qconf.cc: In constructor 'ConfigMainWindow::ConfigMainWindow()':scripts/kconfig/qconf.cc:1329: error: 'CTRL' was not declared in this scope scripts/kconfig/qconf.cc:1329: error: 'Key_Q' was not declared in this scope scripts/kconfig/qconf.cc:1331: error: 'Key_L' was not declared in this scope scripts/kconfig/qconf.cc:1333: error: 'Key_S' was not declared in this scope scripts/kconfig/qconf.cc:1340: error: 'Key_F' was not declared in this scope
--- scripts/kconfig/qconf.cc | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-)
scripts/kconfig/qconf.cc +14 -14
@@ -297,10 +297,10 @@ void ConfigLineEdit::show(ConfigItem* i) void ConfigLineEdit::keyPressEvent(QKeyEvent* e) { switch (e->key()) { - case Key_Escape: + case Qt::Key_Escape: break; - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: sym_set_string_value(item->menu->sym, text().latin1()); parent()->updateList(item); break;
@@ -639,7 +639,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) struct menu *menu; enum prop_type type; - if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) { + if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) { emit parentSelected(); ev->accept(); return;
@@ -652,8 +652,8 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) item = (ConfigItem*)i; switch (ev->key()) { - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: if (item->goParent) { emit parentSelected(); break;
@@ -667,16 +667,16 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) emit menuSelected(menu); break; } - case Key_Space: + case Qt::Key_Space: changeValue(item); break; - case Key_N: + case Qt::Key_N: setValue(item, no); break; - case Key_M: + case Qt::Key_M: setValue(item, mod); break; - case Key_Y: + case Qt::Key_Y: setValue(item, yes); break; default:
@@ -1315,18 +1315,18 @@ ConfigMainWindow::ConfigMainWindow(void) backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); connect(backAction, SIGNAL(activated()), SLOT(goBack())); backAction->setEnabled(FALSE); - QAction *quitAction = new QAction("Quit", _("&Quit"), CTRL+Key_Q, this); + QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this); connect(quitAction, SIGNAL(activated()), SLOT(close())); - QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), CTRL+Key_L, this); + QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this); connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); - saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), CTRL+Key_S, this); + saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this); connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); conf_set_changed_callback(conf_changed); // Set saveAction's initial state conf_changed(); QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); - QAction *searchAction = new QAction("Find", _("&Find"), CTRL+Key_F, this); + QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this); connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 30/39 kconfig qconf: fix the type of the desktop widget
In reply to Sam RavnborgFrom: Markus Heidelberg <[email protected]>
QApplication::desktop() returns a pointer to QDesktopWidget, not to QWidget.
Fixes the following compiler error after a quick conversion with 'qt3to4', which occured with g++ 3.4.6 and 4.1.2, but not anymore with 4.3.2.
scripts/kconfig/qconf.cc: In constructor 'ConfigMainWindow::ConfigMainWindow()':scripts/kconfig/qconf.cc:1289: error: cannot convert 'QDesktopWidget*' to 'QWidget*' in initialization
--- scripts/kconfig/qconf.cc | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
scripts/kconfig/qconf.cc +2 -1
@@ -5,6 +5,7 @@ #include <qapplication.h> #include <qmainwindow.h> +#include <qdesktopwidget.h> #include <qtoolbar.h> #include <qlayout.h> #include <qvbox.h>
@@ -1275,7 +1276,7 @@ ConfigMainWindow::ConfigMainWindow(void) int x, y, width, height; char title[256]; - QWidget *d = configApp->desktop(); + QDesktopWidget *d = configApp->desktop(); snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration"), getenv("KERNELVERSION")); setCaption(title);
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 31/39 kconfig: do not hardcode ".config" filename
In reply to Sam RavnborgFrom: Markus Heidelberg <[email protected]>
Rather than hardcoding ".config" use conf_get_configname(), which also respects the environment variable KCONFIG_CONFIG.
This fixes "make silentoldconfig" when KCONFIG_CONFIG is used and also suggests the given filename for "Load" and "Save as" in qconf.
--- scripts/kconfig/conf.c | 7 ++++--- scripts/kconfig/qconf.cc | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-)
scripts/kconfig/conf.c +4 -3
@@ -498,14 +498,15 @@ int main(int ac, char **av)conf_parse (name);//zconfdump(stdout); if (sync_kconfig) { -if (stat (".config" , &tmpstat)) { + name =conf_get_configname (); +if (stat (name, &tmpstat)) {fprintf (stderr,_ ("***\n" "*** You have not yet configured your kernel!\n" -"*** (missing kernel .config file)\n" +"*** (missing kernel config file \"%s\")\n" "***\n" "*** Please run some configurator (e.g. \"make oldconfig\" or\n" "*** \"make menuconfig\" or \"make xconfig\").\n" -"***\n" )); +"***\n" ), name);exit (1 ); } }
scripts/kconfig/qconf.cc +2 -2
@@ -1448,7 +1448,7 @@ ConfigMainWindow::ConfigMainWindow(void) void ConfigMainWindow::loadConfig(void) { - QString s = QFileDialog::getOpenFileName(".config", NULL, this); + QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this); if (s.isNull()) return; if (conf_read(QFile::encodeName(s)))
@@ -1464,7 +1464,7 @@ void ConfigMainWindow::saveConfig(void) void ConfigMainWindow::saveConfigAs(void) { - QString s = QFileDialog::getSaveFileName(".config", NULL, this); + QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this); if (s.isNull()) return; if (conf_write(QFile::encodeName(s)))
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 32/39 kconfig: do not hardcode "include/config/auto.conf" filename
In reply to Sam RavnborgFrom: Markus Heidelberg <[email protected]>
Regardless of KCONFIG_AUTOCONFIG, the filename written as a Make target into "include/config/auto.conf.cmd" was always the default one.
Of course this doesn't make it work for the Kernel kbuild system, since there the filename is hardcoded at several places in the Makefiles.
--- scripts/kconfig/confdata.c | 20 ++++++++++++-------- scripts/kconfig/lkc.h | 1 + scripts/kconfig/util.c | 6 +++--- 3 files changed, 16 insertions(+), 11 deletions(-)
scripts/kconfig/confdata.c +12 -8
@@ -41,6 +41,13 @@ const char *conf_get_configname(void)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;
@@ -555,15 +562,14 @@ int conf_write(const char *name)int conf_split_config (void ) { -char *name, path[128 ]; +const char *name; +char path[128 ];char *s, *d, c;struct symbol *sym;struct stat sb;int res, i, fd; - name =getenv ("KCONFIG_AUTOCONFIG" ); -if (!name) - name ="include/config/auto.conf" ; + name =conf_get_autoconfig_name ();conf_read_simple (name,S_DEF_AUTO );if (chdir ("include/config" ))
@@ -670,7 +676,7 @@ int conf_write_autoconf(void) {struct symbol *sym;const char *str; -char *name; +const char *name;FILE *out, *out_h;time_t now;int i, l;
@@ -773,9 +779,7 @@ int conf_write_autoconf(void) name ="include/linux/autoconf.h" ;if (rename (".tmpconfig.h" , name))return 1 ; - name =getenv ("KCONFIG_AUTOCONFIG" ); -if (!name) - name ="include/config/auto.conf" ; + 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.
scripts/kconfig/lkc.h +1 -0
@@ -74,6 +74,7 @@ char *zconf_curname(void);/* confdata.c */ const char *conf_get_configname (void ); +const char *conf_get_autoconfig_name (void );char *conf_get_default_confname (void );void sym_set_change_count (int count);void sym_add_change_count (int count);
scripts/kconfig/util.c +3 -3
@@ -46,8 +46,8 @@ int file_write_dep(const char *name)else fprintf (out,"\t%s\n" , file->name); } -fprintf (out,"\ninclude/config/auto.conf: \\\n" -"\t$(deps_config)\n\n" ); +fprintf (out,"\n%s: \\\n" +"\t$(deps_config)\n\n" ,conf_get_autoconfig_name ());expr_list_for_each_sym (sym_env_list, e, sym) {struct property *prop;
@@ -61,7 +61,7 @@ int file_write_dep(const char *name)if (!value) value ="" ;fprintf (out,"ifneq \"$(%s)\" \"%s\"\n" , env_sym->name, value); -fprintf (out,"include/config/auto.conf: FORCE\n" ); +fprintf (out,"%s: FORCE\n" ,conf_get_autoconfig_name ());fprintf (out,"endif\n" ); }
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 33/39 kernel/kallsyms.c: replace deprecated __initcall with device_initcall and fix whitespace
In reply to Sam RavnborgFrom: Manish Katiyar <[email protected]>
Fix coding style whitespace issues and replace __initcall with device_initcall. Fixed multi-line comments as per coding style.
Errors as reported by checkpatch.pl :-
Before:
total: 14 errors, 14 warnings, 487 lines checked
After :
total: 0 errors, 8 warnings, 507 lines checked
Compile tested binary verified as :-
Before:
text data bss dec hex filename
2405 4 0 2409 969 kernel/kallsyms.o
After :
text data bss dec hex filename
2405 4 0 2409 969 kernel/kallsyms.o
--- kernel/kallsyms.c | 134 +++++++++++++++++++++++++++++++---------------------- 1 files changed, 78 insertions(+), 56 deletions(-)
kernel/kallsyms.c +78 -56
@@ -30,12 +30,16 @@#define all_var 0#endif -/* These will be re-linked against their real values during the second link stage */ +/* +* These will be re-linked against their real values +* during the second link stage. +*/ extern const unsigned long kallsyms_addresses[] __attribute__((weak)); extern const u8 kallsyms_names[] __attribute__((weak)); -/* tell the compiler that the count isn't in the small data section if the arch -* has one (eg: FRV) +/* +* Tell the compiler that the count isn't in the small data section if the arch +* has one (eg: FRV). */ extern const unsigned long kallsyms_num_syms __attribute__((weak, section(".rodata")));
@@ -75,31 +79,37 @@ static int is_ksym_addr(unsigned long addr)return is_kernel_text (addr) ||is_kernel_inittext (addr); } -/* expand a compressed symbol data into the resulting uncompressed string, -given the offset to where the symbol is in the compressed stream */ +/* +* Expand a compressed symbol data into the resulting uncompressed string, +* given the offset to where the symbol is in the compressed stream. +*/ static unsigned int kallsyms_expand_symbol (unsigned int off,char *result) {int len, skipped_first =0 ;const u8 *tptr, *data; -/* get the compressed symbol length from the first symbol byte */ +/* Get the compressed symbol length from the first symbol byte. */ data = &kallsyms_names[off]; len = *data; data++; -/* update the offset to return the offset for the next symbol on -* the compressed stream */ +/* +* Update the offset to return the offset for the next symbol on +* the compressed stream. +*/ off += len +1 ; -/* for every byte on the compressed symbol data, copy the table -entry for that byte */ -while (len) { - tptr = &kallsyms_token_table[ kallsyms_token_index[*data] ]; +/* +* For every byte on the compressed symbol data, copy the table +* entry for that byte. +*/ +while (len) { + tptr = &kallsyms_token_table[kallsyms_token_index[*data]]; data++; len--;while (*tptr) { -if (skipped_first) { +if (skipped_first) { *result = *tptr; result++; }else
@@ -110,36 +120,46 @@ static unsigned int kallsyms_expand_symbol(unsigned int off, char *result) *result ='\0' ; -/* return to offset to the next symbol */ +/* Return to offset to the next symbol. */ return off; } -/* get symbol type information. This is encoded as a single char at the -* begining of the symbol name */ +/* +* Get symbol type information. This is encoded as a single char at the +* beginning of the symbol name. +*/ static char kallsyms_get_symbol_type (unsigned int off) { -/* get just the first code, look it up in the token table, and return the -* first char from this token */ -return kallsyms_token_table[ kallsyms_token_index[ kallsyms_names[off+1 ] ] ]; +/* +* Get just the first code, look it up in the token table, +* and return the first char from this token. +*/ +return kallsyms_token_table[kallsyms_token_index[kallsyms_names[off +1 ]]]; } -/* find the offset on the compressed stream given and index in the -* kallsyms array */ +/* +* Find the offset on the compressed stream given and index in the +* kallsyms array. +*/ static unsigned int get_symbol_offset (unsigned long pos) {const u8 *name;int i; -/* use the closest marker we have. We have markers every 256 positions, -* so that should be close enough */ - name = &kallsyms_names[ kallsyms_markers[pos>>8 ] ]; +/* +* Use the closest marker we have. We have markers every 256 positions, +* so that should be close enough. +*/ + name = &kallsyms_names[kallsyms_markers[pos >>8 ]]; -/* sequentially scan all the symbols up to the point we're searching for. -* Every symbol is stored in a [<len>][<len> bytes of data] format, so we -* just need to add the len to the current pointer for every symbol we -* wish to skip */ -for (i =0 ; i < (pos&0xFF ); i++) +/* +* Sequentially scan all the symbols up to the point we're searching +* for. Every symbol is stored in a [<len>][<len> bytes of data] format, +* so we just need to add the len to the current pointer for every +* symbol we wish to skip. +*/ +for (i =0 ; i < (pos &0xFF ); i++) name = name + (*name) +1 ;return name - kallsyms_names;
@@ -190,7 +210,7 @@ static unsigned long get_symbol_pos(unsigned long addr,/* This kernel should never had been booted. */ BUG_ON (!kallsyms_addresses); -/* do a binary search on the sorted kallsyms_addresses array */ +/* Do a binary search on the sorted kallsyms_addresses array. */ low =0 ; high = kallsyms_num_syms;
@@ -203,15 +223,15 @@ static unsigned long get_symbol_pos(unsigned long addr, }/* -* search for the first aliased symbol. Aliased -* symbols are symbols with the same address +* Search for the first aliased symbol. Aliased +* symbols are symbols with the same address. */ while (low && kallsyms_addresses[low-1 ] == kallsyms_addresses[low]) --low; symbol_start = kallsyms_addresses[low]; -/* Search for next non-aliased symbol */ +/* Search for next non-aliased symbol. */ for (i = low +1 ; i < kallsyms_num_syms; i++) {if (kallsyms_addresses[i] > symbol_start) { symbol_end = kallsyms_addresses[i];
@@ -219,7 +239,7 @@ static unsigned long get_symbol_pos(unsigned long addr, } } -/* if we found no next symbol, we use the end of the section */ +/* If we found no next symbol, we use the end of the section. */ if (!symbol_end) {if (is_kernel_inittext (addr)) symbol_end = (unsigned long )_einittext;
@@ -252,10 +272,10 @@ int kallsyms_lookup_size_offset(unsigned long addr, unsigned long *symbolsize,/* * Lookup an address -* - modname is set to NULL if it's in the kernel -* - we guarantee that the returned name is valid until we reschedule even if -* it resides in a module -* - we also guarantee that modname will be valid until rescheduled +* - modname is set to NULL if it's in the kernel. +* - We guarantee that the returned name is valid until we reschedule even if. +* It resides in a module. +* - We also guarantee that modname will be valid until rescheduled. */ const char *kallsyms_lookup(unsigned long addr, unsigned long *symbolsize,
@@ -276,7 +296,7 @@ const char *kallsyms_lookup(unsigned long addr,return namebuf; } -/* see if it's in a module */ +/* See if it's in a module. */ return module_address_lookup (addr, symbolsize, offset, modname, namebuf); }
@@ -294,7 +314,7 @@ int lookup_symbol_name(unsigned long addr, char *symname)kallsyms_expand_symbol (get_symbol_offset (pos), symname);return 0 ; } -/* see if it's in a module */ +/* See if it's in a module. */ return lookup_module_symbol_name (addr, symname); }
@@ -313,7 +333,7 @@ int lookup_symbol_attrs(unsigned long addr, unsigned long *size, modname[0 ] ='\0' ;return 0 ; } -/* see if it's in a module */ +/* See if it's in a module. */ return lookup_module_symbol_attrs (addr, size, offset, modname, name); }
@@ -342,6 +362,7 @@ int sprint_symbol(char *buffer, unsigned long address)return len; } +EXPORT_SYMBOL_GPL (sprint_symbol);/* Look up a kernel symbol and print it to the kernel messages. */ void __print_symbol (const char *fmt,unsigned long address)
@@ -352,13 +373,13 @@ void __print_symbol(const char *fmt, unsigned long address)printk (fmt, buffer); } +EXPORT_SYMBOL (__print_symbol);/* To avoid using get_symbol_offset for every symbol, we carry prefix along. */ -struct kallsym_iter -{ +struct kallsym_iter {loff_t pos;unsigned long value; -unsigned int nameoff;/* If iterating in core kernel symbols */ +unsigned int nameoff;/* If iterating in core kernel symbols. */ char type;char name[KSYM_NAME_LEN ];char module_name[MODULE_NAME_LEN ];
@@ -404,7 +425,7 @@ static int update_iter(struct kallsym_iter *iter, loff_t pos) iter->pos = pos;return get_ksymbol_mod (iter); } - +/* If we're not on the desired position, reset to new position. */ if (pos != iter->pos)reset_iter (iter, pos);
@@ -439,23 +460,25 @@ static int s_show(struct seq_file *m, void *p) {struct kallsym_iter *iter = m->private; -/* Some debugging symbols have no name. Ignore them. */ +/* Some debugging symbols have no name. Ignore them. */ if (!iter->name[0 ])return 0 ;if (iter->module_name[0 ]) {char type; -/* Label it "global" if it is exported, -* "local" if not exported. */ +/* +* Label it "global" if it is exported, +* "local" if not exported. +*/ type = iter->exported ?toupper (iter->type) :tolower (iter->type);seq_printf (m,"%0*lx %c %s\t[%s]\n" , - (int )(2 *sizeof (void *)), + (int )(2 *sizeof (void *)), iter->value, type, iter->name, iter->module_name); }else seq_printf (m,"%0*lx %c %s\n" , - (int )(2 *sizeof (void *)), + (int )(2 *sizeof (void *)), iter->value, iter->type, iter->name);return 0 ; }
@@ -469,9 +492,11 @@ static const struct seq_operations kallsyms_op = {static int kallsyms_open (struct inode *inode,struct file *file) { -/* We keep iterator in m->private, since normal case is to +/* +* We keep iterator in m->private, since normal case is to * s_start from where we left off, so we avoid doing -* using get_symbol_offset for every symbol */ +* using get_symbol_offset for every symbol. +*/ struct kallsym_iter *iter;int ret;
@@ -500,7 +525,4 @@ static int __init kallsyms_init(void)proc_create ("kallsyms" ,0444 ,NULL , &kallsyms_operations);return 0 ; } -__initcall (kallsyms_init); - -EXPORT_SYMBOL (__print_symbol); -EXPORT_SYMBOL_GPL (sprint_symbol); +device_initcall (kallsyms_init);
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 34/39 scripts/headers_check.pl: correct RE in header CONFIG leak check
In reply to Sam RavnborgFrom: Robert P. J. Day <[email protected]>
Correct the regular expression in scripts/headers_check.pl to include '_' as a valid character in the class; otherwise, the check will report a "leaked" symbol of CONFIG_A_B_C as merely CONFIG_A.
This patch will make no difference whatsoever in the current kernel tree as the call to the perl routine that does that check is currently commented out:
&check_include();
&check_asm_types();
&check_sizetypes();
&check_prototypes();
# Dropped for now. Too much noise &check_config();However, I noticed that problem when I was building the yum downloadable kernel source rpm for fedora 11 (beta), which *does* run that check, and that's where the problem became obvious.
--- scripts/headers_check.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/headers_check.pl +1 -1
@@ -74,7 +74,7 @@ sub check_declarations sub check_config { - if ($line =~ m/[^a-zA-Z0-9_]+CONFIG_([a-zA-Z0-9]+)[^a-zA-Z0-9]/) { + if ($line =~ m/[^a-zA-Z0-9_]+CONFIG_([a-zA-Z0-9_]+)[^a-zA-Z0-9_]/) { printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n"; } }
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 35/39 kbuild: add hint about __refdata to modpost
In reply to Sam RavnborgAs requested by Guennadi Liakhovetski
--- scripts/mod/modpost.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/mod/modpost.c +1 -1
@@ -1196,7 +1196,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,"The variable %s references\n" "the %s %s%s%s\n" "If the reference is valid then annotate the\n" -"variable with __init* (see linux/init.h) " +"variable with __init* or __refdata (see linux/init.h) " "or name the variable:\n" , fromsym, to, sec2annotation(tosec), tosym, to_p);while (*s)
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 36/39 menu: fix embedded menu presentation
In reply to Sam RavnborgFrom: Randy Dunlap <[email protected]>
The STRIP_ASM_SYMS kconfig symbol mucks up the embedded menu because STRIP_ASM_SYMS is in the middle of the embedded menu items but it does not depend on EMBEDDED. Move it to beyond the end of the embedded menu so that the menu is presented correctly.
Or if STRIP_ASM_SYMS should depend on EMBEDDED, that can also be fixed.
--- init/Kconfig | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
init/Kconfig +8 -8
@@ -808,14 +808,6 @@ config KALLSYMS_EXTRA_PASS you wait for kallsyms to be fixed. -config STRIP_ASM_SYMS - bool "Strip assembler-generated symbols during link" - default n - help - Strip internal assembler-generated symbols during a link (symbols - that look like '.Lxxx') so they don't pollute the output of - get_wchan() and suchlike. - config HOTPLUG bool "Support for hot-pluggable devices" if EMBEDDED default y
@@ -961,6 +953,14 @@ config SLUB_DEBUG SLUB sysfs support. /sys/slab will not exist and there will be no support for cache validation etc. +config STRIP_ASM_SYMS + bool "Strip assembler-generated symbols during link" + default n + help + Strip internal assembler-generated symbols during a link (symbols + that look like '.Lxxx') so they don't pollute the output of + get_wchan() and suchlike. + config COMPAT_BRK bool "Disable heap randomization" default y
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 37/39 Remove bashisms from scripts
In reply to Sam RavnborgFrom: dann frazier <[email protected]>
The '-e' option to echo and brace expansion are not guaranteed to be supported by a POSIX-compliant /bin/sh (e.g. dash)
--- scripts/gcc-version.sh | 2 +- scripts/ver_linux | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
scripts/gcc-version.sh +1 -1
@@ -18,7 +18,7 @@ compiler="$*" if [ ${#compiler} -eq 0 ]; then echo "Error: No compiler specified." - echo -e "Usage:\n\t$0 <gcc-command>" + printf "Usage:\n\t$0 <gcc-command>\n" exit 1 fi
scripts/ver_linux +1 -1
@@ -65,7 +65,7 @@ sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' < /proc/self/maps ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \ 'NR==1{print "Dynamic linker (ldd) ", $NF}' -ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null | awk -F. \ +ls -l /usr/lib/libg++.so /usr/lib/libstdc++.so 2>/dev/null | awk -F. \ '{print "Linux C++ Library " $4"."$5"."$6}' ps --version 2>&1 | grep version | awk \
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 38/39 ignore *.patch files
In reply to Sam RavnborgFrom: Mike Frysinger <[email protected]>
--- .gitignore | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
.gitignore +1 -0
@@ -25,6 +25,7 @@ *.elf *.bin *.gz +*.patch # # Top-level generic files
Signature · 1 line
1.6.3.rc3.40.g75b44
PATCH 39/39 kbuild: fix "Argument list too long" error for "make headers_check",
In reply to Sam RavnborgFrom: Sergei Poselenov <[email protected]>
I'm trying to install kernel headers to build a cross-toolchain, but got the following:
make ARCH=arm INSTALL_HDR_PATH=/work/psl/eldk-builds/arm-2009-04-21/work/var/tmp/crosstool-0.43-3-root/usr/crosstool/gcc-4.2.2-glibc-20070515T2025-eldk/ +arm-linux-gnueabi/arm-linux-gnueabi/headers_check
...
CHECK include/linux/raid (2 files) CHECK include/linux/spi (1 files) CHECK include/linux/sunrpc (1 files) CHECK include/linux/tc_act (6 files) CHECK include/linux/tc_ematch (4 files) CHECK include/linux/usb (8 files)
make[2]: execvp: /bin/sh: Argument list too long
make[2]: *** [/work/psl/eldk-builds/arm-2009-04-21/work/var/tmp/crosstool-0.43-3-root/usr/crosstool/gcc-4.2.2-glibc-20070515T2025-eldk/arm-linux-gnueab +i/arm-linux-gnueabi//include/linux/.check]
Error 127
make[1]: *** [linux] Error 2
make: *** [headers_check] Error 2
->
Introduce use of xargs to fix this.
--- scripts/Makefile.headersinst | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
scripts/Makefile.headersinst +6 -2
@@ -54,8 +54,12 @@ quiet_cmd_remove = REMOVE $(unwanted) cmd_remove = rm -f $(unwanted-file) quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) - cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \ - $(addprefix $(install)/, $(all-files)); \ +# Headers list can be pretty long, xargs helps to avoid +# the "Argument list too long" error. + cmd_check = for f in $(all-files); do \ + echo "$(install)/$${f}"; done \ + | xargs \ + $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \ touch $@ PHONY += __headersinst __headerscheck
Signature · 1 line
1.6.3.rc3.40.g75b44