-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest_linux_kernel.sh
executable file
·30 lines (30 loc) · 1.02 KB
/
test_linux_kernel.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
make menuconfig
#Set CONFIG_IP_PNP_DHCP=y and CONFIG_E1000=y to enable IP address
make -j2
make modules
INSTALL_MOD_PATH=./mods make modules_install
ln -s $PWD/mods/lib/modules/$(make kernelrelease) \
/lib/modules/$(make kernelrelease)
dracut --kver "$(make kernelrelease)" \
--add-drivers "iscsi_target_mod target_core_mod" \
--add-drivers "target_core_file target_core_iblock" \
--add-drivers "configfs" \
--install "ps grep netstat" \
--no-hostonly --no-hostonly-cmdline \
--modules "bash base shutdown network ifcfg" initramfs
qemu-kvm -kernel arch/x86/boot/bzImage \
-initrd initramfs \
-device e1000,netdev=network0 \
-netdev user,id=network0 \
-redir tcp:51550::3260 \
-append "ip=dhcp rd.shell=1 console=ttyS0" \
-nographic
#ip a
#modprobe iscsi_target_mod
#mount -t configfs configfs /sys/kernel/config/
#mkdir /sys/kernel/config/target/iscsi
#iscsiadm --mode discovery \
# --type sendtargets \
# --portal 127.0.0.1:51550