Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1198507 > unrolled thread

[PATCH] fallback to hostname in scripts/package/builddeb

Started byChristian Kujau <lists@nerdbynature.de>
First post2015-08-03 05:10 +0200
Last post2015-08-04 13:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] fallback to hostname in scripts/package/builddeb Christian Kujau <lists@nerdbynature.de> - 2015-08-03 05:10 +0200
    Re: [PATCH] fallback to hostname in scripts/package/builddeb Michal Marek <mmarek@suse.cz> - 2015-08-04 13:50 +0200

#1198507 — [PATCH] fallback to hostname in scripts/package/builddeb

FromChristian Kujau <lists@nerdbynature.de>
Date2015-08-03 05:10 +0200
Subject[PATCH] fallback to hostname in scripts/package/builddeb
Message-ID<pTeit-6ZV-1@gated-at.bofh.it>
Hi,

I happened to build a kernel with "make deb-pkg" on a machine with no 
network connectivity, but this failed with:

[...]
  INSTALL debian/headertmp/usr/include/asm/ (65 files)
hostname: Name or service not known
../scripts/package/Makefile:90: recipe for target 'deb-pkg' failed
make[2]: *** [deb-pkg] Error 1

In scripts/package/builddeb it tries to construct an email address (that 
can be queried in /proc/version later on) but with no network, 
the "hostname -f" fails. The following patch falls back to just use the 
shortname if we cannot determine our FQDN.

Signed-off-by: Christian Kujau <lists@nerdbynature.de>

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 88dbf23..7de1d1c 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -206,7 +206,7 @@ if [ -n "$DEBEMAIL" ]; then
 elif [ -n "$EMAIL" ]; then
        email=$EMAIL
 else
-       email=$(id -nu)@$(hostname -f)
+       email=$(id -nu)@$(hostname -f 2>/dev/null || hostname)
 fi
 if [ -n "$DEBFULLNAME" ]; then
        name=$DEBFULLNAME


-- 
BOFH excuse #334:

50% of the manual is in .pdf readme files
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1199704

FromMichal Marek <mmarek@suse.cz>
Date2015-08-04 13:50 +0200
Message-ID<pTITg-10n-9@gated-at.bofh.it>
In reply to#1198507
On Sun, Aug 02, 2015 at 08:03:26PM -0700, Christian Kujau wrote:
> Hi,
> 
> I happened to build a kernel with "make deb-pkg" on a machine with no 
> network connectivity, but this failed with:
> 
> [...]
>   INSTALL debian/headertmp/usr/include/asm/ (65 files)
> hostname: Name or service not known
> ../scripts/package/Makefile:90: recipe for target 'deb-pkg' failed
> make[2]: *** [deb-pkg] Error 1
> 
> In scripts/package/builddeb it tries to construct an email address (that 
> can be queried in /proc/version later on) but with no network, 
> the "hostname -f" fails. The following patch falls back to just use the 
> shortname if we cannot determine our FQDN.
> 
> Signed-off-by: Christian Kujau <lists@nerdbynature.de>

Applied to kbuild.git#misc, thanks.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web