修改 linux kernel 与 kernel module 的安装路径

指定 bzImage 的安装路径

设定 INSTALL_PATH 即可,示例如下:

longyu@longyu-pc:~/linux-4.19.67$ mkdir /tmp/kernel
longyu@longyu-pc:~/linux-4.19.67$ export INSTALL_PATH=/tmp/kernel
longyu@longyu-pc:~/linux-4.19.67$ make install
sh ./arch/x86/boot/install.sh 4.19.67 arch/x86/boot/bzImage \
        System.map "/tmp/kernel"

查看指定目录的内容:

longyu@longyu-pc:~/linux-4.19.67$ ls /tmp/kernel
config-4.19.67  System.map-4.19.67  vmlinuz-4.19.67

指定 kernel module 的安装路径

设定 INSTALL_MOD_PATH 变量即可,示例如下:

longyu@longyu-pc:~/linux-4.19.67$ mkdir /tmp/kernel-lib
longyu@longyu-pc:~/linux-4.19.67$ export INSTALL_MOD_PATH=/tmp/kernel-lib/
longyu@longyu-pc:~/linux-4.19.67$ make modules_install
  INSTALL drivers/thermal/x86_pkg_temp_thermal.ko
  INSTALL fs/efivarfs/efivarfs.ko
  INSTALL net/ipv4/netfilter/ipt_MASQUERADE.ko
  INSTALL net/ipv4/netfilter/iptable_nat.ko
  INSTALL net/ipv4/netfilter/nf_log_arp.ko
  INSTALL net/ipv4/netfilter/nf_log_ipv4.ko
  INSTALL net/ipv4/netfilter/nf_nat_ipv4.ko
  INSTALL net/ipv6/netfilter/nf_log_ipv6.ko
  INSTALL net/netfilter/nf_log_common.ko
  INSTALL net/netfilter/nf_nat.ko
  INSTALL net/netfilter/nf_nat_ftp.ko
  INSTALL net/netfilter/nf_nat_irc.ko
  INSTALL net/netfilter/nf_nat_sip.ko
  INSTALL net/netfilter/xt_LOG.ko
  INSTALL net/netfilter/xt_addrtype.ko
  INSTALL net/netfilter/xt_mark.ko
  INSTALL net/netfilter/xt_nat.ko
  DEPMOD  4.19.67

查看指定目录下的内容:

longyu@longyu-pc:~/linux-4.19.67$ ls /tmp/kernel-lib/lib/modules/4.19.67/
build   modules.alias      modules.builtin      modules.dep      modules.devname  modules.softdep  modules.symbols.bin
kernel  modules.alias.bin  modules.builtin.bin  modules.dep.bin  modules.order    modules.symbols  source

你可能感兴趣的:(Linux,修改,linux,kernel,与,kernel,module,的安装)