make_kpkg runs postinst scripts

Bug #1308183 reported by Maxime Jayat
102
This bug affects 21 people
Affects Status Importance Assigned to Milestone
linux
New
Undecided
Unassigned
kernel-package (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hello,

I'm trying to compile and package a linux 3.15-rc1 to debug a problem I've had with the kernel from the kernel-ppa.

I run in the root of the upstream kernel tree:
fakeroot make-kpkg -j8 --append-to-version -bad --initrd --us --uc kernel-image

Most of the process seems to go perfectly well but it ends with:

...
make[2]: Leaving directory `/home/maxime/enviro/linux'
make[2]: Entering directory `/home/maxime/enviro/linux'
sh /home/maxime/enviro/linux/arch/x86/boot/install.sh 3.15.0-rc1-bad+ arch/x86/boot/bzImage \
  System.map "/home/maxime/enviro/linux/debian/linux-image-3.15.0-rc1-bad+//boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.15.0-rc1-bad+ /home/maxime/enviro/linux/debian/linux-image-3.15.0-rc1-bad+//boot/vmlinuz-3.15.0-rc1-bad+
/etc/kernel/postinst.d/apt-auto-removal: 85: /etc/kernel/postinst.d/apt-auto-removal: cannot create /etc/apt/apt.conf.d//01autoremove-kernels.dpkg-new: Permission denied
run-parts: /etc/kernel/postinst.d/apt-auto-removal exited with return code 2
make[3]: *** [install] Erreur 1
make[2]: *** [install] Error 2
make[2]: Leaving directory `/home/maxime/enviro/linux'
make[1]: *** [debian/stamp/install/linux-image-3.15.0-rc1-bad+] Error 2
make[1]: Leaving directory `/home/maxime/enviro/linux'
make: *** [kernel-image] Error 2

I'm no kernel packaging expert, but I would expect scripts in /etc/kernel/postinst.d not to actually run at packaging-time. Of course it fails because it doesn't run with root permissions.
And I'm compiling for another machine so running as real root is not an option.

As a result, I am unable to build a .deb of the kernel.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: kernel-package 12.036+nmu3
ProcVersionSignature: Ubuntu 3.13.0-24.46-lowlatency 3.13.9
Uname: Linux 3.13.0-24-lowlatency x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu2
Architecture: amd64
CurrentDesktop: XFCE
Date: Tue Apr 15 19:34:21 2014
InstallationDate: Installed on 2014-04-06 (8 days ago)
InstallationMedia: Ubuntu-Studio 14.04 LTS "Trusty Tahr" - Beta amd64 (20140326.1)
PackageArchitecture: all
SourcePackage: kernel-package
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Maxime Jayat (maxime-jayat) wrote :
Revision history for this message
Irishbandit (irishbandit) wrote :

Cofirming same bug building 3.15rc1
all kernels built up to 3.14.1 built ok but 3.15rc1 is no go.

time fakeroot make-kpkg --initrd --revision=`date +%m%d%Y` --append-to-version=-`date +%m%d%Y` kernel-image kernel-headers
Errors out with same error above

Don't know if this is related to the thread at https://lkml.org/lkml/2014/4/11/56
or not.

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"
Linux desktop 3.14.0-04012014 #1 SMP PREEMPT Tue Apr 1 14:15:21 CDT 2014 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kernel-package (Ubuntu):
status: New → Confirmed
Revision history for this message
Maxime Jayat (maxime-jayat) wrote :

Looks like it is reported and discussed here: https://lkml.org/lkml/2014/4/15/362

Revision history for this message
Uwe Helm (1forthedoctor) wrote :

For a temporary fix revert f4d4ffc03efc864645b990e1d579bbe1b8e358a4 in the mainline tree.

Builds for me after that.

Revision history for this message
Vincenzo (vincenzov72) wrote :

how????

Revision history for this message
Uwe Helm (1forthedoctor) wrote :

If you have the cloned git repository, you can use git revert to roll back a specific commit

git revert f4d4ffc03efc864645b990e1d579bbe1b8e358a4

If you downloaded a tarball from kernel.org you need to have the .patch file for the commit id above and use 'patch -R' to revert the patch.

Revision history for this message
Vincenzo (vincenzov72) wrote :

ok i download kernel.org
where find a patch files?

Revision history for this message
Uwe Helm (1forthedoctor) wrote :

The bug tracker is not really the right place for support and discussion. Feel free to email me directly or open a thread on askubuntu.com

Revision history for this message
Vincenzo (vincenzov72) wrote :

OK thanks

Revision history for this message
iLogin (cerebellum-l) wrote :
Revision history for this message
Irishbandit (irishbandit) wrote :

As noted above fixed with the updated kernel-package (13.003)
https://launchpad.net/ubuntu/+source/kernel-package/13.003/

Changed in kernel-package (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Ming Lei (tom-leiming) wrote :

I upgraded to the latest kernel package, and looks the problem is still there, is it really released?

Revision history for this message
Irishbandit (irishbandit) wrote :
Revision history for this message
Acid_1 (hainzy) wrote :

Would like to confirm that Irishbandit's post solved the issue. Running Xubuntu 14.04.

Revision history for this message
linuxball (linuxball) wrote :

The kernel-package 13.003 from Irishbandit's link in hist comment https://bugs.launchpad.net/ubuntu/+source/kernel-package/+bug/1308183/comments/15 solved the issue for Ubuntu Studio 14.04.2 LTS, too.

Revision history for this message
eraserix (eraserix) wrote :

Fix released? For which Ubuntu releases? What about an SRU for 14.04? This bug makes kernel-package rather unusable on trusty.

The package from Irishbandit seems to do the trick.

Revision history for this message
Roman Fiedler (roman-fiedler-deactivatedaccount) wrote :

Having same problem on Ubuntu Trusty. Executing the following within unpacked kernel directory and before starting build seems to fix it:

cat <<EOF > arch/x86/boot/install.sh
#!/bin/sh
cp -a -- "\$2" "\$4/vmlinuz-\$1"
EOF

Revision history for this message
Thomas Dreibholz (dreibh) wrote :

The bug still appears with the latest version of Ubuntu Trusty (14.04.4 LTS):

make[2]: Verzeichnis »/home/dreibh/src/mptcp-kernel« wird betreten
scripts/kconfig/conf --silentoldconfig Kconfig
make[2]: Verzeichnis »/home/dreibh/src/mptcp-kernel« wird verlassen
make[2]: Verzeichnis »/home/dreibh/src/mptcp-kernel« wird betreten
sh ./arch/x86/boot/install.sh 4.1.26-mptcp+ arch/x86/boot/bzImage \
                System.map "/home/dreibh/src/mptcp-kernel/debian/linux-image-4.1.26-mptcp+//boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.1.26-mptcp+ /home/dreibh/src/mptcp-kernel/debian/linux-image-4.1.26-mptcp+//boot/vmlinuz-4.1.26-mptcp+
/etc/kernel/postinst.d/apt-auto-removal: 84: /etc/kernel/postinst.d/apt-auto-removal: cannot create /etc/apt/apt.conf.d//01autoremove-kernels.dpkg-new: Permission denied
run-parts: /etc/kernel/postinst.d/apt-auto-removal exited with return code 2
make[3]: *** [install] Fehler 1
make[2]: *** [install] Fehler 2
make[2]: Verzeichnis »/home/dreibh/src/mptcp-kernel« wird verlassen
make[1]: *** [debian/stamp/install/linux-image-4.1.26-mptcp+] Fehler 2
make[1]: Verzeichnis »/home/dreibh/src/mptcp-kernel« wird verlassen
make: *** [kernel_image] Fehler 2

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"

$ apt-show-versions | grep kernel-package
kernel-package:all/trusty 12.036+nmu3 uptodate

Note, that kernel-package is 12.036, not 13.003 (as proposed bugfix in comment #13). If 13.003 fixes this bug, some maintainer has to upload it into the main Ubuntu repository to get it released.

Revision history for this message
Thomas Dreibholz (dreibh) wrote :

kernel-package 13.003 fixes the build issue for me. Some maintainer should upload this updated version to the regular Ubuntu repository, in order to get it deployed to the users. Since comment #13 is already more than 2 years old (2014-05-10, today is 2016-06-09), this may have been forgotten?

Please could somebody re-open this bug report, since the status "Fix released" seems to be wrong until the fix is actually uploaded?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.