Skip to content

Commit 6847de5

Browse files
Merge #1018
1018: Update deny list to all system packages for ARMv6 HF. r=Emilgardis a=Alexhuszagh Currently, when using `arm-unknown-linux-gnueabihf`, users frequently try to install packages for the `armhf` Debian architecture, objects which are compiled for ARMv7-A, and therefore are not compatibility with ARMv6 platforms such as the Raspberry Pi 0. This differs from the soft-float targets, where packages for the `armel` architecture are compiled for the ARMv5TE architecture, and therefore are compatible with ARMv5TE, ARMv6, and ARMv7 soft-float targets. Deny-listing all packages for the `armhf` architecture prevents issues such as in #1017, where the use of ARMv7 system packages are linked to the binary, so the resulting binary can no longer be executed on an ARMv6 platform. This is difficult to detect until the user attempts to use the generated objects (binaries, libraries) on native hardware. Also linked is #426. Co-authored-by: Alex Huszagh <[email protected]>
2 parents 7c06ad9 + 5110a98 commit 6847de5

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

.changes/1018.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"description": "deny installation of armhf debian packages for the arm-unknown-linux-gnueabihf target.",
3+
"type": "fixed"
4+
}

docker/Dockerfile.arm-unknown-linux-gnueabihf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ RUN /crosstool-ng.sh arm-unknown-linux-gnueabihf.config 5
1717

1818
ENV PATH /x-tools/arm-unknown-linux-gnueabihf/bin/:$PATH
1919

20+
COPY deny-debian-packages.sh /
21+
RUN TARGET_ARCH=armhf /deny-debian-packages.sh
22+
2023
COPY qemu.sh /
2124
RUN /qemu.sh arm
2225

docker/deny-debian-packages.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,24 @@
33
set -x
44
set -euo pipefail
55

6-
main() {
7-
local package
8-
9-
for package in "${@}"; do
10-
echo "Package: ${package}:${TARGET_ARCH}
6+
deny_package() {
7+
local package="${1}"
8+
local filename="${2}"
9+
echo "Package: ${package}:${TARGET_ARCH}
1110
Pin: release *
12-
Pin-Priority: -1" > "/etc/apt/preferences.d/${package}"
13-
echo "${package}"
14-
done
11+
Pin-Priority: -1" > "/etc/apt/preferences.d/${filename}"
12+
}
13+
14+
main() {
15+
if [[ $# -eq 0 ]]; then
16+
deny_package '*' "all-packages"
17+
else
18+
local package
19+
for package in "${@}"; do
20+
deny_package "${package}" "${package}"
21+
echo "${package}"
22+
done
23+
fi
1524

1625
rm "${0}"
1726
}

0 commit comments

Comments
 (0)