Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Why /boot/vmlinuz differs from what i get after recompling the kernel source

  1. #1
    Join Date
    Jan 2009
    Location
    Warsaw
    Posts
    85

    Default Why /boot/vmlinuz differs from what i get after recompling the kernel source

    Hi,
    could somebody explain me, please the difference between the official default kernel and the one I get after compiling the kernel source:
    Code:
    -rw-r--r-- 1 root root  7331952 15. maj 02:26 vmlinuz-4.12.14-lp151.28.10-default
    -rw-r--r-- 1 root root  7338256 30. lip 14:25 vmlinuz-4.12.14-lp151.28.10-orion

    I copied /boot/
    config-4.12.14-lp151.28.10-default to /usr/src/linux/.config, started "make bzImage" and moved the resulted image to /boot with the extension -orion. I wonder why the compilat is not identical with the -default.
    Code:
    
    
    Code:
    kernel-default-4.12.14-lp151.28.10.1.x86_64
    kernel-source-4.12.14-lp151.28.10.1.noarch
    

    The question is insofar important that I cannot fully start Linux with my -orion-kernel: It breaks down with problems to mount sysroot, or X-Windows breaks down. The procedure I know and I apply is:
    Code:
    make bzImage
    copy bzImage, System.map to /boot
    make modules
    make modules_install
    mkinitrd
    I did nothing with symvers*, sysctl* and *hmac files. Is this correct ?


  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,374
    Blog Entries
    3

    Default Re: Why /boot/vmlinuz differs from what i get after recompling the kernel source

    What would be the point of compiling, if you get the same thing?

    It's probably 20 years since I last compiled a kernel, and that was for slackware. So I'm not the most knowledgable about this.

    I would expect that if you compile the kernel, you would get something closer to the vanilla kernel. Some of the features from newer kernels are backported to the default kernel, to support newer hardware.

    Also keep in mind that if you compile the kernel twice, you will get different results -- because the compile time is built into the compiled kernel.
    openSUSE Leap 15.1; KDE Plasma 5;

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,529
    Blog Entries
    15

    Default Re: Why /boot/vmlinuz differs from what i get after recompling the kernel source

    Hi
    So what is the end game for recompiling the kernel? I normally use /proc/config.gz for the config file. The other option is to use OBS for kernel builds.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  4. #4
    Join Date
    Jan 2009
    Location
    Warsaw
    Posts
    85

    Default Re: Why /boot/vmlinuz differs from what i get after recompling the kernel source

    Quote Originally Posted by nrickert View Post
    What would be the point of compiling, if you get the same thing?
    To get the starting point identical with the one provided with the distribution. Surely I'd like to change it later on.
    if you compile the kernel twice, you will get different results -- because the compile time is built into the compiled kernel.
    You are joking.

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,529
    Blog Entries
    15

    Default Re: Why /boot/vmlinuz differs from what i get after recompling the kernel source

    Quote Originally Posted by zlisiecki View Post
    To get the starting point identical with the one provided with the distribution. Surely I'd like to change it later on.
    You are joking.
    Hi
    AFAIK it's being worked on via reproducible builds....
    https://reproducible-builds.org/
    https://lists.opensuse.org/opensuse-.../msg00364.html

    I see this from 2011 on deterministic builds: https://lwn.net/Articles/437864/
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  6. #6
    Join Date
    Sep 2012
    Posts
    4,977

    Default Re: Why /boot/vmlinuz differs from what i get after recompling the kernel source

    Quote Originally Posted by zlisiecki View Post
    could somebody explain me, please the difference between the official default kernel and the one I get after compiling the kernel source
    There are quite a lot of steps performed by build system after make. If you want identical result, you need to replicate them all.
    I copied /boot/config-4.12.14-lp151.28.10-default to /usr/src/linux/.config, started "make bzImage"
    congratulations, you just ruined your kernel source installation. You should never build kernel inside of /usr/src.

  7. #7
    Join Date
    Jan 2009
    Location
    Warsaw
    Posts
    85

    Default Re: Why /boot/vmlinuz differs from what i get after recompling the kernel source

    Oh, this is a simple misunderstanding. They speak of "various timestamps embedded in the object files", but an usual C-language compilat (an object file) does not include any timestemp. What would be the reason for it ? A timestemp is written into a filesystem with each created or changed file, but not into a file-contents ! Under Linux (UNIX) each file has three timestemps: a creation time, last change and last open for reading. You change them while accessing the file, but the file contents does not change by reading of it !

    The author of the excerb, you citied shoud learn Linux filesystem first, before any compilation, otherwise he mixes it.

    If you don't belive, compile any C-cource several times and see the checksum of each product.

    Comming back to my question, we obviously get a kernel source and a kernel ready for use created from a different source. I wonder why ? The question could answere the person, who is responsible for suse-linux package creation.

  8. #8
    Join Date
    Jan 2009
    Location
    Warsaw
    Posts
    85

    Default Re: Why /boot/vmlinuz differs from what i get after recompling the kernel source

    Comming back to my question, we obviously get a kernel source and kernel ready for use generated from a different source. I wonder why ? The main advantage of open source is that we see and we can exactly follow what this software does.

  9. #9
    Join Date
    Jan 2009
    Location
    Warsaw
    Posts
    85

    Default Re: Why /boot/vmlinuz differs from what i get after recompling the kernel source

    Quote Originally Posted by arvidjaar View Post
    There are quite a lot of steps performed by build system after make. If you want identical result, you need to replicate them all.
    Yes, and what are they ? Where are they written down ?
    Quote Originally Posted by arvidjaar View Post
    congratulations, you just ruined your kernel source installation. You should never build kernel inside of /usr/src.
    Why not ? What do you mean by "ruined" ? The standard -default kernel with compiled vmlinuz work well outside of /usr/src. They don't need this directory, do they ?

  10. #10
    Join Date
    Sep 2012
    Posts
    4,977

    Default Re: Why /boot/vmlinuz differs from what i get after recompling the kernel source

    Quote Originally Posted by zlisiecki View Post
    Where are they written down ?
    OBS sources, project and package configuration in OBS, kernel SRPMs specs, sources in kernel SRPMs.
    The standard -default kernel with compiled vmlinuz work well outside of /usr/src.
    I said kernel source, not kernel binary.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •