更改 linux 内核安装目录

Change linux kernel installation directory

是否可以在安装自定义 linux 内核时更改 make install 的默认目标( /boot/ )。

简答

需要使用INSTALL_PATH环境变量更改安装目录

示例:

$ export INSTALL_PATH=/tmp
$ make install

详情

来自 make help:

install - Install kernel using

  • (your) ~/bin/installkernel or

  • (distribution) /sbin/installkernel or

  • install to $(INSTALL_PATH) and run lilo

来自 Documentation/kbuild/kbuild.txt:

INSTALL_PATH specifies where to place the updated kernel and system map images. Default is /boot, but you can set it to other values.

此外,来自 Documentation/kbuild/makefiles.txt

INSTALL_PATH

This variable defines a place for the arch Makefiles to install the resident kernel image and System.map file. Use this for architecture-specific install targets.