Boot

Linux 核心建構 - 不要更改 vmlinuz

  • January 17, 2017

在建構上游核心時,/boot/vmlinuz/boot/System.Map更新以指向新安裝的核心映像。是否可以通過更改配置或 Makefile 參數來禁用此行為?

我正在像這樣建構核心:

make oldconfig
make bzImage
make modules
make modules_install
make install

make install呼叫/sbin/installkernel將更新vmlinuz符號連結。沒有選項可以禁用此行為。但是,如果您複製/sbin/installkernel到,則~/bin/installkernel可以從該副本中刪除連結並優先make install使用此位置。installkernel``/sbin/

在我的版本中installkernelupdatever函式的這一部分:

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

引用自:https://serverfault.com/questions/826892