From e790dee3c30220e4f86c9cc2241be4efc8f47391 Mon Sep 17 00:00:00 2001 From: Luigi Cruz Date: Sat, 15 Jan 2022 03:05:22 -0300 Subject: [PATCH] [WIP] ARM64 Image (#71) * initial updates * disable X86 SIMD for uhd * add dependencies to hackrf * replace swig with pybind * add gnuradio 3.9 dependencies * Install pybind11 via pip * compile pybind11 from source * fix volk build script perm * ignore apt packages for dump1090 * fix dpkg ignore dependencies * remove dump1090 * update foxtelem * update foxtelem filename * upgrade to bullseye * change i386 to arm32v7 docker * revert arch detection * use native docker image to build * Add missing dependency. * fix dependency * add dependency * Fix dependencies. * add raspi-config package * update packages to bullseye * add missing packages * remove pip install of ninja and cmake * set uhd arch to armhf * nuke python2 * change armhf to armv6-m * add hardware float to the armv6 flags * tweak armv6 build * disable neon for armv6 * fix rtlsdr-airband build * Initial ARM64 Support * remove gpg from rpi * add gnupg * Update packages. * Fix packages arch. * Enable multithreaded XZ. * add neon flag * Fix limesuite bug. * patch cpu_features for arm64 * fix branch of volk * update cmake command of volk * add debug points * clean debug * turn cpu_features off * add debug * Remove setarch. * delete ld preload * remove preload thingy * merge v6.0 changes * Delete inspectrum.desktop * update sdrplay driver to arm64 * Fix hostname address #73. --- export-image/04-finalise/01-run.sh | 6 ------ scripts/common | 11 ++++++----- stage0/00-configure-apt/00-run.sh | 1 + stage0/00-configure-apt/files/sources.list | 10 +++++++--- stage0/prerun.sh | 2 +- stage1/00-boot-files/files/config.txt | 3 +++ stage2/01-sys-tweaks/01-run.sh | 2 ++ stage3/00-install-packages/00-packages | 2 +- stage3/00-install-packages/00-packages-nr | 4 ++-- stage3/00-install-packages/01-run.sh | 8 -------- stage4/05-pisdr-uhd/00-run.sh | 5 +---- stage4/07-pisdr-sdrplay/00-run.sh | 10 +++++----- stage4/13-pisdr-gnuradio/00-run.sh | 2 +- stage4/22-pisdr-hamlib/00-run.sh | 2 +- stage4/23-pisdr-gpredict/00-run.sh | 2 +- stage4/28-pisdr-airband/00-run.sh | 2 +- stage4/37-pisdr-nrsc5/00-run.sh | 2 +- stage4/43-pisdr-cleanup/01-run.sh | 2 +- 18 files changed, 35 insertions(+), 41 deletions(-) delete mode 100755 stage3/00-install-packages/01-run.sh diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh index b8f57e4..3e72c0c 100755 --- a/export-image/04-finalise/01-run.sh +++ b/export-image/04-finalise/01-run.sh @@ -18,12 +18,6 @@ fi rm -f "${ROOTFS_DIR}/usr/bin/qemu-arm-static" -if [ "${USE_QEMU}" != "1" ]; then - if [ -e "${ROOTFS_DIR}/etc/ld.so.preload.disabled" ]; then - mv "${ROOTFS_DIR}/etc/ld.so.preload.disabled" "${ROOTFS_DIR}/etc/ld.so.preload" - fi -fi - rm -f "${ROOTFS_DIR}/etc/network/interfaces.dpkg-old" rm -f "${ROOTFS_DIR}/etc/apt/sources.list~" diff --git a/scripts/common b/scripts/common index 5b0df12..fe64e74 100644 --- a/scripts/common +++ b/scripts/common @@ -7,20 +7,21 @@ bootstrap(){ local BOOTSTRAP_CMD=debootstrap local BOOTSTRAP_ARGS=() - export http_proxy=${APT_PROXY} + #export http_proxy=${APT_PROXY} if [ "$(dpkg --print-architecture)" != "armhf" ] && [ "$(dpkg --print-architecture)" != "aarch64" ]; then BOOTSTRAP_CMD=qemu-debootstrap fi - BOOTSTRAP_ARGS+=(--arch armhf) + BOOTSTRAP_ARGS+=(--arch arm64) + BOOTSTRAP_ARGS+=(--include gnupg) BOOTSTRAP_ARGS+=(--components "main,contrib,non-free") - BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg") + #BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg") BOOTSTRAP_ARGS+=(--exclude=info) BOOTSTRAP_ARGS+=("$@") printf -v BOOTSTRAP_STR '%q ' "${BOOTSTRAP_ARGS[@]}" - setarch linux32 capsh --drop=cap_setfcap -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true + capsh --drop=cap_setfcap -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true if [ -d "$2/debootstrap" ] && ! rmdir "$2/debootstrap"; then cp "$2/debootstrap/debootstrap.log" "${STAGE_WORK_DIR}" @@ -93,7 +94,7 @@ on_chroot() { mount --bind /sys "${ROOTFS_DIR}/sys" fi - setarch linux32 capsh --drop=cap_setfcap "--chroot=${ROOTFS_DIR}/" -- -e "$@" + capsh --drop=cap_setfcap "--chroot=${ROOTFS_DIR}/" -- -e "$@" } export -f on_chroot diff --git a/stage0/00-configure-apt/00-run.sh b/stage0/00-configure-apt/00-run.sh index d10a49f..651d154 100755 --- a/stage0/00-configure-apt/00-run.sh +++ b/stage0/00-configure-apt/00-run.sh @@ -14,6 +14,7 @@ fi on_chroot apt-key add - < files/raspberrypi.gpg.key on_chroot << EOF +dpkg --add-architecture armhf apt-get update apt-get dist-upgrade -y EOF diff --git a/stage0/00-configure-apt/files/sources.list b/stage0/00-configure-apt/files/sources.list index 4a5dd8a..fa104b7 100644 --- a/stage0/00-configure-apt/files/sources.list +++ b/stage0/00-configure-apt/files/sources.list @@ -1,3 +1,7 @@ -deb http://raspbian.raspberrypi.org/raspbian/ RELEASE main contrib non-free rpi -# Uncomment line below then 'apt-get update' to enable 'apt-get source' -#deb-src http://raspbian.raspberrypi.org/raspbian/ RELEASE main contrib non-free rpi +deb http://deb.debian.org/debian RELEASE main contrib non-free +deb http://security.debian.org/debian-security RELEASE-security main contrib non-free +deb http://deb.debian.org/debian RELEASE-updates main contrib non-free +# Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source' +#deb-src http://deb.debian.org/debian RELEASE main contrib non-free +#deb-src http://security.debian.org/debian-security RELEASE-security main contrib non-free +#deb-src http://deb.debian.org/debian RELEASE-updates main contrib non-free \ No newline at end of file diff --git a/stage0/prerun.sh b/stage0/prerun.sh index d4dd0a1..e001309 100755 --- a/stage0/prerun.sh +++ b/stage0/prerun.sh @@ -1,5 +1,5 @@ #!/bin/bash -e if [ ! -d "${ROOTFS_DIR}" ] || [ "${USE_QCOW2}" = "1" ]; then - bootstrap ${RELEASE} "${ROOTFS_DIR}" http://raspbian.raspberrypi.org/raspbian/ + bootstrap ${RELEASE} "${ROOTFS_DIR}" http://deb.debian.org/debian/ fi diff --git a/stage1/00-boot-files/files/config.txt b/stage1/00-boot-files/files/config.txt index a976ef2..c81eb38 100644 --- a/stage1/00-boot-files/files/config.txt +++ b/stage1/00-boot-files/files/config.txt @@ -62,6 +62,9 @@ display_auto_detect=1 dtoverlay=vc4-kms-v3d max_framebuffers=2 +# Run in 64-bit mode +arm_64bit=1 + # Disable compensation for displays with overscan disable_overscan=1 diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index c1836f9..4a757a1 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -24,6 +24,8 @@ s/^#?[[:blank:]]*PasswordAuthentication[[:blank:]]*yes[[:blank:]]*$/PasswordAuth fi on_chroot << EOF +gcc -march=native -Q --help=target +echo "++++++++++++++++++++++++++++++++++++" systemctl disable hwclock.sh systemctl disable nfs-common systemctl disable rpcbind diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index 02cf93d..322d338 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -1,4 +1,4 @@ -gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav +gstreamer1.0-x gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav qpdfview gtk2-engines alsa-utils desktop-base git diff --git a/stage3/00-install-packages/00-packages-nr b/stage3/00-install-packages/00-packages-nr index eb85329..f8bff31 100644 --- a/stage3/00-install-packages/00-packages-nr +++ b/stage3/00-install-packages/00-packages-nr @@ -1,6 +1,6 @@ -xserver-xorg-video-fbdev xserver-xorg xinit xserver-xorg-video-fbturbo +xserver-xorg xinit mousepad lxde lxtask menu-xdg zenity xdg-utils gvfs-backends gvfs-fuse -lightdm gnome-themes-standard-data gnome-icon-theme \ No newline at end of file +lightdm gnome-themes-standard gnome-icon-theme diff --git a/stage3/00-install-packages/01-run.sh b/stage3/00-install-packages/01-run.sh deleted file mode 100755 index d768747..0000000 --- a/stage3/00-install-packages/01-run.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -e - -on_chroot << EOF -update-alternatives --install /usr/bin/x-www-browser \ - x-www-browser /usr/bin/chromium-browser 86 -update-alternatives --install /usr/bin/gnome-www-browser \ - gnome-www-browser /usr/bin/chromium-browser 86 -EOF diff --git a/stage4/05-pisdr-uhd/00-run.sh b/stage4/05-pisdr-uhd/00-run.sh index 4c92c61..6c19a13 100755 --- a/stage4/05-pisdr-uhd/00-run.sh +++ b/stage4/05-pisdr-uhd/00-run.sh @@ -11,10 +11,7 @@ fi cd uhd/host mkdir -p build cd build -cmake -DCMAKE_CXX_FLAGS:STRING="-march=armv6z -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -Wno-psabi" \ - -DCMAKE_C_FLAGS:STRING="-march=armv6z -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -Wno-psabi" \ - -DCMAKE_ASM_FLAGS:STRING="-march=armv6z -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard " \ - -GNinja -DNEON_SIMD_ENABLE=OFF -DCMAKE_BUILD_TYPE=Release ../ +cmake -GNinja -DNEON_SIMD_ENABLE=ON -DCMAKE_BUILD_TYPE=Release ../ ninja install cp /usr/local/lib/uhd/utils/uhd-usrp.rules /etc/udev/rules.d/ ldconfig diff --git a/stage4/07-pisdr-sdrplay/00-run.sh b/stage4/07-pisdr-sdrplay/00-run.sh index 396ab57..95fcf2d 100755 --- a/stage4/07-pisdr-sdrplay/00-run.sh +++ b/stage4/07-pisdr-sdrplay/00-run.sh @@ -9,12 +9,12 @@ if [ ! -d "sdrplay" ]; then fi cd sdrplay -wget https://www.sdrplay.com/software/SDRplay_RSP_API-ARM32-3.07.2.run -chmod +x ./SDRplay_RSP_API-ARM32-3.07.2.run -./SDRplay_RSP_API-ARM32-3.07.2.run --check -./SDRplay_RSP_API-ARM32-3.07.2.run --noexec --target . +wget https://www.sdrplay.com/software/SDRplay_RSP_API-ARM64-3.07.1.run +chmod +x ./SDRplay_RSP_API-ARM64-3.07.1.run +./SDRplay_RSP_API-ARM64-3.07.1.run --check +./SDRplay_RSP_API-ARM64-3.07.1.run --noexec --target . sed -i 's/more sdrplay_license.txt//g' install_lib.sh -sed -i 's/ARCH=\`uname -m\`/ARCH=armv7l/g' install_lib.sh +sed -i 's/ARCH=\`uname -m\`/ARCH=arm64/g' install_lib.sh printf "\ny\ny\ny\n" | ./install_lib.sh systemctl enable sdrplay ldconfig diff --git a/stage4/13-pisdr-gnuradio/00-run.sh b/stage4/13-pisdr-gnuradio/00-run.sh index b54a0ff..ca6e20e 100755 --- a/stage4/13-pisdr-gnuradio/00-run.sh +++ b/stage4/13-pisdr-gnuradio/00-run.sh @@ -11,7 +11,7 @@ fi cd volk mkdir -p build cd build -cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. +cmake -GNinja -DVOLK_CPU_FEATURES=OFF -DCMAKE_BUILD_TYPE=Release .. ninja install ldconfig cd .. diff --git a/stage4/22-pisdr-hamlib/00-run.sh b/stage4/22-pisdr-hamlib/00-run.sh index ed34c84..475bb04 100755 --- a/stage4/22-pisdr-hamlib/00-run.sh +++ b/stage4/22-pisdr-hamlib/00-run.sh @@ -14,4 +14,4 @@ cd Hamlib make -j$(nproc) make install ldconfig -EOF \ No newline at end of file +EOF diff --git a/stage4/23-pisdr-gpredict/00-run.sh b/stage4/23-pisdr-gpredict/00-run.sh index 4ab1aed..4feb5d2 100755 --- a/stage4/23-pisdr-gpredict/00-run.sh +++ b/stage4/23-pisdr-gpredict/00-run.sh @@ -13,4 +13,4 @@ bash autogen.sh make -j$(nproc) make install ldconfig -EOF \ No newline at end of file +EOF diff --git a/stage4/28-pisdr-airband/00-run.sh b/stage4/28-pisdr-airband/00-run.sh index dab5fae..318cfca 100755 --- a/stage4/28-pisdr-airband/00-run.sh +++ b/stage4/28-pisdr-airband/00-run.sh @@ -9,7 +9,7 @@ if [ ! -d "RTLSDR-Airband" ]; then fi cd RTLSDR-Airband -export PLATFORM=armv7-generic +export PLATFORM=armv8-generic export WITH_SOAPYSDR=1 mkdir -p build cd build diff --git a/stage4/37-pisdr-nrsc5/00-run.sh b/stage4/37-pisdr-nrsc5/00-run.sh index 6cf62ae..192004f 100755 --- a/stage4/37-pisdr-nrsc5/00-run.sh +++ b/stage4/37-pisdr-nrsc5/00-run.sh @@ -11,7 +11,7 @@ fi cd nrsc5 mkdir -p build cd build -cmake -DUSE_NEON=OFF -DUSE_FAAD2=OFF -GNinja .. +cmake -DUSE_NEON=ON -DUSE_FAAD2=OFF -GNinja .. ninja install ldconfig cd .. diff --git a/stage4/43-pisdr-cleanup/01-run.sh b/stage4/43-pisdr-cleanup/01-run.sh index 73677ab..4cd430d 100755 --- a/stage4/43-pisdr-cleanup/01-run.sh +++ b/stage4/43-pisdr-cleanup/01-run.sh @@ -11,4 +11,4 @@ chown pi:pi /etc/udev/rules.d/64-limesuite.rules chown pi:pi /etc/udev/rules.d/66-mirics.rules udevadm control --reload-rules udevadm trigger -EOF \ No newline at end of file +EOF