On Tue, May 06, 2014 at 01:28:20PM -0700, Manoj Srivastava wrote:
> Hi,
> 
>         I can't replicate this (see below for my attempt). OK. We need
>  to know why there is a dirty in there. The value we see for target
>  debian/stamp/conf/full-changelog 's/=V/3.15.0-rc4-dirty/g' comesd from
>  KERNELRELEASE. That is defined from:
>   a) cat include/config/kernel.release or

OK, this is a good direction.
$ cat include/config/kernel.release 
3.15.0-rc4-dirty

$ make mrproper
# copy config
$ make include/config/kernel.release
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  UPD     include/config/kernel.release
$ cat include/config/kernel.release
3.15.0-rc4

Good!

$ fakeroot make-kpkg --initrd linux_image
exec make kpkg_version=13.003 -f /usr/share/kernel-package/ruleset/minimal.mk 
debian INITRD=YES 
====== making target debian/stamp/conf/minimal_debian [new prereqs: ]======
This is kernel package version 13.003.
test -d debian             || mkdir debian
test ! -e stamp-building || rm -f stamp-building
install -p -m 755 /usr/share/kernel-package/rules debian/rules
for file in ChangeLog  Control  Control.bin86 config templates.in rules; do     
                                 \
            cp -f  /usr/share/kernel-package/$file ./debian/;                   
            \
        done
cp: cannot stat ‘/usr/share/kernel-package/ChangeLog’: No such file or directory
for dir  in Config docs examples ruleset scripts pkg po;  do                    
                  \
          cp -af /usr/share/kernel-package/$dir  ./debian/;                     
            \
        done
test -f debian/control || sed         -e 's/=V/3.15.0-rc4/g'  \
                -e 's/=D/3.15.0-rc4-10.00.Custom/g'         -e 's/=A/amd64/g'  \
        -e 's/=SA//g'  \
        -e 's/=I//g'                                \
        -e 's/=CV/3.15/g'                           \
        -e 's/=M/Michal Hocko <msts...@gmail.com>/g'                        \
        -e 's/=ST/linux/g'      -e 's/=B/x86_64/g'    \
                  /usr/share/kernel-package/Control > debian/control
test -f debian/changelog ||  sed -e 's/=V/3.15.0-rc4/g'       \
            -e 's/=D/3.15.0-rc4-10.00.Custom/g'        -e 's/=A/amd64/g'       \
            -e 's/=ST/linux/g'     -e 's/=B/x86_64/g'         \
            -e 's/=M/Michal Hocko <msts...@gmail.com>/g'                        
    \
             /usr/share/kernel-package/changelog > debian/changelog
chmod 0644 debian/control debian/changelog
test -d ./debian/stamp || mkdir debian/stamp 
make -f debian/rules debian/stamp/conf/kernel-conf
make[1]: Entering directory '/mnt/share/devel/miso/linux-tree/test-tree'
====== making target debian/stamp/conf/kernel-conf [new prereqs: ]======
make    ARCH=x86_64 \
                    oldconfig;
make[2]: Entering directory '/mnt/share/devel/miso/linux-tree/test-tree'
scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#
make[2]: Leaving directory '/mnt/share/devel/miso/linux-tree/test-tree'
make    ARCH=x86_64 prepare
make[2]: Entering directory '/mnt/share/devel/miso/linux-tree/test-tree'
scripts/kconfig/conf --silentoldconfig Kconfig
  SYSTBL  arch/x86/syscalls/../include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/syscalls/../include/generated/asm/unistd_32_ia32.h
  SYSHDR  arch/x86/syscalls/../include/generated/asm/unistd_64_x32.h
  SYSTBL  arch/x86/syscalls/../include/generated/asm/syscalls_64.h
  SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h
  SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h
  SYSHDR  arch/x86/syscalls/../include/generated/uapi/asm/unistd_x32.h
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
  CHK     include/config/kernel.release
  UPD     include/config/kernel.release
  WRAP    arch/x86/include/generated/asm/clkdev.h
  WRAP    arch/x86/include/generated/asm/early_ioremap.h
  WRAP    arch/x86/include/generated/asm/cputime.h
  WRAP    arch/x86/include/generated/asm/mcs_spinlock.h
  CHK     include/generated/uapi/linux/version.h
  UPD     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/x86/kernel/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
make[2]: Leaving directory '/mnt/share/devel/miso/linux-tree/test-tree'
echo done > debian/stamp/conf/kernel-conf
make[1]: Leaving directory '/mnt/share/devel/miso/linux-tree/test-tree'
make -f debian/rules debian/stamp/conf/full-changelog
make[1]: Entering directory '/mnt/share/devel/miso/linux-tree/test-tree'
====== making target debian/stamp/conf/full-changelog [new prereqs: ]======
for file in ChangeLog  Control  Control.bin86 config templates.in rules; do     
                        \
     cp -f  /usr/share/kernel-package/$file ./debian/;                  \
done
cp: cannot stat ‘/usr/share/kernel-package/ChangeLog’: No such file or directory
for dir  in Config docs examples ruleset scripts pkg po;        do              
                \
   cp -af /usr/share/kernel-package/$dir  ./debian/;                            
