[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kernel 4.14.15 compilation using GCC 8 in unstable.......





On 25 January 2018 at 23:28, Michael Lange <klappnase@freenet.de> wrote:
Hi,

On Thu, 25 Jan 2018 22:23:38 +0000
Michael Fothergill <michael.fothergill@gmail.com> wrote:

> Dear All,
>
> I am continuing the discussion of the kernel 4.14.15 compilation in the
> Question on CVE-2017-5754 on Debian 8.9 post in a new post.
>
> The reason I am running with this kernel and not the 4.15.0 rc9 kernel
> that is now available on kernel.org is that:
>
> 1. It is stable
>
> 2. I have never tried to compile a kernel in Debian before and want to
> make it a bit easier for me the first time would try.
>
> 3.  kernel 4.14.15 does have the KPTI and retpoline patches in it, so
> it is a fair candidate for the GCC8 compiler to produce a kernel that
> the patch checker could confirm has these meltdown and spectre fixes
> are properly set up and active.

Ok, my advice if you don't want to give up yet :-)

​I installed libelf-dev and did make clean.  Then I copied over the config file and did you "Alas poor Yorick" Yes""|oldconfig
command followed by make.kpkg again and I think it worked:

 ​root@mikef-PC:/usr/src/linux-4.14.15# !498
make-kpkg
exec make kpkg_version=13.018+nmu1 -f /usr/share/kernel-package/ruleset/minimal.mk debian
====== making target debian/stamp/conf/minimal_debian [new prereqs: ]======
This is kernel package version 13.018+nmu1.
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/4.14.15/g'  \
                -e 's/=D/4.14.15-10.00.Custom/g'         -e 's/=A/amd64/g'  \
    -e 's/=SA//g'  \
    -e 's/=I//g'                    \
    -e 's/=CV/4.14/g'                \
    -e 's/=M/Unknown Kernel Package Maintainer <unknown@unconfigured.in.etc.kernel-pkg.conf>/g'                \
    -e 's/=ST/linux/g'      -e 's/=B/x86_64/g'    \
                -e 's/=R//g'    /usr/share/kernel-package/Control > debian/control
test -f debian/changelog ||  sed -e 's/=V/4.14.15/g'       \
            -e 's/=D/4.14.15-10.00.Custom/g'        -e 's/=A/amd64/g'       \
            -e 's/=ST/linux/g'     -e 's/=B/x86_64/g'         \
            -e 's/=M/Unknown Kernel Package Maintainer <unknown@unconfigured.in.etc.kernel-pkg.conf>/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 '/usr/src/linux-4.14.15'
====== making target debian/stamp/conf/kernel-conf [new prereqs: ]======
make    ARCH=x86_64 \
                    oldconfig;
make[2]: Entering directory '/usr/src/linux-4.14.15'
scripts/kconfig/conf  --oldconfig Kconfig
#
# configuration written to .config
#
make[2]: Leaving directory '/usr/src/linux-4.14.15'
make    ARCH=x86_64 prepare
make[2]: Entering directory '/usr/src/linux-4.14.15'
scripts/kconfig/conf  --silentoldconfig Kconfig
  SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
  SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
  SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
  HYPERCALLS arch/x86/include/generated/asm/xen-hypercalls.h
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
  SYSHDR  arch/x86/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/dma-contiguous.h
  WRAP    arch/x86/include/generated/asm/early_ioremap.h
  WRAP    arch/x86/include/generated/asm/mcs_spinlock.h
  WRAP    arch/x86/include/generated/asm/mm-arch-hooks.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      arch/x86/purgatory/purgatory.o
  AS      arch/x86/purgatory/stack.o
  AS      arch/x86/purgatory/setup-x86_64.o
  CC      arch/x86/purgatory/sha256.o
  AS      arch/x86/purgatory/entry64.o
  CC      arch/x86/purgatory/string.o
  LD      arch/x86/purgatory/purgatory.ro
  BIN2C   arch/x86/purgatory/kexec-purgatory.c
  CC      kernel/bounds.s
  CHK     include/generated/bounds.h
  UPD     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  UPD     include/generated/timeconst.h
  CC      arch/x86/kernel/asm-offsets.s
  CHK     include/generated/asm-offsets.h
  UPD     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  DESCEND  objtool
  HOSTCC   /usr/src/linux-4.14.15/tools/objtool/fixdep.o
  HOSTLD   /usr/src/linux-4.14.15/tools/objtool/fixdep-in.o
  LINK     /usr/src/linux-4.14.15/tools/objtool/fixdep
  CC       /usr/src/linux-4.14.15/tools/objtool/exec-cmd.o
  CC       /usr/src/linux-4.14.15/tools/objtool/help.o
  CC       /usr/src/linux-4.14.15/tools/objtool/pager.o
  CC       /usr/src/linux-4.14.15/tools/objtool/parse-options.o
  CC       /usr/src/linux-4.14.15/tools/objtool/run-command.o
  CC       /usr/src/linux-4.14.15/tools/objtool/sigchain.o
  CC       /usr/src/linux-4.14.15/tools/objtool/subcmd-config.o
  LD       /usr/src/linux-4.14.15/tools/objtool/libsubcmd-in.o
  AR       /usr/src/linux-4.14.15/tools/objtool/libsubcmd.a
  GEN      /usr/src/linux-4.14.15/tools/objtool/arch/x86/lib/inat-tables.c
  CC       /usr/src/linux-4.14.15/tools/objtool/arch/x86/decode.o
  LD       /usr/src/linux-4.14.15/tools/objtool/arch/x86/objtool-in.o
  CC       /usr/src/linux-4.14.15/tools/objtool/builtin-check.o
  CC       /usr/src/linux-4.14.15/tools/objtool/builtin-orc.o
  CC       /usr/src/linux-4.14.15/tools/objtool/check.o
  CC       /usr/src/linux-4.14.15/tools/objtool/orc_gen.o
  CC       /usr/src/linux-4.14.15/tools/objtool/orc_dump.o
  CC       /usr/src/linux-4.14.15/tools/objtool/elf.o
  CC       /usr/src/linux-4.14.15/tools/objtool/special.o
  CC       /usr/src/linux-4.14.15/tools/objtool/objtool.o
  CC       /usr/src/linux-4.14.15/tools/objtool/libstring.o
  CC       /usr/src/linux-4.14.15/tools/objtool/str_error_r.o
  LD       /usr/src/linux-4.14.15/tools/objtool/objtool-in.o
  LINK     /usr/src/linux-4.14.15/tools/objtool/objtool
make[2]: Leaving directory '/usr/src/linux-4.14.15'
echo done > debian/stamp/conf/kernel-conf
make[1]: Leaving directory '/usr/src/linux-4.14.15'
make -f debian/rules debian/stamp/conf/full-changelog
make[1]: Entering directory '/usr/src/linux-4.14.15'
====== 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/4.14.15/g'  \
                -e 's/=D/4.14.15-10.00.Custom/g'         -e 's/=A/amd64/g'  \
    -e 's/=SA//g'  \
    -e 's/=I//g'                    \
    -e 's/=CV/4.14/g'                \
    -e 's/=M/Unknown Kernel Package Maintainer <unknown@unconfigured.in.etc.kernel-pkg.conf>/g'                \
    -e 's/=ST/linux/g'      -e 's/=B/x86_64/g'    \
                -e 's/=R//g'  /usr/share/kernel-package/Control > debian/control
sed -e 's/=V/4.14.15/g' -e 's/=D/4.14.15-10.00.Custom/g'          \
    -e 's/=A/amd64/g' -e 's/=M/Unknown Kernel Package Maintainer <unknown@unconfigured.in.etc.kernel-pkg.conf>/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 '/usr/src/linux-4.14.15'
make[2]: 'debian/stamp/conf/kernel-conf' is up to date.
make[2]: Leaving directory '/usr/src/linux-4.14.15'
make[1]: Leaving directory '/usr/src/linux-4.14.15'
echo done > debian/stamp/conf/minimal_debian
exec debian/rules  
nothing to be done.

​I think it's worked.  I am going to back to the list of tasks I made on this figure out what to do next to install it so grub can see it etc and I can reboot
and try to run it and log in etc.

Cheers

MF​


 

Don't try to force the use of gcc-8 until you know that everything runs
properly with the default compiler.

Maybe you should follow the advice from the previously posted error
message:

"make[2]: Entering directory '/usr/src/linux-4.14.15'
Makefile:942: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
please install libelf-dev, libelf-devel or elfutils-libelf-devel".  Stop."
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

(Ignore the messages about the debian directory.)
If similar messages as the above appear again, try to figure out what
needs to be additionally installed (some *-dev packages might still be
missing).

Once you get past the first few minutes of the procedure when using the
default compiler and you see how one module after the other is compiled,
hit Ctrl-C, do "make mrproper" and start over again with gcc-8.

This is just my 2¢, but I believe "debugging" one thing at a time is the
more promising approach here.

Good luck (and for now good night :)

Michael



 


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Virtue is a relative term.
                -- Spock, "Friday's Child", stardate 3499.1



Reply to: