Linux 内核构建 - 不要更改 vmlinuz

Linux 内核构建 - 不要更改 vmlinuz

构建上游内核时,/boot/vmlinuz/boot/System.Map更新并指向新安装的内核映像。是否可以通过更改配置或 Makefile 参数来禁用此行为?

我正在像这样构建内核:

make oldconfig
make bzImage
make modules
make modules_install
make install

答案1

make install调用/sbin/installkernel将更新vmlinuz符号链接。没有选项可以禁用此行为。但是,如果您复制/sbin/installkernel到,~/bin/installkernel则可以从该副本中删除链接,并优先make install使用此位置。installkernel/sbin/

在我的版本中,installkernel它的这部分updatever功能是:

 44   # This section is for backwards compatibility only
 45   if test -f "$dir/$1" ; then
 46     # The presence of "$dir/$1" is unusual in modern intallations, and
 47     # the results are mostly unused.  So only recreate them if they
 48     # already existed.
 49     if test -L "$dir/$1" ; then
 50         # If we were using links, continue to use links, updating if
 51         # we need to.
 52         if [ "$(readlink -f ${dir}/${1})" = "${dir}/${1}-${ver}" ]; then
 53             # Yup, we need to change
 54             ln -sf "$1-$ver.old" "$dir/$1.old"
 55         else
 56             mv "$dir/$1" "$dir/$1.old"
 57         fi
 58         ln -sf "$1-$ver" "$dir/$1"
 59     else                        # No links
 60         mv "$dir/$1" "$dir/$1.old"
 61         cat "$2" > "$dir/$1"
 62     fi
 63   fi

就我个人而言,我根本不使用vmlinuzand 。System.Map

相关内容