@@ -22,12 +22,10 @@ if [ ! -d "$debootstrap_dir" ]; then
22
22
" $debootstrap_dir " \
23
23
http://deb.debian.org/debian/ \
24
24
;
25
+ sudo rm -f " $root_filesystem "
25
26
fi
26
27
27
- linux_image=" $( printf " ${debootstrap_dir} /boot/vmlinuz-" * ) "
28
-
29
28
if [ ! -f " $root_filesystem " ]; then
30
-
31
29
# Set root password.
32
30
echo ' root:root' | sudo chroot " $debootstrap_dir " chpasswd
33
31
65
63
sudo chmod 666 " $root_filesystem "
66
64
fi
67
65
68
- linux_img =" ${debootstrap_dir} /boot/vmlinuz-" *
66
+ # linux_image ="$(printf "$ {debootstrap_dir}/boot/vmlinuz-"*)"
69
67
70
- # Build the Linux kernel.
71
- git clone --depth 1 --branch v4.18 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
72
- cd linux
73
- wget https://gist.githubusercontent.com/cirosantilli/6e2f4975c1929162a86be09f839874ca/raw/6d151d231a233408a6e1b541bf4a92fd55bf5338/.config
74
- make olddefconfig
75
- make -j` nproc`
76
- cd -
77
- linux_img=" linux/arch/x86_64/boot/bzImage"
68
+ linux_img=linux/arch/x86_64/boot/bzImage
69
+ if [ ! -f " $linux_img " ]; then
70
+ # Build the Linux kernel.
71
+ git clone --depth 1 --branch v4.18 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
72
+ cd linux
73
+ wget https://gist.githubusercontent.com/cirosantilli/6e2f4975c1929162a86be09f839874ca/raw/6d151d231a233408a6e1b541bf4a92fd55bf5338/.config
74
+ make olddefconfig
75
+ make -j` nproc`
76
+ cd -
77
+ fi
78
78
79
79
qemu-system-x86_64 \
80
80
-append ' console=ttyS0 root=/dev/sda' \
81
- -drive " file=img.ext2.qcow2 ,format=qcow2" \
81
+ -drive " file=${root_filesystem} ,format=qcow2" \
82
82
-enable-kvm \
83
83
-serial mon:stdio \
84
84
-m 2G \
85
- -kernel= " $linux_img "
85
+ -kernel " $linux_img " \
86
86
-device rtl8139,netdev=net0 \
87
87
-netdev user,id=net0 \
88
88
;
0 commit comments