Tips and copy-pastable commands

Mesa

  • Guest configuration for Fedora25:
    ./configure --prefix=/usr --enable-libglvnd --enable-selinux --enable-gallium-osmesa --with-dri-driverdir=/usr/lib64/dri --enable-gl --disable-gles1 --enable-gles2 --disable-xvmc --with-egl-platforms=drm,x11,surfaceless,wayland --enable-shared-glapi --enable-gbm --enable-glx-tls --enable-texture-float=yes --enable-gallium-llvm --enable-llvm-shared-libs --enable-dri --with-gallium-drivers=i915,nouveau,r300,svga,swrast,virgl --with-dri-drivers=swrast,nouveau
  • Another configuration I had saved, probably for 32-bit version
    ./configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-asm --enable-selinux --enable-osmesa --with-dri-driverdir=/usr/lib/dri --enable-egl --disable-gles1 --enable-gles2 --disable-xvmc --with-egl-platforms=x11,drm --enable-shared-glapi --enable-gbm --disable-opencl --enable-glx-tls --enable-texture-float=yes --enable-gallium-llvm --enable-dri --enable-xa --with-gallium-drivers=svga,radeonsi,swrast,r600,r300,nouveau,virgl --with-dri-drivers=nouveau,radeon,r200,i915,i965
  • Knowing if you run Wayland or Xorg:
    loginctl # To get session number, generally 2 as used below
    

    loginctl show-session 2 -p Type

Common setup tasks

  • SELinux and NFS/virtualization:
    setsebool -P virt_use_nfs 1
  • Setup RHEL system:
    subscription-manager register
    

    subscription-manager attach --auto subscription-manager repos --enable="rhel-6-server-rpms" subscription-manager repos --enable="rhel-6-server-optional-rpms" subscription-manager repos --enable="rhel-6-server-supplementary-rpms"

  • Resetting NVRAM boot information on Shuttle:
    efibootmgr -c -w -L Fedora -d /dev/sdb -p 1 -l '\EFI\fedora\shim.efi'
    

Creating disk image

  • Linux / QEMU
    qemu-img create -f qcow2 /data/systems/storage-pool/FS.qcow2 80G

Spice-gtk for Mac

  • Configuration
    CPPFLAGS="-I/usr/local/opt/jpeg-turbo/include -I/usr/local/include -I/usr/local/Cellar/openssl/1.0.2j/include" LDFLAGS="-L/usr/local/opt/jpeg-turbo/lib -L/usr/local/lib -L/usr/local/Cellar/openssl/1.0.2j/lib"  ./configure --enable-vala
    

QCow2 image file checks

Lifted straight from Red Hat Bugzilla 1435315:

  • Simple check: qemu-img check file.qcow2
  • Convert file: qemu-img convert -f qcow2 original.qcow2 -O raw target.raw which can uncover some problems by reading all data on disk.
  • Accessing guest data: guestfish --ro -a original.qcow2 -i. The --ro option adds an overlay protecting the disk.
  • virt-ls -lR -a original.qcow2 --checksum will read and compute a checksum of every file. A bit lengthy, I guess.

Building Package remotely

Account on fedoraproject.org. Building with:

fedpkg clone mesa

fedpkg --dist f25 build --scratch --srpm

Build single package

fedpkg build --scratch --srpm

Alternative (local build):

dnf download --source
Build with mock

Quick copy-paste for creating VM

  • virt-install -n f29-shuttle -r 2048 -w type=direct,source=enp5s0,model=virtio --disk size=20 --cdrom /data/systems/ISO/Fedora-Workstation-Live-x86_64-29-1.2.iso 

Setup for Fedora dev

kinit ddd@FEDORAPROJECT.ORG

echo ddd > ~/.fedora.upn Copy ~/.config/copr

udev

udevadm info -q path -n /dev/sda

udevadm info -a -p /sys/block/sda

SELinux

Use ps -eZ to get security info from ps

Namespaces

Running a runtime directly: crun run --bundle /root/fedora test

Use lsns to list namespaces Use nsenter -t -n -m -p to enter a namespace

Network

Abuse nc for simple testing ss to investigate sockets