aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--[-rwxr-xr-x]scripts/kconfig/mconf-cfg.sh8
-rw-r--r--scripts/mod/modpost.c6
-rwxr-xr-xscripts/package/builddeb6
-rwxr-xr-xscripts/package/mkdebian19
-rwxr-xr-xscripts/setlocalversion21
5 files changed, 43 insertions, 17 deletions
diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh
index aa68ec95620d..32448bc198a5 100755..100644
--- a/scripts/kconfig/mconf-cfg.sh
+++ b/scripts/kconfig/mconf-cfg.sh
@@ -4,6 +4,14 @@
PKG="ncursesw"
PKG2="ncurses"
+if [ "$CROSS_CURSES_LIB" != "" ]; then
+ echo libs=\'$CROSS_CURSES_LIB\'
+ if [ x"$CROSS_CURSES_INC" != x ]; then
+ echo cflags=\'$CROSS_CURSES_INC\'
+ fi
+ exit 0
+fi
+
if [ -n "$(command -v pkg-config)" ]; then
if pkg-config --exists $PKG; then
echo cflags=\"$(pkg-config --cflags $PKG)\"
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 69341b36f271..40332eb85307 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1995,7 +1995,7 @@ static void read_symbols(const char *modname)
char *license;
char *namespace;
struct module *mod;
- struct elf_info info = { };
+ struct elf_info info = { .hdr = NULL };
Elf_Sym *sym;
if (!parse_elf(&info, modname))
@@ -2496,7 +2496,7 @@ static int dump_sym(struct symbol *sym)
static void write_dump(const char *fname)
{
- struct buffer buf = { };
+ struct buffer buf = { NULL, 0, 0 };
struct symbol *symbol;
const char *namespace;
int n;
@@ -2550,7 +2550,7 @@ struct dump_list {
int main(int argc, char **argv)
{
struct module *mod;
- struct buffer buf = { };
+ struct buffer buf = { NULL, 0, 0 };
char *missing_namespace_deps = NULL;
char *dump_write = NULL, *files_source = NULL;
int opt;
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 6df3c9f8b2da..8277144298a0 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -202,8 +202,10 @@ EOF
done
if [ "$ARCH" != "um" ]; then
- deploy_kernel_headers debian/linux-headers
- create_package linux-headers-$version debian/linux-headers
+ if is_enabled CONFIG_MODULES; then
+ deploy_kernel_headers debian/linux-headers
+ create_package linux-headers-$version debian/linux-headers
+ fi
deploy_libc_headers debian/linux-libc-dev
create_package linux-libc-dev debian/linux-libc-dev
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index df1adbfb8ead..9342517778bf 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -183,13 +183,6 @@ Description: Linux kernel, version $version
This package contains the Linux kernel, modules and corresponding other
files, version: $version.
-Package: $kernel_headers_packagename
-Architecture: $debarch
-Description: Linux kernel headers for $version on $debarch
- This package provides kernel header files for $version on $debarch
- .
- This is useful for people who need to build external modules
-
Package: linux-libc-dev
Section: devel
Provides: linux-kernel-headers
@@ -200,6 +193,18 @@ Description: Linux support headers for userspace development
Multi-Arch: same
EOF
+if is_enabled CONFIG_MODULES; then
+cat <<EOF >> debian/control
+
+Package: $kernel_headers_packagename
+Architecture: $debarch
+Description: Linux kernel headers for $version on $debarch
+ This package provides kernel header files for $version on $debarch
+ .
+ This is useful for people who need to build external modules
+EOF
+fi
+
if is_enabled CONFIG_DEBUG_INFO; then
cat <<EOF >> debian/control
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 20f2efd57b11..bb709eda96cd 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -45,7 +45,7 @@ scm_version()
# Check for git and a git repo.
if test -z "$(git rev-parse --show-cdup 2>/dev/null)" &&
- head=$(git rev-parse --verify --short HEAD 2>/dev/null); then
+ head=$(git rev-parse --verify HEAD 2>/dev/null); then
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
# it, because this version is defined in the top level Makefile.
@@ -59,11 +59,22 @@ scm_version()
fi
# If we are past a tagged commit (like
# "v2.6.30-rc5-302-g72357d5"), we pretty print it.
- if atag="$(git describe 2>/dev/null)"; then
- echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
-
- # If we don't have a tag at all we print -g{commitish}.
+ #
+ # Ensure the abbreviated sha1 has exactly 12
+ # hex characters, to make the output
+ # independent of git version, local
+ # core.abbrev settings and/or total number of
+ # objects in the current repository - passing
+ # --abbrev=12 ensures a minimum of 12, and the
+ # awk substr() then picks the 'g' and first 12
+ # hex chars.
+ if atag="$(git describe --abbrev=12 2>/dev/null)"; then
+ echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),substr($(NF),0,13))}'
+
+ # If we don't have a tag at all we print -g{commitish},
+ # again using exactly 12 hex chars.
else
+ head="$(echo $head | cut -c1-12)"
printf '%s%s' -g $head
fi
fi