Lines Matching +full:qemu +full:- +full:4 +full:- +full:build

4 # cache - Cached binaries that we have downloaded
5 # trees - binary trees that we use to make image
7 # images - bootable images that we use to test
9 # bios - cached bios images (as well as 'vars' files when we start testing
11 # scripts - generated scripts that uses images to run the tests.
16 # use qemu-system-XXXX to boot. They all boot the same thing at the moment:
23 # eg https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-amd64-b…
25 : ${STAND_ROOT:="${HOME}/stand-test-root"}
38 if [ -f ${t}/tools/build/make.py ]; then
39 MAKE="${t}/tools/build/make.py"
40 case $(uname -m) in
48 die "Do not know about $(uanme -p)"
64 SRCTOP=$(${MAKE} ${DEFARCH} -v SRCTOP)
68 MAKEFS=$(SHELL="which makefs" ${MAKE} ${DEFARCH} buildenv | tail -1) || die "No makefs try WITH_DIS…
69 MKIMG=$(SHELL="which mkimg" ${MAKE} ${DEFARCH} buildenv | tail -1) || die "No mkimg, try buildworld…
70 MTREE=$(SHELL="which mtree" ${MAKE} ${DEFARCH} buildenv | tail -1) || die "No mtree, try buildworld…
72 # MAKE=$(SHELL="which make" ${MAKE} ${DEFARCH} buildenv | tail -1) || die "No make, try buildworld …
74 # hack -- I have extra junk in my qemu, but it's not needed to recreate things
76 qemu_bin=/home/imp/git/qemu/00-build
90 mkdir -p ${CACHE} ${TREES} ${IMAGES} ${BIOS}
104 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
113 local flavor=$4
115 local file="FreeBSD-${v}-RELEASE-${ma_combo}-${flavor}"
116 local url="${URLBASE}/${m}/${ma}/ISO-IMAGES/${v}/${file}.xz"
118 mkdir -p ${CACHE}
119 [ -r ${CACHE}/${file} ] && echo "Using cached ${file}" && return
123 xz -d ${file}.xz || die "Can't uncompress ${file}.xz"
145 local flavor=$4
148 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
150 file="FreeBSD-${v}-RELEASE-${ma_combo}-${flavor}"
152 rm -rf ${dir}
157 mkdir -p ${dir}
161 mkdir -p ${dir}/${d}
164 ln -s . ${dir}/usr
166 tar -C ${dir} -xf ${CACHE}/$file sbin/reboot sbin/halt sbin/init bin/sh sbin/sysctl \
167 lib/libncursesw.so.9 lib/libc.so.7 lib/libedit.so.8 libexec/ld-elf.so.1
174 echo "RC COMMAND RUNNING -- SUCCESS!!!!!"
175 halt -p
182 if [ -d ${OVERRIDE}/${ma_combo}/boot ]; then
191 [ -r $o/$i ] && echo Copying override $i && cp $o/$i ${dir}/$i
197 tar -C ${dir} -xf ${CACHE}/$file \
204 # XXX WHAT TO DO ABOUT LINKER HINTS -- PUNT FOR NOW
205 # XXX also, ZFS not supported on 32-bit powerpc platforms
209 echo -h -D -S115200 > ${dir}/boot.config
226 # Note: armv7 isn't done yet as its the odd-man out -- we need to extract things
236 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
237 dir=${TREES}/${ma_combo}/test-stand
238 mkdir -p ${dir}
239 ${MTREE} -deUW -f ${SRCTOP}/etc/mtree/BSD.root.dist -p ${dir}
242 # Indirection needed because our build system is too complex
245 SHELL="sh -c 'cd stand ; make -j 100 all'" ${MAKE} TARGET=${m} TARGET_ARCH=${ma} buildenv
246 …DESTDIR=${dir} SHELL="sh -c 'cd stand ; make install MK_MAN=no MK_INSTALL_AS_USER=yes WITHOUT_DEBU…
248 rm -rf ${dir}/bin ${dir}/[ac-z]* # Don't care about anything here
259 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
261 dir2=${TREES}/${ma_combo}/test-stand
264 rm -rf ${dir}
265 mkdir -p ${dir}
268 tar -c -f - -C ${dir2} boot | tar -xf - -C ${dir}
270 tar -c -f - -C ${dir3} boot | tar -xf - -C ${dir}
271 (cd ${dir} ; find . | LC_ALL=C sort | cpio -o -H newc | gzip > ${initrd})
282 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
283 dir=${TREES}/${ma_combo}/linuxboot-esp
285 mkdir -p ${dir}
290 mkdir -p ${dir}/efi/boot
311 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
312 src=${TREES}/${ma_combo}/linuxboot-esp
314 dir2=${TREES}/${ma_combo}/test-stand
315 esp=${IMAGES}/${ma_combo}/linuxboot-${ma_combo}.esp
316 ufs=${IMAGES}/${ma_combo}/linuxboot-${ma_combo}.ufs
317 zfs=${IMAGES}/${ma_combo}/linuxboot-${ma_combo}.zfs
318 img=${IMAGES}/${ma_combo}/linuxboot-${ma_combo}.img
319 img2=${IMAGES}/${ma_combo}/linuxboot-${ma_combo}-zfs.img
321 mkdir -p ${IMAGES}/${ma_combo}
322 ${MAKEFS} -t msdos -o fat_type=32 -o sectors_per_cluster=1 \
323 -o volume_label=EFISYS -s80m ${esp} ${src}
324 ${MAKEFS} -t ffs -B little -s 200m -o label=root ${ufs} ${dir} ${dir2}
325 ${MKIMG} -s gpt -p efi:=${esp} -p freebsd-ufs:=${ufs} -o ${img}
326 ${MAKEFS} -t zfs -s 200m \
327 -o poolname=${pool} -o bootfs=${pool} -o rootpath=/ \
329 ${MKIMG} -s gpt \
330 -p efi:=${esp} \
331 -p freebsd-zfs:=${zfs} -o ${img2}
332 rm -f ${esp} # Don't need to keep this around
335 # The raw variant, currently used only on arm64. It boots with the raw interface of qemu
337 # since qemu doesn't currently provide that...
342 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
343 linux="${CACHE}/linux/vmlinux-${m}*"
345 img=${IMAGES}/${ma_combo}/linuxboot-${ma_combo}-raw
353 # At the moment, we have just two -- and the images we've built so far are just
359 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
362 bios_code=${BIOS}/edk2-${ma_combo}-code.fd
363 bios_vars=${BIOS}/edk2-${ma_combo}-vars.fd
366 if [ ${bios_code} -ot /usr/local/share/qemu/edk2-x86_64-code.fd ]; then
367 cp /usr/local/share/qemu/edk2-x86_64-code.fd ${bios_code}
369 cp /usr/local/share/qemu/edk2-i386-vars.fd ${bios_vars}
373 if [ ${bios_code} -ot /usr/local/share/qemu/edk2-aarch64-code.fd ]; then
377 dd if=/usr/local/share/qemu/edk2-aarch64-code.fd of=${bios_code} conv=notrunc
383 img=${IMAGES}/${ma_combo}/linuxboot-${ma_combo}.img
384 img2=${IMAGES}/${ma_combo}/linuxboot-${ma_combo}-raw
385 img3=${IMAGES}/${ma_combo}/linuxboot-${ma_combo}-zfs.img
386 out=${SCRIPTS}/${ma_combo}/linuxboot-test.sh
387 out2=${SCRIPTS}/${ma_combo}/linuxboot-test-raw.sh
388 out3=${SCRIPTS}/${ma_combo}/linuxboot-test-zfs.sh
389 cd=${CACHE}/FreeBSD-13.1-RELEASE-arm64-aarch64-bootonly.iso
390 mkdir -p ${SCRIPTS}/${ma_combo}
394 ${qemu_bin}/qemu-system-x86_64 -nographic -m 512M \\
395 -drive file=${img},if=none,id=drive0,cache=writeback,format=raw \\
396 -device virtio-blk,drive=drive0,bootindex=0 \\
397 -drive file=${bios_code},format=raw,if=pflash \\
398 -drive file=${bios_vars},format=raw,if=pflash \\
399 -monitor telnet::4444,server,nowait \\
400 -serial stdio \$*
405 raw=${IMAGES}/${ma_combo}/freebsd-arm64-aarch64.img
407 ${qemu_bin}/qemu-system-aarch64 -nographic -machine virt,gic-version=3 -m 512M -smp 4 \\
408 -cpu cortex-a57 \\
409 -drive file=${img},if=none,id=drive0,cache=writeback \\
410 -device virtio-blk,drive=drive0,bootindex=0 \\
411 -drive file=${raw},if=none,id=drive1,cache=writeback \\
412 -device nvme,serial=fboot,drive=drive1,bootindex=1 \\
413 -drive file=${bios_code},format=raw,if=pflash \\
414 -drive file=${bios_vars},format=raw,if=pflash \\
415 -monitor telnet::4444,server,nowait \\
416 -serial stdio \$*
419 # Note: We have to use cortex-a57 for raw mode because the
422 ${qemu_bin}/qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt \\
423 -kernel ${img2}.kernel -initrd ${img2}.initrd \\
424 -append "console=ttyAMA0" \\
425 -drive file=${cd},if=none,id=drive0,cache=writeback,format=raw \\
426 -device virtio-blk,drive=drive0,bootindex=0 \\
427 -nographic -monitor telnet::4444,server,nowait \\
428 -serial stdio \$*
431 # Note: We have to use cortex-a57 for raw mode because the
434 ${qemu_bin}/qemu-system-aarch64 -nographic -machine virt,gic-version=3 -m 512M -smp 4 \\
435 -cpu cortex-a57 \\
436 -drive file=${img3},if=none,id=drive0,cache=writeback \\
437 -device virtio-blk,drive=drive0,bootindex=0 \\
438 -drive file=${bios_code},format=raw,if=pflash \\
439 -drive file=${bios_vars},format=raw,if=pflash \\
440 -monitor telnet::4444,server,nowait \\
441 -serial stdio \$*
455 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
456 dir=${TREES}/${ma_combo}/freebsd-esp
457 dir2=${TREES}/${ma_combo}/test-stand
458 rm -rf ${dir}
459 mkdir -p ${dir}
464 mkdir -p ${dir}/efi/boot
477 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
478 src=${TREES}/${ma_combo}/freebsd-esp
480 dir2=${TREES}/${ma_combo}/test-stand
481 esp=${IMAGES}/${ma_combo}/freebsd-${ma_combo}.esp
482 ufs=${IMAGES}/${ma_combo}/freebsd-${ma_combo}.ufs
483 img=${IMAGES}/${ma_combo}/freebsd-${ma_combo}.img
484 mkdir -p ${IMAGES}/${ma_combo}
485 mkdir -p ${dir2}/etc
489 ${MAKEFS} -t msdos -o fat_type=32 -o sectors_per_cluster=1 \
490 -o volume_label=EFISYS -s100m ${esp} ${src}
491 ${MAKEFS} -t ffs -B little -s 200m -o label=root ${ufs} ${dir} ${dir2}
492 ${MKIMG} -s gpt -p efi:=${esp} -p freebsd-ufs:=${ufs} -o ${img}
493 # rm -f ${esp} ${ufs} # Don't need to keep this around
496 set -x
503 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
505 dir2=${TREES}/${ma_combo}/test-stand
506 ufs=${IMAGES}/${ma_combo}/freebsd-${ma_combo}.ufs
507 img=${IMAGES}/${ma_combo}/freebsd-${ma_combo}.img
508 mkdir -p ${IMAGES}/${ma_combo}
509 mkdir -p ${dir2}/etc
513 ${MAKEFS} -t ffs -B little -s 200m \
514 -o label=root,version=2,bsize=32768,fsize=4096,density=16384 \
516 ${MKIMG} -s gpt -b ${dir2}/boot/pmbr \
517 -p freebsd-boot:=${dir2}/boot/gptboot \
518 -p freebsd-ufs:=${ufs} \
519 -o ${img}
520 rm -f ${src}/etc/fstab
522 # PowerPC for 32-bit mac
527 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
529 dir2=${TREES}/${ma_combo}/test-stand
530 ufs=${IMAGES}/${ma_combo}/freebsd-${ma_combo}.ufs
531 img=${IMAGES}/${ma_combo}/freebsd-${ma_combo}.img
532 mkdir -p ${IMAGES}/${ma_combo}
533 mkdir -p ${dir2}/etc
537 ${MAKEFS} -t ffs -B big -s 200m \
538 -o label=root,version=2,bsize=32768,fsize=4096,density=16384 \
540 ${MKIMG} -a 1 -s apm \
541 -p freebsd-boot:=${dir2}/boot/boot1.hfs \
542 -p freebsd-ufs:=${ufs} \
543 -o ${img}
555 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
558 bios_code=${BIOS}/edk2-${ma_combo}-code.fd
559 bios_vars=${BIOS}/edk2-${ma_combo}-vars.fd
562 if [ ${bios_code} -ot /usr/local/share/qemu/edk2-x86_64-code.fd ]; then
563 cp /usr/local/share/qemu/edk2-x86_64-code.fd ${bios_code}
565 cp /usr/local/share/qemu/edk2-i386-vars.fd ${bios_vars}
569 if [ ${bios_code} -ot /usr/local/share/qemu/edk2-aarch64-code.fd ]; then
573 dd if=/usr/local/share/qemu/edk2-aarch64-code.fd of=${bios_code} conv=notrunc
579 img=${IMAGES}/${ma_combo}/freebsd-${ma_combo}.img
580 out=${SCRIPTS}/${ma_combo}/freebsd-test.sh
581 mkdir -p ${SCRIPTS}/${ma_combo}
585 ${qemu_bin}/qemu-system-x86_64 -nographic -m 512M \\
586 -drive file=${img},if=none,id=drive0,cache=writeback,format=raw \\
587 -device virtio-blk,drive=drive0,bootindex=0 \\
588 -drive file=${bios_code},format=raw,if=pflash \\
589 -drive file=${bios_vars},format=raw,if=pflash \\
590 -monitor telnet::4444,server,nowait \\
591 -serial stdio \$*
596 raw=${IMAGES}/${ma_combo}/nvme-test-empty.raw
598 ${qemu_bin}/qemu-system-aarch64 -nographic -machine virt,gic-version=3 -m 512M \\
599 -cpu cortex-a57 -drive file=${img},if=none,id=drive0,cache=writeback -smp 4 \\
600 -device virtio-blk,drive=drive0,bootindex=0 \\
601 -drive file=${bios_code},format=raw,if=pflash \\
602 -drive file=${bios_vars},format=raw,if=pflash \\
603 -drive file=${raw},if=none,id=drive1,cache=writeback,format=raw \\
604 -device nvme,serial=deadbeef,drive=drive1 \\
605 -monitor telnet::4444,server,nowait \\
606 -serial stdio \$*
612 set -x
617 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
618 img=${IMAGES}/${ma_combo}/freebsd-${ma_combo}.img
619 out=${SCRIPTS}/${ma_combo}/freebsd-test.sh
620 mkdir -p ${SCRIPTS}/${ma_combo}
622 ${qemu_bin}/qemu-system-ppc -m 1g -M mac99,via=pmu \\
623 -vga none -nographic \\
624 -drive file=${img},if=virtio \\
625 -prom-env "boot-device=/pci@f2000000/scsi/disk@0:,\\\\\\:tbxi" \\
626 -monitor telnet::4444,server,nowait \\
627 -serial stdio \$*
630 set -x
635 [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}"
636 img=${IMAGES}/${ma_combo}/freebsd-${ma_combo}.img
637 out=${SCRIPTS}/${ma_combo}/freebsd-test.sh
638 mkdir -p ${SCRIPTS}/${ma_combo}
640 ${qemu_bin}/qemu-system-i386 -m 1g \\
641 -vga none -nographic \\
642 -drive file=${img},format=raw \\
643 -nographic \\
644 -monitor telnet::4444,server,nowait \\
645 -serial stdio \$*
652 set -e