From 58841a46010748a392526f26141c9273035ff60a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 7 Aug 2020 14:42:19 +0200 Subject: [run-virt] Fix timeout calls wrt busybox commit c9720a76 --- .../run-virt/data/opt/openslx/scripts/systemd-mount_vm_store | 10 +++++----- .../run-virt/data/opt/openslx/scripts/systemd-run_virt_env | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store b/core/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store index a18b21c7..a9ce62b6 100755 --- a/core/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store +++ b/core/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store @@ -17,15 +17,15 @@ if [ "${SLX_VM_NFS#//}" = "${SLX_VM_NFS}" ]; then # doesn't start with '//' -> assume NFS RET=1 if [ -n "$SLX_VM_NFS_OPTS" ]; then - /opt/openslx/bin/timeout -t 10 -s 9 mount -v -t nfs -o "${SLX_VM_NFS_OPTS},ro" "$SLX_VM_NFS" /mnt/vmstore + /opt/openslx/bin/timeout -s 9 10 mount -v -t nfs -o "${SLX_VM_NFS_OPTS},ro" "$SLX_VM_NFS" /mnt/vmstore RET=$? fi if [ "$RET" != "0" ]; then - /opt/openslx/bin/timeout -t 6 -s 9 mount -v -t nfs -o ro,async,nolock "$SLX_VM_NFS" /mnt/vmstore + /opt/openslx/bin/timeout -s 9 6 mount -v -t nfs -o ro,async,nolock "$SLX_VM_NFS" /mnt/vmstore RET=$? fi if [ "$RET" != "0" ]; then - /opt/openslx/bin/timeout -t 6 -s 9 mount -v -t nfs -o vers=3,ro,async,nolock "$SLX_VM_NFS" /mnt/vmstore + /opt/openslx/bin/timeout -s 9 6 mount -v -t nfs -o vers=3,ro,async,nolock "$SLX_VM_NFS" /mnt/vmstore RET=$? fi else @@ -34,7 +34,7 @@ else export PASSWD="$SLX_VM_NFS_PASSWD" RET=1 if [ -n "$SLX_VM_NFS_OPTS" ]; then - /opt/openslx/bin/timeout -t 10 -s 9 mount -v -t cifs -o "${SLX_VM_NFS_OPTS},uid=0,gid=0,forceuid,forcegid,file_mode=0664,dir_mode=0775,ro" "$SLX_VM_NFS" /mnt/vmstore + /opt/openslx/bin/timeout -s 9 10 mount -v -t cifs -o "${SLX_VM_NFS_OPTS},uid=0,gid=0,forceuid,forcegid,file_mode=0664,dir_mode=0775,ro" "$SLX_VM_NFS" /mnt/vmstore RET=$? fi if [ "$RET" != "0" ]; then @@ -42,7 +42,7 @@ else [ -n "$vers" ] && vers=",vers=${vers}" for sec in "" "ntlmssp" "ntlmv2" "ntlm"; do [ -n "$sec" ] && sec=",sec=${sec}" - /opt/openslx/bin/timeout -t 10 -s 9 mount -v -t cifs -o "ro,file_mode=0644,dir_mode=0755,uid=0,gid=0,forceuid,forcegid,nounix${vers}${sec}" "$SLX_VM_NFS" /mnt/vmstore + /opt/openslx/bin/timeout -s 9 10 mount -v -t cifs -o "ro,file_mode=0644,dir_mode=0755,uid=0,gid=0,forceuid,forcegid,nounix${vers}${sec}" "$SLX_VM_NFS" /mnt/vmstore RET=$? [ "$RET" = "0" ] && break done diff --git a/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env b/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env index f556c368..77dfa194 100755 --- a/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env +++ b/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env @@ -193,7 +193,7 @@ getips () { [ -z "$1" ] && return [ "$1" = "$FALLBACK_DOMAIN" ] && return # Output in one line by using echo without quotes - echo $(busybox timeout -t 2 nslookup "$1" 2>/dev/null | grep -A 4 '^Name:' | grep -E '^Address\s*[0-9]*: ' | awk -F': ' '{print $2}' | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | awk '{print $1}') + echo $(busybox timeout 2 nslookup "$1" 2>/dev/null | grep -A 4 '^Name:' | grep -E '^Address\s*[0-9]*: ' | awk -F': ' '{print $2}' | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | awk '{print $1}') } # read the DNS configuration and configure the udhcpd -- cgit v1.2.3-55-g7522 From 6c04c02b8e63313f30c07a47eb3dfab590dddf71 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 7 Aug 2020 17:56:46 +0200 Subject: [rootfs-stage31] Workaround for busybox tar Busybox tar (newer versions, tested 1.31.1) print an error and exit 1 if two identical symlinks exist in the archive. This works with GNU tar and older versions of busybox. As busybox tar only prints an error but keeps extracting the remaining files, consider this error a success. --- core/rootfs/rootfs-stage31/data/inc/activate_sysconfig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/rootfs/rootfs-stage31/data/inc/activate_sysconfig b/core/rootfs/rootfs-stage31/data/inc/activate_sysconfig index 2d6015e1..c93d6e0d 100644 --- a/core/rootfs/rootfs-stage31/data/inc/activate_sysconfig +++ b/core/rootfs/rootfs-stage31/data/inc/activate_sysconfig @@ -65,7 +65,15 @@ install_config_tgz() { local TEMP_EXTRACT_DIR="/tmp/config.tgz.tmp" # TODO perserve existing directories permissions (but overwrite the permissions of files!) mkdir -p "${TEMP_EXTRACT_DIR}" - tar xf "${CONFIG}.tgz" -C "${TEMP_EXTRACT_DIR}" || { echo "Could not untar ${CONFIG}.tgz to ${TEMP_EXTRACT_DIR}"; return 1; } + # Recent versions of busybox tar bail out if two symlinks with the same name exist in archive + if ! tar xf "${CONFIG}.tgz" -C "${TEMP_EXTRACT_DIR}" 2> /tmp/tarpit; then + # Exit code is unclean... + if ! [ -s /tmp/tarpit ] || grep -q -v 'create symlink' /tmp/tarpit; then + # ...and we have en empty error log, OR any error that isn't "can't create symlink" -> abort + echo "Could not untar ${CONFIG}.tgz to ${TEMP_EXTRACT_DIR}" + return 1 + fi + fi # Write list to stage32 for debug tar tvf "${CONFIG}.tgz" > "${FUTURE_ROOT}/opt/openslx/config.tgz.list" 2>&1 chown -R 0:0 "${TEMP_EXTRACT_DIR}" 2>/dev/null -- cgit v1.2.3-55-g7522 From 24ccc9dae383284c549bc18d12a121af029cc75e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 10 Aug 2020 14:32:31 +0200 Subject: [systemd-distro] Clean up required packages --- core/modules/systemd-distro/module.conf.ubuntu | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/core/modules/systemd-distro/module.conf.ubuntu b/core/modules/systemd-distro/module.conf.ubuntu index 5a90a5a9..3ce18e3a 100644 --- a/core/modules/systemd-distro/module.conf.ubuntu +++ b/core/modules/systemd-distro/module.conf.ubuntu @@ -1,16 +1,4 @@ #!/bin/bash -REQUIRED_INSTALLED_PACKAGES=" - intltool - gperf - dbus - libcap-dev - libudev-dev - libdbus-1-dev - xsltproc - libblkid-dev - libacl1-dev - libpam-dev -" REQUIRED_CONTENT_PACKAGES=" systemd -- cgit v1.2.3-55-g7522 From de3b44dd572fb5e2a6a7514304c3a27230f04390 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 10 Aug 2020 14:32:50 +0200 Subject: [xorg] Conditionally apply Iris workaround --- .../xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/core/modules/xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d b/core/modules/xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d index 05382879..8a436ec1 100644 --- a/core/modules/xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d +++ b/core/modules/xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d @@ -6,5 +6,21 @@ # and newer, which unfortunately completely breaks 3D acceleration with # VMware 15.5.6 (as of 2020-08-04 with Mesa 20.0 + Ubuntu 20.04 as base) -export MESA_LOADER_DRIVER_OVERRIDE=i965 +drivers="$( grep -Po '(?<=Matched )\S*' /var/log/Xorg.0.log )" +intel=false +other=false +for driver in $drivers; do + case "$driver" in + ati|amdgpu|nvidia|nouveau|vmware) + other=true + ;; + intel) + intel=true + ;; + esac +done +if $intel && ! $other; then + export MESA_LOADER_DRIVER_OVERRIDE=i965 +fi +true -- cgit v1.2.3-55-g7522