gpt4 book ai didi

linux - 如何加速 Linux 内核重建

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:55:09 24 4
gpt4 key购买 nike

调试内核时,我经常只用 make 重建内核。即使我只修改一行,我也必须通过以下所有命令:

make[1]: Nothing to be done for `all'.
CHK include/generated/uapi/linux/version.h
make[1]: Nothing to be done for `relocs'.
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
PASYMS arch/x86/realmode/rm/pasyms.h
LDS arch/x86/realmode/rm/realmode.lds
LD arch/x86/realmode/rm/realmode.elf
RELOCS arch/x86/realmode/rm/realmode.relocs
OBJCOPY arch/x86/realmode/rm/realmode.bin
AS arch/x86/realmode/rmpiggy.o
CHK kernel/config_data.h
LD arch/x86/realmode/built-in.o
VDSOSYM arch/x86/vdso/vdso-syms.lds
VDSOSYM arch/x86/vdso/vdso32-int80-syms.lds
VDSOSYM arch/x86/vdso/vdso32-syscall-syms.lds
VDSOSYM arch/x86/vdso/vdso32-sysenter-syms.lds
VDSOSYM arch/x86/vdso/vdso32-syms.lds
LD arch/x86/vdso/built-in.o
LD arch/x86/built-in.o
CC drivers/gpu/drm/i915/i915_debugfs.o
LD drivers/gpu/drm/i915/i915.o
LD drivers/gpu/drm/i915/built-in.o
LD drivers/gpu/drm/built-in.o
LD drivers/gpu/built-in.o
LD drivers/built-in.o
CHK include/generated/uapi/linux/version.h
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `relocs'.
LINK vmlinux
LD vmlinux.o
MODPOST vmlinux.o
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
KSYM .tmp_kallsyms1.o
KSYM .tmp_kallsyms2.o
LD vmlinux
SORTEX vmlinux
SYSMAP System.map
Building modules, stage 2.
VOFFSET arch/x86/boot/voffset.h
CC arch/x86/boot/version.o
OBJCOPY arch/x86/boot/compressed/vmlinux.bin
GZIP arch/x86/boot/compressed/vmlinux.bin.gz
MKPIGGY arch/x86/boot/compressed/piggy.S
AS arch/x86/boot/compressed/piggy.o
LD arch/x86/boot/compressed/vmlinux
ZOFFSET arch/x86/boot/zoffset.h
OBJCOPY arch/x86/boot/vmlinux.bin
AS arch/x86/boot/header.o
LD arch/x86/boot/setup.elf
OBJCOPY arch/x86/boot/setup.bin
BUILD arch/x86/boot/bzImage
Setup is 16688 bytes (padded to 16896 bytes).
System is 4107 kB
CRC 9346a092
Kernel: arch/x86/boot/bzImage is ready (#29)
MODPOST 664 modules

把上面的命令都传一遍,差不多要1~2分钟,我还是觉得无聊。有什么技巧可以减少内核重建时间吗?

最佳答案

-j 标志将告诉make 并行执行多少个作业。例如。 make -j4 将并行执行四个作业。

关于你应该将-j设置为什么;我不相信有一个直截了当的答案。

这里有一个很好的话题: GNU make: should the number of jobs equal the number of CPU cores in a system?

关于linux - 如何加速 Linux 内核重建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26837845/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com