系统'ip addr'包
----------------
$>iproute2 #软件包.
$>ipaddr_list_flush_or_save #$>ip addr,函数.
qemu-linux内核配置选项
---------
$>vi arch/x86/Kconfig
---------
...
config X86
def_bool y
#
# Note: keep this list sorted alphabetically
#
...
#注释/删掉以下内容
#select ARCH_HAS_STRICT_KERNEL_RWX
...
...
注意:"ARCH_HAS_STRICT_MODULE_RWX"不能被删掉,如果删掉会导致系统启动不起来.
$>cp /boot/config-`uname -r` /torvalds/build/.config
$>make O=/torvalds/build/ menuconfig
---------
CONFIG_FRAME_POINTER #选择,Kernel hacking -> Choose kernel unwinder:Frame pointer unwinder.
CONFIG_SLAB #选择,General setup->Choose SLAB allocator->SLAB.
$>vi /torvalds/build/.config
----
CONFIG_FORTIFY_SOURCE=n
CONFIG_STACKPROTECTOR=n
CONFIG_KEXEC_BZIMAGE_VERIFY_SIG=n
CONFIG_ANDROID=n
CONFIG_RANDOMIZE_BASE=n
CONFIG_GDB_SCRIPTS=y
CONFIG_GCOV_KERNEL=y
CONFIG_GCOV_PROFILE_ALL=y
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
CONFIG_EXT4_FS=y
CONFIG_DEBUG_OBJECTS=y
CONFIG_DEBUG_ENTRY=y
CONFIG_DEBUG_KOBJECT=y
CONFIG_CMDLINE_BOOL=y
CONFIG_PAGE_POOL=y
CONFIG_DRM_VM=y
CONFIG_VIRT_DRIVERS=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=n
CONFIG_PCI_DEBUG=y
CONFIG_DMADEVICES_DEBUG=y
CONFIG_DMADEVICES_VDEBUG=y
CONFIG_DEBUG_DEVRES=y
CONFIG_DEBUG_BLOCK_EXT_DEVT=y
CONFIG_DEBUG_DRIVER=y
CONFIG_DEBUG_STACK_USAGE=y
CONFIG_DEBUG_VM=y
CONFIG_DEBUG_OBJECTS=y
CONFIG_DEBUG_PAGEALLOC=y
CONFI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ONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
CONFIG_FS_ENCRYPTION=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_FD=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=65536
CONFIG_MSDOS_PARTITION=y
CONFIG_MSDOS_FS=y
CONFIG_DEBUG_LIST=y
CONFIG_DLM_DEBUG=y
CONFIG_DEBUG_WX=y
$>make O=/torvalds/build/ V=1 -j`nproc` bzImage
$>/usr/bin/qemu-system-x86_64 -netdev bridge,id=tap0,br=br0 -device e1000,netdev=tap0 -m 1024 -smp `nproc` -nographic -S -s -curses -kernel `pwd`/arch/x86/boot/bzImage -initrd `pwd`/initrd.img -append "console=ttyS0 root=/dev/ram0 init=/init rw nokaslr"
注意:-kernel和-append配合使用,"console=ttyS0"会将内容输出到终端.