From c7db5b67f9602cabd73e0aa1e227744e6261e000 Mon Sep 17 00:00:00 2001 From: Ruben ten Hove Date: Tue, 21 Jun 2022 21:30:43 +0200 Subject: just disable nyx --- nyx_mode/build_nyx_support.sh | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'nyx_mode/build_nyx_support.sh') diff --git a/nyx_mode/build_nyx_support.sh b/nyx_mode/build_nyx_support.sh index 83e0ae32..c4a480e6 100755 --- a/nyx_mode/build_nyx_support.sh +++ b/nyx_mode/build_nyx_support.sh @@ -1,4 +1,7 @@ #!/bin/bash + +set -e + echo "=================================================" echo " Nyx build script" echo "=================================================" @@ -6,14 +9,14 @@ echo echo "[*] Performing basic sanity checks..." -if [ ! "`uname -s`" = "Linux" ]; then +if [ ! "$(uname -s)" = "Linux" ]; then echo "[-] Error: Nyx mode is only available on Linux." exit 0 fi -if [ ! "`uname -m`" = "x86_64" ]; then +if [ ! "$(uname -m)" = "x86_64" ]; then echo "[-] Error: Nyx mode is only available on x86_64 (yet)." exit 0 @@ -22,10 +25,10 @@ fi echo "[*] Making sure all Nyx is checked out" -git status 1>/dev/null 2>/dev/null -if [ $? -eq 0 ]; then - git submodule init || exit 1 +if git status 1>/dev/null 2>&1; then + + git submodule init echo "[*] initializing QEMU-Nyx submodule" git submodule update ./QEMU-Nyx 2>/dev/null # ignore errors echo "[*] initializing packer submodule" @@ -47,32 +50,27 @@ test -e QEMU-Nyx/.git || { echo "[-] QEMU-Nyx not checked out, please install gi echo "[*] checking packer init.cpio.gz ..." if [ ! -f "packer/linux_initramfs/init.cpio.gz" ]; then - cd packer/linux_initramfs/ - sh pack.sh || exit 1 - cd ../../ + (cd packer/linux_initramfs/ && sh pack.sh) fi echo "[*] Checking libnyx ..." if [ ! -f "libnyx/libnyx/target/release/liblibnyx.a" ]; then - cd libnyx/libnyx - cargo build --release || exit 1 - cd ../../ + (cd libnyx/libnyx && cargo build --release) fi echo "[*] Checking QEMU-Nyx ..." if [ ! -f "QEMU-Nyx/x86_64-softmmu/qemu-system-x86_64" ]; then - cd QEMU-Nyx/ - ./compile_qemu_nyx.sh static || exit 1 - cd .. + + if ! [ "${IS_DOCKER}" = "" ]; then + echo "[-] Disabling GTK as we're building a container image." + sed -i 's/--enable-gtk//g' QEMU-Nyx/compile_qemu_nyx.sh + fi + (cd QEMU-Nyx && ./compile_qemu_nyx.sh static) fi echo "[*] Checking libnyx.so ..." -if [ -f "libnyx/libnyx/target/release/liblibnyx.so" ]; then - cp -v libnyx/libnyx/target/release/liblibnyx.so ../libnyx.so || exit 1 -else - echo "[ ] libnyx.so not found..." - exit 1 -fi +cp libnyx/libnyx/target/release/liblibnyx.so ../libnyx.so + echo "[+] All done for nyx_mode, enjoy!" exit 0 -- cgit 1.4.1 From 32820230471737c7fa7740df736d75d3e8282def Mon Sep 17 00:00:00 2001 From: Ruben ten Hove Date: Tue, 21 Jun 2022 21:36:02 +0200 Subject: check for package instead of if in docker --- nyx_mode/build_nyx_support.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nyx_mode/build_nyx_support.sh') diff --git a/nyx_mode/build_nyx_support.sh b/nyx_mode/build_nyx_support.sh index c4a480e6..e7fca64f 100755 --- a/nyx_mode/build_nyx_support.sh +++ b/nyx_mode/build_nyx_support.sh @@ -61,8 +61,8 @@ fi echo "[*] Checking QEMU-Nyx ..." if [ ! -f "QEMU-Nyx/x86_64-softmmu/qemu-system-x86_64" ]; then - if ! [ "${IS_DOCKER}" = "" ]; then - echo "[-] Disabling GTK as we're building a container image." + if ! dpkg -s gtk3-devel > /dev/null 2>&1; then + echo "[-] Disabling GTK because gtk3-devel is not installed." sed -i 's/--enable-gtk//g' QEMU-Nyx/compile_qemu_nyx.sh fi (cd QEMU-Nyx && ./compile_qemu_nyx.sh static) -- cgit 1.4.1