\
done
install -p -m 755 /usr/share/kernel-package/rules debian/rules
sed         -e 's/=V/3.15.0-rc4-dirty/g'  \
                -e 's/=D/3.15.0-rc4-dirty-10.00.Custom/g'         -e 
's/=A/amd64/g'  \
        -e 's/=SA//g'  \
        -e 's/=I//g'                                \
        -e 's/=CV/3.15/g'                           \
        -e 's/=M/Michal Hocko <msts...@gmail.com>/g'                        \
        -e 's/=ST/linux/g'      -e 's/=B/x86_64/g'    \
                  /usr/share/kernel-package/Control > debian/control
sed -e 's/=V/3.15.0-rc4-dirty/g' -e 's/=D/3.15.0-rc4-dirty-10.00.Custom/g'      
      \
    -e 's/=A/amd64/g' -e 's/=M/Michal Hocko <msts...@gmail.com>/g' \
    -e 's/=ST/linux/g'   -e 's/=B/x86_64/g'           \
        /usr/share/kernel-package/changelog > debian/changelog
chmod 0644 debian/control debian/changelog
make -f debian/rules debian/stamp/conf/kernel-conf
make[2]: Entering directory '/mnt/share/devel/miso/linux-tree/test-tree'
make[2]: 'debian/stamp/conf/kernel-conf' is up to date.
make[2]: Leaving directory '/mnt/share/devel/miso/linux-tree/test-tree'
make[1]: Leaving directory '/mnt/share/devel/miso/linux-tree/test-tree'
echo done > debian/stamp/conf/minimal_debian
exec debian/rules  INITRD=YES  linux_image 
^C

$ cat include/config/kernel.release
3.15.0-rc4-dirty

OK, so the last regeneration of kernel.release during make prepare saw
the tree as dirty. But

$ make include/config/kernel.release
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  UPD     include/config/kernel.release
$ cat include/config/kernel.release
3.15.0-rc4

So the tree is clean again.
include/config/kernel.release is regenerated during make prepare but this
alone doesn't reproduce the same thing:
$ make ARCH=x86_64 prepare
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
$ cat include/config/kernel.release
3.15.0-rc4

It is really interesting that everything seems to be OK when I do
$ make kpkg_version=13.003 -f /usr/share/kernel-package/ruleset/minimal.mk 
debian INITRD=YES
[...]
$ cat include/config/kernel.release
3.15.0-rc4

And if I diff output to what make-kpkg produces then it says:
diff -u bad good 
--- bad 2014-05-07 10:12:54.000000000 +0200
+++ good        2014-05-07 10:10:36.000000000 +0200
@@ -79,15 +79,15 @@
    cp -af /usr/share/kernel-package/$dir  ./debian/;                           
 \
 done
 install -p -m 755 /usr/share/kernel-package/rules debian/rules
-sed         -e 's/=V/3.15.0-rc4-dirty/g'  \
-                -e 's/=D/3.15.0-rc4-dirty-10.00.Custom/g'         -e 
's/=A/amd64/g'  \
+sed         -e 's/=V/3.15.0-rc4/g'  \
+                -e 's/=D/3.15.0-rc4-10.00.Custom/g'         -e 's/=A/amd64/g'  
\
         -e 's/=SA//g'  \
         -e 's/=I//g'                                \
         -e 's/=CV/3.15/g'                           \
         -e 's/=M/Michal Hocko <msts...@gmail.com>/g'                        \
         -e 's/=ST/linux/g'      -e 's/=B/x86_64/g'    \
                   /usr/share/kernel-package/Control > debian/control
-sed -e 's/=V/3.15.0-rc4-dirty/g' -e 's/=D/3.15.0-rc4-dirty-10.00.Custom/g'     
       \
+sed -e 's/=V/3.15.0-rc4/g' -e 's/=D/3.15.0-rc4-10.00.Custom/g'        \
     -e 's/=A/amd64/g' -e 's/=M/Michal Hocko <msts...@gmail.com>/g' \
     -e 's/=ST/linux/g'   -e 's/=B/x86_64/g'           \
         /usr/share/kernel-package/changelog > debian/changelog

This means that either make-kpkg does something which dirties the tree
before make minimal.mk or fakeroot does something nasty.

And it seems the be the second one:
$ make mrproper
# copy config
$ fakeroot make include/config/kernel.release
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  UPD     include/config/kernel.release
$ cat include/config/kernel.release
3.15.0-rc4-dirty

But
$ fakeroot make kernelrelease
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
3.15.0-rc4

is correct. So it seems that fakeroot somehow manages to confuse
kernel.release file generation.

And indeed using --rootcmd fakeroot rather than fakeroot for the whole
make-kpkg fixes the issue. I was using fakeroot make-kpkg in my scripts
since ages and it seemed to work but it really makes a lot of sense to
use --rootcmd instead so I've fixed my scripts.

>   b) cat .kernelrelease

I do not have any such file in the kernel tree.

[...]
-- 
Michal Hocko


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to