Skip to content

BASE_ARCH=aarch64 is Ignored #239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jxmx opened this issue Nov 30, 2024 · 2 comments · May be fixed by #247
Open

BASE_ARCH=aarch64 is Ignored #239

jxmx opened this issue Nov 30, 2024 · 2 comments · May be fixed by #247

Comments

@jxmx
Copy link
Contributor

jxmx commented Nov 30, 2024

Something in the last month or so is making the value set of BASE_ARCH skew from what is set in the configuration. Given the following config:

export DIST_NAME=AllStarLink3
export DIST_VERSION=3.0.14

# rpi-imager json generator settings
export RPI_IMAGER_NAME="${DIST_NAME}"
export RPI_IMAGER_DESCRIPTION="ASL3"
export RPI_IMAGER_WEBSITE="https://allstarlink.org"
export RPI_IMAGER_ICON="https://raw.githubusercontent.com/guysoft/CustomPiOS/devel/media/rpi-imager-CustomPiOS.png"

export MODULES="base(network,pkgupgrade,asl3)"

# Base configuration
export BASE_ARCH=aarch64
export BASE_IMAGE_ENLARGEROOT=512
export BASE_DISTRO=raspios64
export BASE_BOARD=raspberrypiarm64
export BASE_ADD_USER=no

# PKGUPGRADE
export PKGUPGRADE_DISTUPGRADE=y
export PKGUPGRADE_DISTUPGRADE_METHOD=dist-upgrade
export ASL3_REPO_LVL="main"

I would expect BASE_ARCH=aarch64 to be fixed. However when the code gets to the selection of qemu-arm-static in src/custompios the value is being reset to BASE_ARCH=armhf and I'm not entirely sure where:

+ echo BASE_ARCH=armhf
BASE_ARCH=armhf
++ uname -m
+ '[' aarch64 '!=' armv7l ']'
++ uname -m
+ '[' aarch64 '!=' aarch64 ']'
+ [[ armhf == \a\r\m\v\7\l ]]
+ [[ armhf == \a\r\m\h\f ]]
++ uname -m
+ [[ aarch64 != \a\r\m\v\7\l ]]
++ which qemu-aarch64-static
+ cp usr/bin/qemu-aarch64-static
cp: missing destination file operand after 'usr/bin/qemu-aarch64-static'
Try 'cp --help' for more information.
++++ echo_red 'build failed, unmounting image...'

Note that I've added some debugging and changes to custompios to try to figure out what's happening. By the time the build process gets here, BASE_ARCH is being change from aarch64 to armhf.

@jxmx
Copy link
Contributor Author

jxmx commented Nov 30, 2024

I should additionally point out that the script is properly downloading the arm64 image:

Downloading latest Raspbian image from https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2024-11-19/2024-11-19-raspios-bookworm-arm64-lite.img.xz

However, I finally figured out that this is erroneously sneaking into the configuration via extra_board_config:

# cat asl3/src/workspace/extra_board_config
export BASE_ARCH="armhf"

Looks like this is being set somewhere in src/custompios_core/generate_board_config.py or one of the other modules. I'm not entirely sure where since BASE_BOARD=raspberrypiarm64 should result in the correct configuration if I read the images.yml file correctly.

@jxmx
Copy link
Contributor Author

jxmx commented Dec 1, 2024

Tracking this down further, it appears that generate_board_config.py is getting called in build before the configuration file is being read in:

++ export EXTRA_BOARD_CONFIG=/tmp/tmp.8JwPSXLnpI
++ EXTRA_BOARD_CONFIG=/tmp/tmp.8JwPSXLnpI
++ /home/admin/asl3-pi-image/CustomPiOS/src/custompios_core/generate_board_config.py /tmp/tmp.8JwPSXLnpI
++ echo 'Temp source file: /tmp/tmp.8JwPSXLnpI'
Temp source file: /tmp/tmp.8JwPSXLnpI
++ source /home/admin/asl3-pi-image/CustomPiOS/src/common.sh
++ install_cleanup_trap
++ set -e
++ trap cleanup SIGINT SIGTERM
++++ realpath -s /home/admin/asl3-pi-image/CustomPiOS/src/build
+++ dirname /home/admin/asl3-pi-image/CustomPiOS/src/build
++ CUSTOM_OS_PATH=/home/admin/asl3-pi-image/CustomPiOS/src
++ source /home/admin/asl3-pi-image/CustomPiOS/src/config '' /tmp/tmp.8JwPSXLnpI

The file being created in /tmp will always contain export BASE_ARCH="armhf" because the environment variables set by the particular build's config file is not sourced and loaded before calling generate_board_config.py. And then the output of generate_board_config.py seems to always override the config setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant