Subject: bug#379: base-files: 10.3+devuan4 breaks building of kernels using make bindeb-pkg

From: Arthur Marsh <[email-masked]>
Date: Wed, 22 Jan 2020 23:21:10 +0000

Package: base-files
Version: 10.3+devuan3.1
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?

Upgrading to base-files 10.3+devuan4

running 

make -j2 menuconfig bindeb-pkg

on the linux kernel produces output like:

sh ./scripts/package/mkdebian
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch)  -b -nc -uc
dpkg-buildpackage: warning:     debian/changelog(l2): found end of file where expected first heading
dpkg-buildpackage: error: fatal error occurred while parsing debian/changelog
make[2]: *** [scripts/Makefile.package:83: bindeb-pkg] Error 255
make[1]: *** [Makefile:1427: bindeb-pkg] Error 2
make: *** [Makefile:326: __build_one_by_one] Error 2

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

Downgrading to 10.3+devuan3.1

   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***

-- System Information:
Debian Release: 10.0
  APT prefers experimental
  APT policy: (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.5.0-rc7 (SMP w/4 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)

Versions of packages base-files depends on:
ii  gawk [awk]  1:5.0.1+dfsg-1
ii  mawk [awk]  1.3.3-20

base-files recommends no packages.

base-files suggests no packages.

-- Configuration Files:
/etc/profile changed:
if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH
if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi
if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

-- no debconf information

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

---

From: Mark Hindley <[email-masked]>
Date: Wed, 22 Jan 2020 23:51:35 +0000

Control: found -1 10.3+devuan4
Control: notfound -1 10.3+devuan3.1

Arthur,

Thanks for this.

First, your email was misaddressed hence the delay.

Could you confirm whether you are using beowulf or ceres?

If you are on beowulf please try base-files version 10.3+devuan3.2
which is in beowulf-proposed.

Thanks.

Mark

---

From: Mark Hindley <[email-masked]>
Date: Thu, 23 Jan 2020 10:54:34 +0000

Control: tags -1 patch

Arthur,

Are you able to verify that this patch for fixes your issue?

Thanks

Mark

commit 98a4203a5170e942d5a6e57cac944b43e46d9e49
Author: Mark Hindley <[email-masked]>
Date:   Thu Jan 23 09:24:20 2020 +0000

    Add missing line in changelog. Possible fix for #379.

diff --git a/debian/changelog b/debian/changelog
index 3780cca..b5de844 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,7 @@ base-files (10.3) unstable; urgency=medium
   * Add Breaks: debian-security-support (<< 2019.04.25). Closes: #928172.
     This is the first version of debian-security-support which does not break
     when /etc/debian_version contains a string in the form "10.x".
+
  -- Santiago Vila <[email-masked]>  Mon, 13 May 2019 22:25:32 +0200
 
 base-files (10.2) unstable; urgency=medium

---

From: Arthur Marsh <[email-masked]>
Date: Thu, 23 Jan 2020 22:49:31 +1030

Hi, I'm not sure which debian/changeling the diff applies to (I tried decompressing /usr/share/doc/base-files/changeling.gz and patching it without a change of behaviour), but am still mystified as to what change in base-files 10.3+devuan4 from base-files 10.3+devuan3.1 could cause a kernel build to fail.

Arthur.

---

From: Mark Hindley <[email-masked]>
Date: Thu, 23 Jan 2020 14:26:21 +0000

Arthur,

Looking at this again.

> dpkg-buildpackage: warning:     debian/changelog(l2): found end of file where expected first heading

This implies there is something wrong with the debian/changelog in the kernel
src root. Are you sure it is formatted correctly? What does dpkg-parsechangelog
produce?

Mark

---

From: Mark Hindley <[email-masked]>
Date: Thu, 23 Jan 2020 15:14:02 +0000

On Fri, Jan 24, 2020 at 01:13:50AM +1030, Arthur Marsh wrote:
>    Hi Mark,
> 
>    /usr/src/linux/debian/changelog
> 
>    is identical when building under base-files 10.3+devuan3.1 and
>    attempting to build under base-files 10.3+devuan4
> 
>    So I suspect there is another change in base-files 10.3+devuan4 that
>    causes dpkg-parsechangelog to fail to include:
> 
>    Source: linux-5.5.0-rc7+
>    Version: 5.5.0-rc7+-3735
>    Distribution: beowulf

There might be. In particular 10.3+devuan4 is not suitable for beowulf, it is
for chimaera/ceres. For beowulf you need 10.3+devuan3.2 which is in
beowulf-proposed.

Can you see if it still an issue with the correct beowulf version?

Thanks

Mark

---

From: "Arthur Marsh" <[email-masked]>
Date: Fri, 24 Jan 2020 01:13:50 +1030

Hi Mark, 
/usr/src/linux/debian/changelog 
is identical when building under base-files 10.3+devuan3.1 and
attempting to build under base-files 10.3+devuan4
So I suspect there is another change
in base-files 10.3+devuan4 that causes dpkg-parsechangelog to fail
to include:
Source: linux-5.5.0-rc7+ 
Version: 5.5.0-rc7+-3735 
Distribution: beowulf 
Urgency: low 
Maintainer: root  
Timestamp: 1579789717 
Date: Fri, 24 Jan 2020 00:58:37 +1030 
Changes:

before the actual contents of /usr/src/linux/debian/changelog
I also tried installing the base-files 11 package from Debian and that
didn't cause problems running make bindeb on the kernel source.
----- Original Message -----
From: "Mark Hindley" 
To:"Arthur Marsh" , 
Cc:"Evilham" 
Sent:Thu, 23 Jan 2020 13:43:47 +0000
Subject:Re: bug#379: base-files: 10.3+devuan4 breaks building of
kernels using make bindeb-pkg

 Arthur,

 Looking at this again.

 > dpkg-buildpackage: warning: debian/changelog(l2): found end of file
where expected first heading

 This implies there is something wrong with the debian/changelog in
the kernel
 src root. Are you sure it is formatted correctly? What does
dpkg-parsechangelog
 produce?

 Mark

---

From: Evilham <[email-masked]>
Date: Fri, 24 Jan 2020 01:17:14 +0100

Hello Arthur,

> src root. Are you sure it is formatted correctly? What does 

thank you for the report, could you help us discard a couple 
theories?

1. You are not running beowulf but ceres/sid.
   For this please show us your full sources.list as it'll be very 
   helpful
2. There is an issue with your ${KERNEL_SOURCE}/debian/changelog
   For this please show us your ${KERNEL_SOURCE}/debian/changelog

   Notice that ${KERNEL_SOURCE} is exactly the directory where you 
   are running make
   ON my system, this gets modified automatically with something 
   like:

   linux-5.4.8 (5.4.8-1) beowulf; urgency=low

      * Custom built Linux kernel.

    -- evilham <evilham@FQDN>  Fri, 24 Jan 2020 01:07:37 +0100

FTR: My stock-kernel build of 5.4.8 finishes without issues on 
Devuan beowulf with base-files 10.3-devuan3.2 (the intended 
version on -proposed), so I can't really confirm that there is a 
general issue atm.

Cheers,
--
Evilham

---

From: Mark Hindley <[email-masked]>
Date: Sat, 25 Jan 2020 13:52:49 +0000

Control: tags -1 = moreinfo

---

From: [email-masked]
Date: Sat, 1 Feb 2020 21:40:31 +0000

On 200129-07:37+0000, Mark Hindley wrote:
> On Tue, Jan 28, 2020 at 09:46:38PM -0000, matheu--- via Dng wrote:
> > Hi!
> > 
> > I tried to see how to report this bug on bugs.devuan.org, or on
> > dev1galaxy.org but couldn't magage with Tor.
> 
> Matheu,
> 
> Thanks. This looks as if it might well be related to #379. So please 
> could you resend this information to [email-masked].
> 
> Please also attach the KERNEL_SRC_ROOT/debian/changelog file.

We're in KERNEL_SRC_ROOT/ and we are compiling linux-stable, like so:

$ make j4 deb-pkg

  HOSTCC  scripts/kconfig/conf.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --syncconfig Kconfig
  UPD     include/config/kernel.release
make clean
sh ./scripts/package/mkdebian
  TAR     linux-5.5.0+.tar.gz
origversion=$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$//');\
	mv linux-5.5.0+.tar.gz ../linux-5.5.0+_${origversion}.orig.tar.gz
dpkg-parsechangelog: warning:     debian/changelog(l2): found end of file where expected first heading
dpkg-parsechangelog: error: fatal error occurred while parsing debian/changelog
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch)  -i.git -us -uc
dpkg-buildpackage: warning:     debian/changelog(l2): found end of file where expected first heading
dpkg-buildpackage: error: fatal error occurred while parsing debian/changelog
make[1]: *** [scripts/Makefile.package:77: deb-pkg] Error 25
make: *** [Makefile:1427: deb-pkg] Error 2
sed 's$lsb_release -cs$lsb_release -cs |cut -d -f2/$' scripts/package/mkdebian  | grep -A1 dpkg-parsechang

It results in the above error.

The issue is with the lsb_release, or the kernel folks should accept the
second field to have a '/'... and change the mkdebian file accordingly.

$ lsb_release -cs
chimaera/ceres
$
does not work with the kernel.

The workaround is to insert '| cut -d/ -f2' into KERNEL_SRC_ROOT/scripts/package/mkdebian .

$ sed -i 's$lsb_release -cs$lsb_release -cs |cut -d/ -f2$' scripts/package/mkdebian

which will result in:

127c127
< elif distribution=$(lsb_release -cs |cut -d/ -f2 2>/dev/null) && [ -n "$distribution" ] && [ "$distribution" != "n/a" ]; then
---
> elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n "$distribution" ] && [ "$distribution" != "n/a" ]; then

and then the compilation is OK.

Such as:

make clean
sh ./scripts/package/mkdebian
  TAR     linux-5.5.0+.tar.gz
origversion=$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$//');\
        mv linux-5.5.0+.tar.gz ../linux-5.5.0+_${origversion}.orig.tar.gz
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch)  -i.git -us -uc
dpkg-buildpackage: info: source package linux-5.5.0+
dpkg-buildpackage: info: source version 5.5.0+-1
dpkg-buildpackage: info: source distribution ceres
dpkg-buildpackage: info: source changed by mehr <mehr@meba>
 dpkg-source -i.git --before-build .
