Skip to content

Commit

Permalink
[WIP] ARM64 Image (#71)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
luigifcruz authored Jan 15, 2022
1 parent 4c736b5 commit e790dee
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 41 deletions.
6 changes: 0 additions & 6 deletions export-image/04-finalise/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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~"
Expand Down
11 changes: 6 additions & 5 deletions scripts/common
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions stage0/00-configure-apt/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 7 additions & 3 deletions stage0/00-configure-apt/files/sources.list
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion stage0/prerun.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions stage1/00-boot-files/files/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions stage2/01-sys-tweaks/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stage3/00-install-packages/00-packages
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions stage3/00-install-packages/00-packages-nr
Original file line number Diff line number Diff line change
@@ -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
lightdm gnome-themes-standard gnome-icon-theme
8 changes: 0 additions & 8 deletions stage3/00-install-packages/01-run.sh

This file was deleted.

5 changes: 1 addition & 4 deletions stage4/05-pisdr-uhd/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions stage4/07-pisdr-sdrplay/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stage4/13-pisdr-gnuradio/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..
Expand Down
2 changes: 1 addition & 1 deletion stage4/22-pisdr-hamlib/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ cd Hamlib
make -j$(nproc)
make install
ldconfig
EOF
EOF
2 changes: 1 addition & 1 deletion stage4/23-pisdr-gpredict/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ bash autogen.sh
make -j$(nproc)
make install
ldconfig
EOF
EOF
2 changes: 1 addition & 1 deletion stage4/28-pisdr-airband/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stage4/37-pisdr-nrsc5/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..
Expand Down
2 changes: 1 addition & 1 deletion stage4/43-pisdr-cleanup/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
EOF

0 comments on commit e790dee

Please sign in to comment.