--target-arch: introduce aliases for some archs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
Wishlist
|
Paolo Pisati |
Bug Description
Instead of forcing the outside world to think of architectures as the 'deb world' expect it, introduce a new field called 'target' in the _ARCH_TRANSLATIONS data struct, and moves _find_machine() to use that field - that let me introduce aliases for some arches and simplify some scripts used to build kernels using snapcraft.
With this patch i'm able to trim down that much shell code that was in place just to mimic a deb arch (instead of just passing down the arch the kernel was building for):
-set_snaparch() {
- # Attempt to find the correct architecture
- case "$UTS_MACHINE" in
- i386|ia64|alpha)
- snaparch=
- x86_64)
- snaparch=amd64 ;;
- sparc*)
- snaparch=sparc ;;
- s390*)
- snaparch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;;
- ppc*)
- snaparch=$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo ppc64el || echo powerpc) ;;
- parisc*)
- snaparch=hppa ;;
- mips*)
- snaparch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
- aarch64)
- snaparch=arm64 ;;
- arm*)
- if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
- if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then
- snaparch=armhf
- else
- snaparch=armel
- fi
- else
- snaparch=arm
- fi
- ;;
- *)
- snaparch=$(dpkg --print-
- echo "" >&2
- echo "** ** ** WARNING ** ** **" >&2
- echo "" >&2
- echo "Your architecture doesn't have it's equivalent" >&2
- echo "Debian userspace architecture defined!" >&2
- echo "Falling back to using your current userspace instead!" >&2
- echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
- echo "" >&2
- esac
- forcearch=
-}
-
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
https:/ /github. com/snapcore/ snapcraft/ pull/1204