From bd37b5838e3952d09fff86e8806510d5786c580d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 12 Nov 2023 23:54:16 +0100 Subject: [PATCH] Add platforms/test-environments.txt and platforms/environments/. --- .../environments/qemu-x86_64-openbsd73.txt | 67 +++++++++++ .../environments/virtualbox-openbsd73.txt | 50 ++++++++ platforms/test-environments.txt | 110 ++++++++++++++++++ 3 files changed, 227 insertions(+) create mode 100644 platforms/environments/qemu-x86_64-openbsd73.txt create mode 100644 platforms/environments/virtualbox-openbsd73.txt create mode 100644 platforms/test-environments.txt diff --git a/platforms/environments/qemu-x86_64-openbsd73.txt b/platforms/environments/qemu-x86_64-openbsd73.txt new file mode 100644 index 00000000..b1868a9c --- /dev/null +++ b/platforms/environments/qemu-x86_64-openbsd73.txt @@ -0,0 +1,67 @@ +Use https://cdn.openbsd.org/pub/OpenBSD/7.3/amd64/install73.iso -> OpenBSD-7.3-amd64-install.iso. + + +Use qemu-8.0.2 +PATH=$HOME/inst-qemu/8.0.2/bin:$PATH + +Create empty disk: +qemu-img create -f vmdk openbsd73.vmdk 8G + +Boot with CD: + +machine_args="-enable-kvm -m 1024" +disk_args="-device virtio-blk,drive=hd0 -drive if=none,file=x86_64-openbsd73/openbsd73.vmdk,id=hd0" +net_args="-net user -net nic,model=virtio" +#display_args="-nographic" +display_args="-display gtk -monitor stdio" +common_args="$machine_args $disk_args $net_args $display_args" +qemu-system-x86_64 $common_args -cdrom OpenBSD-7.3-amd64-install.iso + + +(I)nstall. +Host name: openbsd73 +Root password: ******** +X Window System: no +Setup a user? + login: ***** + password: ******** +Allow root ssh login: yes +Partitioning: (W)hole disk MBR, then (E)dit auto layout + d e + d d + d b + c a + 14680064 [= 7 GB] + a b + swap + p + q +Sets: + -game73.tgz + -xbase73.tgz + -xshare73.tgz + -xfont73.tgz + -xserv73.tgz +Continue without verification: yes + +Reboot. +Boot from the installed disk, without the CD +(does not need a -kernel option, since a SeaBIOS bootloader is installed): +qemu-system-x86_64 $common_args + +# mail + +# Install some packages. +# List is at https://ftp.hostserver.de/pub/OpenBSD/7.3/packages/amd64/ +# See https://www.openbsd.org/faq/faq15.html#PkgMgmt +Edit ~/.profile to define PKG_PATH: +PKG_PATH=https://ftp.hostserver.de/pub/OpenBSD/7.3/packages/`uname -m`/ +export PKG_PATH +Logout. + +# pkg_add bzip2 +# pkg_add gtar +# pkg_add bash +# pkg_add gmake +# pkg_add vim, pick no_x11 variant +# pkg_add emacs, pick no_x11 variant diff --git a/platforms/environments/virtualbox-openbsd73.txt b/platforms/environments/virtualbox-openbsd73.txt new file mode 100644 index 00000000..7313784a --- /dev/null +++ b/platforms/environments/virtualbox-openbsd73.txt @@ -0,0 +1,50 @@ +Use https://cdn.openbsd.org/pub/OpenBSD/7.3/amd64/install73.iso -> OpenBSD-7.3-amd64-install.iso. + +Disk size: 8 GB + +System > Motherboard: Disable "Enable I/O APIC", otherwise a kernel panic occurs later. +(See https://dev.to/nabbisen/openbsd-73-on-virtualbox-7-installation-as-guest-os-failed-due-to-io-apic-enabled-4ake ) + +(I)nstall. +Host name: openbsd73 +Root password: ******** +X Window System: no +Setup a user? + login: ***** + password: ******** +Allow root ssh login: yes +Partitioning: (W)hole disk MBR, then (E)dit auto layout + d e + d d + d b + c a + 14680064 [= 7 GB] + a b + swap + p + q +Sets: + -game73.tgz + -xbase73.tgz + -xshare73.tgz + -xfont73.tgz + -xserv73.tgz +Continue without verification: yes + +Reboot. Eject CD. +# mail + +# Install some packages. +# List is at https://ftp.hostserver.de/pub/OpenBSD/7.3/packages/amd64/ +# See https://www.openbsd.org/faq/faq15.html#PkgMgmt +Edit ~/.profile to define PKG_PATH: +PKG_PATH=https://ftp.hostserver.de/pub/OpenBSD/7.3/packages/`uname -m`/ +export PKG_PATH +Logout. + +# pkg_add bzip2 +# pkg_add gtar +# pkg_add bash +# pkg_add gmake +# pkg_add vim, pick no_x11 variant +# pkg_add emacs, pick no_x11 variant diff --git a/platforms/test-environments.txt b/platforms/test-environments.txt new file mode 100644 index 00000000..ffad529b --- /dev/null +++ b/platforms/test-environments.txt @@ -0,0 +1,110 @@ +Test environments +================= + +This page explains how to get access to environments of various platforms, +suitable for testing Gnulib. + + +Testing specific operating systems +================================== + +The compile farm +---------------- + +The compile farm (formerly known as GCC compile farm) + +offers developer accounts for Free Software contributors. +After obtaining an account, you have ssh access to machines +with the following OSes: + - GNU/Linux + - macOS + - AIX + - Solaris + + +Virtual machines +---------------- + +For the following OSes, you can install a virtual machine: + - GNU/Hurd + - musl libc (Alpine Linux) + - FreeBSD, DragonFly BSD + - NetBSD + - OpenBSD + - Minix + - Haiku + - Solaris 11.4, Solaris 11 OpenIndiana, Solaris 11 OmnioOS + +There is an investment of ca. 2 hours up-front to create the virtual machine, +and it takes some amount of disk space (typically something like 10 GB for +each virtual machine). + +How to do this: +1. Pick your preferred hypervisor (such as QEMU or VirtualBox). +2. Download an installation CD-ROM or DVD image. +3. Create an empty disk image to be used by the virtual machine. +4. Find the right parameters for the hypervisor, so that it boots from + the CD/DVD. +5. Perform the steps of the installer. +6. Reboot the virtual machine without the CD/DVD. +7. Install whatever packages you will need for development (gcc, g++, + make, vim, emacs). + +As examples, find in the environments/ directory: + * qemu-x86_64-openbsd73.txt: How to install OpenBSD 7.3 with QEMU. + * virtualbox-openbsd73.txt: How to install OpenBSD 7.3 with VirtualBox. + + +Bring your own hardware +----------------------- + +For the following OSes, the simplest approach is to buy some real hardware: + - Android + Costs less than $100. + Configuration details: + + + +Testing specific CPUs +===================== + +For testing specific CPUs, such as + - alpha + - arm + - arm64 + - hppa + - mips, mips64 + - powerpc, powerpc64, powerpc64le + - riscv64 + - s390x + - sparc, sparc64 +the easiest approach is to use QEMU in system emulation mode. + +The how-to is similar to above: +1. Pick your preferred hypervisor (QEMU; for riscv32 you can use tinyemu + instead). +2. Download an installation CD-ROM or DVD image. For most CPUs, Debian + provides installable GNU/Linux images. +3. Create an empty disk image to be used by the virtual machine. +4. Find the right parameters for the hypervisor, so that it boots from + the CD/DVD. This is generally the most challenging part, because + - for some CPUs the boot loader is not standardized, + - for hardware devices such as the Ethernet card, you need to find + a model that QEMU can emulate _and_ that the OS can make use of. +5. Perform the steps of the installer. +6. Reboot the virtual machine without the CD/DVD. +7. Install whatever packages you will need for development (gcc, g++, + make, vim, emacs). + +As examples, look at the recipes from GNU libffcall: + + +QEMU in "user mode" is not recommended in general, because it has limitations: + - Catching stack overflow is not supported. + - ioctl() are not well supported (e.g. functions that deal with ttys). + - glibc iconv modules are not installed. + - On alpha: O_CLOEXEC is not well supported (e.g. in dup3, open). + - On mips: Quiet NaNs behave like signalling NaNs and vice versa. + - On sparc: Spin lock tests hang. +That is, in the really tricky areas QEMU in "user mode" is less reliable +than QEMU in system emulation mode. -- 2.39.5