dpkg-buildpackage: info: host architecture amd64
 fakeroot -u debian/rules clean
rm -rf debian/*tmp debian/files
make clean
 dpkg-source -i.git -b .
dpkg-source: warning: source directory 'linux-stable_W' is not <sourcepackage>-<upstreamversion> 'linux-5.5.0+-5.5.0+'
dpkg-source: warning: .orig directory name linux-stable_W.orig is not <package>-<upstreamversion> (wanted linux-5.5.0+-5.5.0+.orig)
dpkg-source: info: using source format '1.0'
dpkg-source: info: building linux-5.5.0+ using existing linux-5.5.0+_5.5.0+.orig.tar.gz
...

The KERNEL_SRC_ROOT/debian/changelog file is attached.

Regards!

---

From: Mark Hindley <[email-masked]>
Date: Sun, 2 Feb 2020 11:17:49 +0000

Matheu,

Thanks for this.

> > elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n "$distribution" ] && [ "$distribution" != "n/a" ]; then

Actually, I think we might just need to merge in Debian's base-files 11.0. It
has dropped all the VERSION, VERSION_ID and CODENAME headers from
/etc/os-release. See
https://tracker.debian.org/media/packages/b/base-files/changelog-11

That makes lsb_release -cs return 'n/a' which is an expected and handled case.

Are you able to remove VERSION, VERSION_ID and CODENAME and verify that the
kernel builds successfully?

Thanks

Mark

---

From: [email-masked]
Date: Tue, 4 Feb 2020 21:48:24 +0000

On 200202-11:17+0000, Mark Hindley wrote:
...
...
> kernel builds successfully?

So I did:

# diff /usr/lib/os-release os-release_200204_21_5.orig
2a3,5
> VERSION_ID="4"
> VERSION="4 (chimaera/ceres)"
> VERSION_CODENAME=chimaera/ceres
#

and I can confirm that the kernel compiles correctly.

$ make -j4 deb-pkg
  UPD     include/config/kernel.release
make clean
sh ./scripts/package/mkdebian
Using default distribution of 'unstable' in the changelog
Install lsb-release or set $KDEB_CHANGELOG_DIST explicitly
  TAR     linux-5.5.0test00+.tar.gz
origversion=$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$//');\
    mv linux-5.5.0test00+.tar.gz ../linux-5.5.0test00+_${origversion}.orig.tar.gz
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch)  -i.git -us -uc
dpkg-buildpackage: info: source package linux-5.5.0test00+
dpkg-buildpackage: info: source version 5.5.0test00+-1
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by mehr <mehr@meba>
 dpkg-source -i.git --before-build .
dpkg-buildpackage: info: host architecture amd64
 fakeroot -u debian/rules clean
rm -rf debian/*tmp debian/files
make clean
 dpkg-source -i.git -b .
...

The problem appear to be solved with the new changes in base-files.

Regards!
Matheu

---

From: Mark Hindley <[email-masked]>
Date: Wed, 5 Feb 2020 11:01:00 +0000

> and I can confirm that the kernel compiles correctly.

That is very helpful. Thanks.

We'll get a new version based on Debian version 11 built as soon as possible.

Mark

---

From: "Devuan bug Tracking System" <[email-masked]>
Date: Thu, 06 Feb 2020 11:03:07 +0000

This is an automatic notification regarding your bug report
which was filed against the base-files package:

#379: base-files: 10.3+devuan4 breaks building of kernels using make bindeb-pkg

It has been closed by Mark Hindley <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Mark Hindley <[email-masked]> by
replying to this email.

-- 
379: https://bugs.devuan.org/cgi/bugreport.cgi?bug=379
Devuan Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [Devuan-bugs] bug#379: [DNG] "chimeara/ceres" in lsb_release output causes failure to compile kernel
From: Mark Hindley <[email-masked]>
To: [email-masked]
Cc: [email-masked], [email-masked]
Date: Thu, 6 Feb 2020 10:44:23 +0000

Version: 11+devuan1

> We'll get a new version based on Debian version 11 built as soon as possible.

base-files version 11+devuan1 now in ceres.

Closing.

Mark

Subject: base-files: 10.3+devuan4 breaks building of kernels using make bindeb-pkg
From: Arthur Marsh <[email-masked]>
To: [email-masked]
Date: Wed, 22 Jan 2020 23:21:10 +0000

Package: base-files
Version: 10.3+devuan3.1
Severity: normal

Dear Maintainer,

running 

-- System Information:
Debian Release: 10.0
  APT prefers experimental

-- Configuration Files:
/etc/profile changed: