Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
lvm snapshot for menuconfig of old and new kernel [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
duxsco
n00b
n00b


Joined: 05 Jun 2010
Posts: 45

PostPosted: Fri Apr 19, 2013 10:16 pm    Post subject: lvm snapshot for menuconfig of old and new kernel [solved] Reply with quote

Hi.
I would like to know whether I can do the following:
    Chroot into snapshot and open menuconfig of old kernel:
    Code:
    dasa ~ # lvs
      LV        VG   Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
      root      dasa owi-aos- 200,00g
    dasa ~ # lvcreate -l100%FREE -s -n root_snap /dev/dasa/root
    dasa ~ # mount /dev/dasa/root_snap /mnt/snap
    dasa ~ # rsync -av /boot/ /mnt/snap/boot/
    dasa ~ # mount -t proc none /mnt/snap/proc
    dasa ~ # mount --rbind /sys /mnt/snap/sys
    dasa ~ # mount --rbind /dev /mnt/snap/dev
    dasa ~ # chroot /mnt/snap /bin/bash
    dasa ~ # source /etc/profile
    dasa ~ # export PS1="(chroot) $PS1"
    (chroot) dasa ~ # eselect kernel list
    Available kernel symlink targets:
      [1]   linux-3.4.41-gentoo *
    (chroot) dasa ~ # genkernel --menuconfig --save-config --lvm all

    Emerge new kernel outside the snapshot and open menuconfig of new kernel in a different terminal window:
    Code:
    dasa ~ # emerge -avuDN world
    dasa ~ # eselect kernel list
    Available kernel symlink targets:
      [1]   linux-3.4.41-gentoo *
      [2]   linux-3.8.8-gentoo
    dasa ~ # eselect kernel set 2
    dasa ~ # genkernel --menuconfig --save-config --lvm all

That way I have the config of the old and new kernel side by side.


Last edited by duxsco on Sun Apr 21, 2013 10:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
linear
Apprentice
Apprentice


Joined: 12 Aug 2004
Posts: 222

PostPosted: Fri Apr 19, 2013 10:42 pm    Post subject: Reply with quote

Greetings,

Well, if I understand what you are trying to do, you want to grab a copy the file kernel-config-<arch>-<kernel version>-<kernel local version> from the old kernel (READ: inside the snapshot) and compare that with the one from your current kernel?

The key to what you are trying to do is finding out where genkernel saves it's kernel config files by default; under /etc/kernels/.

Once you have a copy of each of the kernel configs on your system, you can just do:
Code:
 ~ # diff kernel-config-<snapshot arch>-<snapshot kernel version>-<kernel local version> kernel-config-<current arch>-<current kernel version>-<kernel local version>

And, I would recommend using CONFIG_LOCALVERSION, if you aren't currently. It helps you keep track of which kernels you built when and why. E.g.:
Code:
CONFIG_LOCALVERSION="-linear-20130401-01"
CONFIG_LOCALVERSION_AUTO=y


HTH. Let us know.
Back to top
View user's profile Send private message
duxsco
n00b
n00b


Joined: 05 Jun 2010
Posts: 45

PostPosted: Fri Apr 19, 2013 10:59 pm    Post subject: Reply with quote

Hi linear. Thanks for the quick response.
I think it's easier to compare two kernels by looking at their configs with menuconfig than running "diff /etc/kernels/kernel-config-x86_64-3.8.8 /etc/kernels/kernel-config-x86_64-3.4.41".
If you just upgraded to a new kernel you just have the standard kernel config which differs from the old and well-configured kernel in hundreds of lines. I would like to know whether s.th. speaks against mounting proc, sys and dev in the mounted snapshot folder and running two instances of menuconfig at the same time.
Will this mess up proc, sys or dev?
Back to top
View user's profile Send private message
linear
Apprentice
Apprentice


Joined: 12 Aug 2004
Posts: 222

PostPosted: Sat Apr 20, 2013 12:04 am    Post subject: Reply with quote

Hmmm...

Well, while the configs are much easier to read with menuconfig, it will take a LOT of flipping between terminal windows and pages within 'make menuconfig' to find all the differences, and the probability of missing something is pretty high. If you are using a standard terminal (e.g. 80 characters wide), then how about trying something like this:
Code:
 ~ # diff -y -W80 /etc/kernels/kernel-config-x86_64-3.8.8 /etc/kernels/kernel-config-x86_64-3.4.41 | less

which produces something like this:
Code:
#                                       #
# Automatically generated make config   # Automatically generated make config
# Linux kernel version: 2.6.33-gentoo   # Linux kernel version: 2.6.33-gentoo
# Wed Jun 30 11:58:11 2010            | # Thu Jul  1 14:39:23 2010
#                                       #
CONFIG_64BIT=y                          CONFIG_64BIT=y
# CONFIG_X86_32 is not set              # CONFIG_X86_32 is not set
CONFIG_X86_64=y                         CONFIG_X86_64=y
CONFIG_X86=y                            CONFIG_X86=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"     CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/confi   CONFIG_ARCH_DEFCONFIG="arch/x86/confi
CONFIG_GENERIC_TIME=y                   CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y            CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y           CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y            CONFIG_GENERIC_CLOCKEVENTS=y
...<snip>...

You can easily tell the changed options by searching for the pipes (e.g. the "|" character) and the missing/added options by searching for the greater than/less than symbols (e.g. the ">" & "<" characters). As a quick example:
Code:
#                                                               #
# Automatically generated make config: don't edit             | # Automatically generated file; DO NOT EDIT.
# Linux kernel version: 2.6.33-gentoo-r2                      | # Linux/x86 3.3.8-gentoo Kernel Configuration
# Wed Jun 30 11:58:11 2010                                    <
#                                                               #
CONFIG_64BIT=y                                                  CONFIG_64BIT=y
# CONFIG_X86_32 is not set                                      # CONFIG_X86_32 is not set
CONFIG_X86_64=y                                                 CONFIG_X86_64=y
CONFIG_X86=y                                                    CONFIG_X86=y
                                                              > CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"                             CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"       CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_GENERIC_TIME=y                                         <
CONFIG_GENERIC_CMOS_UPDATE=y                                    CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y                                   CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y                                    CONFIG_GENERIC_CLOCKEVENTS=y
                                                              > CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y                          CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y                                        CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y                                     CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y                                CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y                                                    CONFIG_MMU=y
CONFIG_ZONE_DMA=y                                             | CONFIG_NEED_DMA_MAP_STATE=y
                                                              > CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y                                        CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y                                        <
CONFIG_GENERIC_BUG=y                                            CONFIG_GENERIC_BUG=y

Just trying to save you some time and headache.

HTH. Let us know.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21431

PostPosted: Sat Apr 20, 2013 12:51 am    Post subject: Reply with quote

onndsd wrote:
I think it's easier to compare two kernels by looking at their configs with menuconfig than running "diff /etc/kernels/kernel-config-x86_64-3.8.8 /etc/kernels/kernel-config-x86_64-3.4.41".
There is no need to play with LVM snapshots for this. If the kernels are of differing versions, their configurations can coexist under the default name. If they are of the same version, you can instruct menuconfig to use an alternate name for one of them.
onndsd wrote:

If you just upgraded to a new kernel you just have the standard kernel config which differs from the old and well-configured kernel in hundreds of lines.
If you just upgraded to a new kernel, you should use one of the oldconfig targets to update your configuration. You still need to proofread it because the results are imperfect, but it does most of the work for you.
onndsd wrote:
I would like to know whether s.th. speaks against mounting proc, sys and dev in the mounted snapshot folder and running two instances of menuconfig at the same time.
Will this mess up proc, sys or dev?
Only root should have permission to damage any of these, so your build user cannot cause any problems here.
Back to top
View user's profile Send private message
duxsco
n00b
n00b


Joined: 05 Jun 2010
Posts: 45

PostPosted: Sun Apr 21, 2013 10:51 pm    Post subject: Reply with quote

Thanks. I forgot that this is possible:
    Terminal 1:
    Code:
    # cd /usr/src/linux-3.4.41-gentoo
    # make menuconfig
    Terminal 2:
    Code:
    # cd /usr/src/linux-3.8.8-gentoo
    # make menuconfig

So, lvm isn't needed. Problem solved :). I'll use menuconfig or diff depending on the situation. Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum