@@ -89,21 +89,17 @@ setup_variables() {
8989 -append " console=ttyAMA0 root=/dev/vda" )
9090 export CROSS_COMPILE=aarch64-linux-gnu- ;;
9191
92- " x86_64" )
93- case ${REPO} in
94- common-* )
95- config=x86_64_cuttlefish_defconfig
96- qemu_cmdline=( -append " console=ttyS0"
97- -initrd " images/x86_64/rootfs.cpio" ) ;;
98- * )
99- config=defconfig
100- qemu_cmdline=( -drive " file=images/x86_64/rootfs.ext4,format=raw,if=ide"
101- -append " console=ttyS0 root=/dev/sda" ) ;;
102- esac
103- # Use KVM if the processor supports it (first part) and the KVM module is loaded (second part)
104- [[ $( grep -c -E ' vmx|svm' /proc/cpuinfo) -gt 0 && $( lsmod 2> /dev/null | grep -c kvm) -gt 0 ]] && qemu_cmdline=( " ${qemu_cmdline[@]} " -enable-kvm )
105- image_name=bzImage
106- qemu=" qemu-system-x86_64" ;;
92+ " mipsel" )
93+ config=malta_defconfig
94+ image_name=vmlinux
95+ qemu=" qemu-system-mipsel"
96+ qemu_cmdline=( -machine malta
97+ -cpu 24Kf
98+ -append " root=/dev/sda"
99+ -drive " file=images/mipsel/rootfs.ext4,format=raw,if=ide" )
100+ export ARCH=mips
101+ export CROSS_COMPILE=mipsel-linux-gnu- ;;
102+
107103 " ppc32" )
108104 config=ppc44x_defconfig
109105 image_name=zImage
@@ -129,6 +125,22 @@ setup_variables() {
129125 export ARCH=powerpc
130126 export CROSS_COMPILE=powerpc64le-linux-gnu- ;;
131127
128+ " x86_64" )
129+ case ${REPO} in
130+ common-* )
131+ config=x86_64_cuttlefish_defconfig
132+ qemu_cmdline=( -append " console=ttyS0"
133+ -initrd " images/x86_64/rootfs.cpio" ) ;;
134+ * )
135+ config=defconfig
136+ qemu_cmdline=( -drive " file=images/x86_64/rootfs.ext4,format=raw,if=ide"
137+ -append " console=ttyS0 root=/dev/sda" ) ;;
138+ esac
139+ # Use KVM if the processor supports it (first part) and the KVM module is loaded (second part)
140+ [[ $( grep -c -E ' vmx|svm' /proc/cpuinfo) -gt 0 && $( lsmod 2> /dev/null | grep -c kvm) -gt 0 ]] && qemu_cmdline=( " ${qemu_cmdline[@]} " -enable-kvm )
141+ image_name=bzImage
142+ qemu=" qemu-system-x86_64" ;;
143+
132144 # Unknown arch, error out
133145 * )
134146 echo " Unknown ARCH specified!"
@@ -293,7 +305,14 @@ build_linux() {
293305}
294306
295307boot_qemu () {
296- local kernel_image=${tree} /arch/${ARCH} /boot/${image_name}
308+ local kernel_image
309+
310+ if [[ ${image_name} = " vmlinux" ]]; then
311+ kernel_image=${tree} /vmlinux
312+ else
313+ kernel_image=${tree} /arch/${ARCH} /boot/${image_name}
314+ fi
315+
297316 test -e ${kernel_image}
298317 qemu=( timeout 2m unbuffer " ${qemu} "
299318 -m " ${qemu_ram:= 512m} "
0 commit comments