Bug#815237: kernel-package: ownership issues when builidng with fakeroot

2016-11-11 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Mon, 2016-02-22 at 15:26 +0530, Ritesh Raj Sarraf wrote:
> >     Please fix upo the permissions and make sure that the user
> >  running the build can indeed wrte to ./debian/* and fakeroot can
> > indeed
> >  change permissions.
> > 
> >     I have been building kernels with the current make-kpkg, and
> >  using fakeroot, consistently, and there have been no other reports
> >  about problems with fakeroot.
> 
> Since you've confirmed that it works for you, let me spend some more
> time to validate if it is a local bug. If not so, only then, I'll re-
> open the bug.

It seems the problem is with the install command, that is defined in:
debian/ruleset/common/install_cmds.mk


Take this example:

rrs@learner:~$ install -p -d /tmp/manoj/abc
2016-11-11 / 15:17:12 ♒♒♒  ☺  

rrs@learner:~$ install -p -o root -g root -d /tmp/manoj/root
install: cannot change owner and permissions of ‘/tmp/manoj/root’: Operation not
permitted
2016-11-11 / 15:17:29 ♒♒♒  ☹  => 1  

rrs@learner:~$ fakeroot install -p -o root -g root -d /tmp/manoj/fakeroot
2016-11-11 / 15:17:58 ♒♒♒  ☺  

rrs@learner:~$ ls -l /tmp/manoj/
total 0
drwxr-xr-x 2 rrs rrs 40 Nov 11 15:17 abc/
drwxr-xr-x 2 rrs rrs 40 Nov 11 15:17 fakeroot/
drwx-- 2 rrs rrs 40 Nov 11 15:17 root/
2016-11-11 / 15:18:03 ♒♒♒  ☺  


If you pass root attributes as a normal user, it fails to create. With fakeroot,
it does create, but the attributes are still that of the user.

And if you look at the kernel-package error, it seems to be complaining about
the same.


make[1]: Entering directory
'/home/rrs/Community/linux'== making
target debian/stamp/install/linux-image-4.8.7brk0+-dbg [new prereqs:
]== 
This is kernel package version
13.018. 
rm -rf /home/rrs/Community/linux/debian/linux-image-4.8.7brk0+-
dbg 
install -p -d -o root -g root  -m  755 /home/rrs/Community/linux/debian/linux-
image-4.8.7brk0+-
dbg/usr/share/doc/linux-image-4.8.7brk0+-dbg
== making target debian/stamp/install/linux-headers-4.8.7brk0+ [new prereqs:
]==
This is kernel package version 13.018.
rm -rf /home/rrs/Community/linux/debian/linux-headers-4.8.7brk0+
install -p -d -o root -g root  -m  755 /home/rrs/Community/linux/debian/linux-
headers-4.8.7brk0
+/usr/src/linux-headers-4.8.7brk0+
== making target debian/stamp/install/linux-image-4.8.7brk0+ [new prereqs:
]==
This is kernel package version 13.018.
install: cannot change owner and permissions of
_/home/rrs/Community/linux/debian/linux-headers
- -4.8.7brk0+/usr/src/linux-headers-4.8.7brk0+_: Operation not permitted
install: cannot change owner and permissions of
_/home/rrs/Community/linux/debian/linux-image-4
.8.7brk0+-dbg/usr/share/doc/linux-image-4.8.7brk0+-dbg_: Operation not permitted
debian/ruleset/targets/headers.mk:40: recipe for target
'debian/stamp/install/linux-headers-4.8
.7brk0+' failed
make[1]: *** [debian/stamp/install/linux-headers-4.8.7brk0+] Error 1
make[1]: Leaving directory '/home/rrs/Community/linux'
debian/ruleset/targets/debug.mk:32: recipe for target
'debian/stamp/install/linux-image-4.8.7br
k0+-dbg' failed
make[1]: *** [debian/stamp/install/linux-image-4.8.7brk0+-dbg] Error 1
rm -f -r .//home/rrs/Community/linux/debian/linux-image-4.8.7brk0+
.//home/rrs/Community/linux/
debian/linux-image-4.8.7brk0+.deb
make[1]: Leaving directory '/home/rrs/Community/linux'
debian/ruleset/local.mk:102: recipe for target 'kernel_headers' failed
make: *** [kernel_headers] Error 2
make: *** Waiting for unfinished jobs
debian/ruleset/local.mk:108: recipe for target 'kernel_debug' failed
make: *** [kernel_debug] Error 2
install -p -d -o root -g root  -m  755 /home/rrs/Community/linux/debian/linux-
image-4.8.7brk0+/
etc/kernel/postinst.d /home/rrs/Community/linux/debian/linux-image-
4.8.7brk0+/etc/kernel/preins
t.d \
  /home/rrs/Community/linux/debian/linux-image-
4.8.7brk0+/etc/kernel/postrm.d /
home/rrs/Community/linux/debian/linux-image-4.8.7brk0+/etc/kernel/prerm.d



It is just that the error message was misleading to believe that there is a
permission problem, where as, it actually is a failure from the install command.


- From the install (coreutils) man page:

- -o is a super-user only switch.


- -- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAlgllaMACgkQpjpYo/Lh
dWmKQw/+ME8rf5KI6O4bZnrNME+pLrAhYftwopC7Rjz5QM2COBjm7rBCq6kQOcly
OZlLloHQIpoeSMbl27F/bxqxLghFsjNvhF3RZEtRJcGKGxdkF/HohC40pFZjQjX9
+scVRL6x370mllVJkbrodrC+RB3N1FXsyrCPog7bLuQ8UY6H15VmWyBmY5xqtlpQ
ZDApF5+qnvZbet5BAv29vC1+O3VP5xLb3tsDwKYGDA8Yzg7Kk0c9eAwmSwXm5LDT
T61K6pe2koipUibg7xg4i1jufSZTJA86F7NHkMHb2gTVou0jHMS/8TLat0SriJQp
4ioW9C9CawolRGv6i4T3GECbWetAizsVo6XoMSyhx0EcLPYMPS+N+VuMO+Ba9JZn

Bug#815237: kernel-package: ownership issues when builidng with fakeroot

2016-02-26 Thread Ritesh Raj Sarraf
Control: unarchive -1
Control: reopen -1
Control: forcemerge 772664 -1

On Mon, 2016-02-22 at 15:26 +0530, Ritesh Raj Sarraf wrote:
> >     I have been building kernels with the current make-kpkg,
> and
> >  using fakeroot, consistently, and there have been no other reports
> >  about problems with fakeroot.
> 
> Since you've confirmed that it works for you, let me spend some more
> time to validate if it is a local bug. If not so, only then, I'll re-
> open the bug.

I now recollect the whole context of how this bug originated. Re-
opening this bug for now.

I am surprise that you mentioned being able to build recent kernels.


The bug started with this failure..

  INSTALL drivers/mtd/sm_ftl.ko
  INSTALL drivers/mtd/ssfdc.ko
  INSTALL drivers/mtd/ubi/ubi.ko
  INSTALL drivers/mtd/ubi/gluebi.ko
  INSTALL drivers/net/arcnet/arc-rawmode.ko
  INSTALL drivers/net/appletalk/ipddp.ko
  INSTALL drivers/net/arcnet/arc-rimi.ko
  INSTALL drivers/net/arcnet/arcnet.ko
  INSTALL drivers/net/arcnet/capmode.ko
  INSTALL drivers/net/arcnet/com20020-pci.ko
make[3]: fork: Resource temporarily unavailable
  INSTALL drivers/net/arcnet/com20020.ko
/bin/sh: 1: Cannot fork/bin/sh: 1: Cannot fork

scripts/Makefile.modinst:35: recipe for target
'drivers/net/arcnet/com20020.ko' failed
make[3]: *** [drivers/net/arcnet/com20020.ko] Error 2
make[3]: *** Waiting for unfinished jobs
scripts/Makefile.modinst:35: recipe for target
'drivers/net/arcnet/com20020-pci.ko' failed
make[3]: *** [drivers/net/arcnet/com20020-pci.ko] Error 2
/bin/sh: 1: Cannot fork
scripts/Makefile.modinst:35: recipe for target
'drivers/net/arcnet/capmode.ko' failed
make[3]: *** [drivers/net/arcnet/capmode.ko] Error 2
Makefile:1122: recipe for target '_modinst_' failed
make[2]: *** [_modinst_] Error 2
make[2]: Leaving directory '/home/rrs/Community/linux'
debian/ruleset/targets/image.mk:34: recipe for target
'debian/stamp/install/linux-image-4.4.2+' failed
make[1]: *** [debian/stamp/install/linux-image-4.4.2+] Error 2
make[1]: Leaving directory '/home/rrs/Community/linux'
debian/ruleset/local.mk:105: recipe for target 'kernel_image' failed
make: *** [kernel_image] Error 2
20:27 ♒♒♒☹  => 2  
rrs@chutzpah:~/Community/linux (stable-44)$ 



This has been reported in the BTS.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772664


So, one of the way to workaround the bug, was to increase the number of
allowed processes for a user.  But that really did not help.

That is when I used --rootcmd sudo, because such limitations do not
apply to the root user.


So, this bug should just be merged with 772664.


-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System


signature.asc
Description: This is a digitally signed message part


Bug#815237: kernel-package: ownership issues when builidng with fakeroot

2016-02-22 Thread Ritesh Raj Sarraf
Hello Manoj,


On Sun, 2016-02-21 at 18:11 -0800, Manoj Srivastava wrote:
>  This is not a but in kernel-package:
>  install: cannot change owner and permissions of
>  ‘/home/rrs/Community/linux/debian/linux-headers-
> 4.3.6+/usr/src/linux-headers-4.3.6+’:
>  Operation not permitted
> 

Yes. That is why I immediately checked the permissions first.

== making target debian/stamp/install/linux-image-4.3.6+ [new
prereqs: ]==
This is kernel package version 13.018.
rm -f -r .//home/rrs/Community/linux/debian/linux-image-4.3.6+
.//home/rrs/Community/linux/debian/linux-image-4.3.6+.deb
install -p -d -o root -g root  -m  755
/home/rrs/Community/linux/debian/linux-image-
4.3.6+/etc/kernel/postinst.d /home/rrs/Community/linux/debian/linux-
image-4.3.6+/etc/kernel/preinst.d \
  /home/rrs/Community/linux/debian/linux-image-
4.3.6+/etc/kernel/postrm.d /home/rrs/Community/linux/debian/linux-
image-4.3.6+/etc/kernel/prerm.d
install: cannot change owner and permissions of
‘/home/rrs/Community/linux/debian/linux-image-
4.3.6+/etc/kernel/postinst.d’: Operation not permitted
install: cannot change owner and permissions of
‘/home/rrs/Community/linux/debian/linux-image-
4.3.6+/etc/kernel/preinst.d’: Operation not permitted
install: cannot change owner and permissions of
‘/home/rrs/Community/linux/debian/linux-image-
4.3.6+/etc/kernel/postrm.d’: Operation not permitted
install: cannot change owner and permissions of
‘/home/rrs/Community/linux/debian/linux-image-
4.3.6+/etc/kernel/prerm.d’: Operation not permitted
debian/ruleset/targets/image.mk:34: recipe for target
'debian/stamp/install/linux-image-4.3.6+' failed
make[1]: *** [debian/stamp/install/linux-image-4.3.6+] Error 1
make[1]: Leaving directory '/home/rrs/Community/linux'
debian/ruleset/local.mk:105: recipe for target 'kernel_image' failed
make: *** [kernel_image] Error 2
15:52 ♒♒♒☹  => 2  



And below is the director listing, where I see no odd permissions. 

rrs@chutzpah:~/Community/linux (stable-43)$ ls -lh
/home/rrs/Community/linux/debian/
total 88K
-rw-r--r-- 1 rrs rrs  386 Feb 20 14:53 changelog
-rw-r--r-- 1 rrs rrs 5.9K Feb 20 14:53 config
drwxr-xr-x 2 rrs rrs 4.0K Feb 20 14:40 Config/
-rw-r--r-- 1 rrs rrs 5.2K Feb 20 14:53 control
-rw-r--r-- 1 rrs rrs 4.9K Feb 20 14:53 Control
-rw-r--r-- 1 rrs rrs 2.7K Feb 20 14:53 Control.bin86
drwxr-xr-x 3 rrs rrs 4.0K Feb 20 14:40 docs/
drwxr-xr-x 3 rrs rrs 4.0K Feb 20 14:40 examples/
drwxr-xr-x 3 rrs rrs 4.0K Feb 20 15:52 linux-headers-4.3.6+/
drwxr-xr-x 3 rrs rrs 4.0K Feb 20 15:52 linux-image-4.3.6+/
drwxr-xr-x 3 rrs rrs 4.0K Feb 20 15:52 linux-image-4.3.6+-dbg/
drwxr-xr-x 7 rrs rrs 4.0K Mar 24  2015 pkg/
drwxr-xr-x 2 rrs rrs 4.0K Feb 20 14:40 po/
-rwxr-xr-x 1 rrs rrs 3.7K Feb 17 05:13 rules*
drwxr-xr-x 6 rrs rrs 4.0K Feb 20 14:40 ruleset/
drwxr-xr-x 2 rrs rrs 4.0K Feb 20 14:40 scripts/
drwxr-xr-x 5 rrs rrs 4.0K Feb 20 15:52 stamp/
-rw-r--r-- 1 rrs rrs 6.4K Feb 20 14:53 templates.in
16:50 ♒♒♒   ☺

>     Please fix upo the permissions and make sure that the user
>  running the build can indeed wrte to ./debian/* and fakeroot can
> indeed
>  change permissions.
> 
>     I have been building kernels with the current make-kpkg, and
>  using fakeroot, consistently, and there have been no other reports
>  about problems with fakeroot.

Since you've confirmed that it works for you, let me spend some more
time to validate if it is a local bug. If not so, only then, I'll re-
open the bug.


Thanks.
Ritesh

-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System


signature.asc
Description: This is a digitally signed message part


Bug#815237: kernel-package: ownership issues when builidng with fakeroot

2016-02-20 Thread Ritesh Raj Sarraf
Package: kernel-package
Version: 13.018
Severity: important

I've been using --rootcmd=sudo because the default, i.e. fakeroot, seems
to be broken for some time.


Please see attached log for details.


echo done > debian/stamp/build/kernel
/usr/bin/make -f ./debian/rules  
debian/stamp/binary/pre-linux-headers-4.3.6+
/usr/bin/make -f ./debian/rules 
debian/stamp/binary/pre-linux-image-4.3.6+
/usr/bin/make -f ./debian/rules 
debian/stamp/binary/pre-linux-image-4.3.6+-dbg
make[1]: Entering directory '/home/rrs/Community/linux'
make[1]: Entering directory '/home/rrs/Community/linux'
make[1]: Entering directory '/home/rrs/Community/linux'
== making target debian/stamp/install/linux-image-4.3.6+-dbg [new prereqs: 
]==
This is kernel package version 13.018.
rm -rf /home/rrs/Community/linux/debian/linux-image-4.3.6+-dbg
install -p -d -o root -g root  -m  755 
/home/rrs/Community/linux/debian/linux-image-4.3.6+-dbg/usr/share/doc/linux-image-4.3.6+-dbg
== making target debian/stamp/install/linux-headers-4.3.6+ [new prereqs: 
]==
This is kernel package version 13.018.
rm -rf /home/rrs/Community/linux/debian/linux-headers-4.3.6+
install -p -d -o root -g root  -m  755 
/home/rrs/Community/linux/debian/linux-headers-4.3.6+/usr/src/linux-headers-4.3.6+
install: cannot change owner and permissions of 
‘/home/rrs/Community/linux/debian/linux-headers-4.3.6+/usr/src/linux-headers-4.3.6+’:
 Operation not permitted
install: cannot change owner and permissions of 
‘/home/rrs/Community/linux/debian/linux-image-4.3.6+-dbg/usr/share/doc/linux-image-4.3.6+-dbg’:
 Operation not permitted
debian/ruleset/targets/headers.mk:40: recipe for target 
'debian/stamp/install/linux-headers-4.3.6+' failed
make[1]: *** [debian/stamp/install/linux-headers-4.3.6+] Error 1
make[1]: Leaving directory '/home/rrs/Community/linux'
debian/ruleset/targets/debug.mk:32: recipe for target 
'debian/stamp/install/linux-image-4.3.6+-dbg' failed
make[1]: *** [debian/stamp/install/linux-image-4.3.6+-dbg] Error 1
make[1]: Leaving directory '/home/rrs/Community/linux'
debian/ruleset/local.mk:102: recipe for target 'kernel_headers' failed
make: *** [kernel_headers] Error 2
make: *** Waiting for unfinished jobs
debian/ruleset/local.mk:108: recipe for target 'kernel_debug' failed
make: *** [kernel_debug] Error 2
== making target debian/stamp/install/linux-image-4.3.6+ [new prereqs: 
]==
This is kernel package version 13.018.
rm -f -r .//home/rrs/Community/linux/debian/linux-image-4.3.6+ 
.//home/rrs/Community/linux/debian/linux-image-4.3.6+.deb
install -p -d -o root -g root  -m  755 
/home/rrs/Community/linux/debian/linux-image-4.3.6+/etc/kernel/postinst.d 
/home/rrs/Community/linux/debian/linux-image-4.3.6+/etc/kernel/preinst.d \
  
/home/rrs/Community/linux/debian/linux-image-4.3.6+/etc/kernel/postrm.d 
/home/rrs/Community/linux/debian/linux-image-4.3.6+/etc/kernel/prerm.d
install: cannot change owner and permissions of 
‘/home/rrs/Community/linux/debian/linux-image-4.3.6+/etc/kernel/postinst.d’: 
Operation not permitted
install: cannot change owner and permissions of 
‘/home/rrs/Community/linux/debian/linux-image-4.3.6+/etc/kernel/preinst.d’: 
Operation not permitted
install: cannot change owner and permissions of 
‘/home/rrs/Community/linux/debian/linux-image-4.3.6+/etc/kernel/postrm.d’: 
Operation not permitted
install: cannot change owner and permissions of 
‘/home/rrs/Community/linux/debian/linux-image-4.3.6+/etc/kernel/prerm.d’: 
Operation not permitted
debian/ruleset/targets/image.mk:34: recipe for target 
'debian/stamp/install/linux-image-4.3.6+' failed
make[1]: *** [debian/stamp/install/linux-image-4.3.6+] Error 1
make[1]: Leaving directory '/home/rrs/Community/linux'
debian/ruleset/local.mk:105: recipe for target 'kernel_image' failed
make: *** [kernel_image] Error 2
15:52 ♒♒♒☹  => 2  
rrs@chutzpah:~/Community/linux (stable-43)$ ls -lh 
/home/rrs/Community/linux/debian/linux-headers-4.3.6+/usr/src/
total 4.0K
drwx-- 2 rrs rrs 4.0K Feb 20 15:52 linux-headers-4.3.6+/
16:50 ♒♒♒   ☺
rrs@chutzpah:~/Community/linux (stable-43)$ ls -lh 
/home/rrs/Community/linux/debian/
total 88K
-rw-r--r-- 1 rrs rrs  386 Feb 20 14:53 changelog
-rw-r--r-- 1 rrs rrs 5.9K Feb 20 14:53 config
drwxr-xr-x 2 rrs rrs 4.0K Feb 20 14:40 Config/
-rw-r--r-- 1 rrs rrs 5.2K Feb 20 14:53 control
-rw-r--r-- 1 rrs rrs 4.9K Feb 20 14:53 Control
-rw-r--r-- 1 rrs rrs 2.7K Feb 20 14:53 Control.bin86
drwxr-xr-x 3 rrs rrs 4.0K Feb 20 14:40 docs/
drwxr-xr-x 3 rrs rrs 4.0K Feb 20 14:40 examples/
drwxr-xr-x 3 rrs rrs 4.0K Feb 20 15:52 linux-headers-4.3.6+/
drwxr-xr-x 3 rrs rrs 4.0K Feb 20 15:52 linux-image-4.3.6+/
drwxr-xr-x 3 rrs rrs 4.0K Feb 20 15:52 linux-image-4.3.6+-dbg/
drwxr-xr-x 7 rrs rrs 4.0K Mar 24  2015 pkg/
drwxr-xr-x 2 rrs rrs 4.0K Feb 20 14:40 po/
-rwxr-xr-x 1 rrs rrs 3.7K Feb 17 05:13 rules*
drwxr-xr-x 6 rrs rrs 4.0K Feb 20 14:40 ruleset/
drwxr-xr-x 2 rrs rrs 4.0K Feb 20 14:40 scripts/
drwxr-xr-x 5 rrs rrs