Skip to content

Mounting sys directory to allow building of arm64 images#238

Merged
guysoft merged 1 commit into
guysoft:develfrom
OverTheAirBrew:devel
Dec 1, 2024
Merged

Mounting sys directory to allow building of arm64 images#238
guysoft merged 1 commit into
guysoft:develfrom
OverTheAirBrew:devel

Conversation

@sharpn

@sharpn sharpn commented Nov 20, 2024

Copy link
Copy Markdown
Contributor

When attempting to update in the base module the update of initramfs-tools fails due to the lack of a sys mount. Added mounts to common.sh to allow the update to continue successfully

@guysoft

guysoft commented Nov 20, 2024

Copy link
Copy Markdown
Owner

Did you test it?

@sharpn

sharpn commented Nov 20, 2024

Copy link
Copy Markdown
Contributor Author

I have yea, I have a successful build working by updating my docker compose to

services:
  custompios:
    # image: guysoft/custompios:devel
    build:
      context: ../../CustomPiOS/src
      dockerfile: Dockerfile
    pull_policy: always
    container_name: piimage-build
    platform: linux/arm64
    tty: true
    restart: always
    privileged: true
    environment:
      - USER=root
      - BASE_BOARD=raspberrypiarm64
    volumes:
      - ./src:/distro
      - ../../CustomPiOS/src:/CustomPiOS
    devices:
      - /dev/loop-control

and running docker exec -it piimage-build build --download

@guysoft

guysoft commented Nov 21, 2024

Copy link
Copy Markdown
Owner

Before I merge this I want to test if it might cause issues. Since sysfs gives access to the hosts hardware.
Also it might make certain processes assume wrong things about the build (for example, if the host is an amd64 device and they look up the host architecture, and then build for amd64, or another would be they base the initramfs ob the hosts partition table).

If that is the case we can always add a variable in the base module to enable/disable the mount. Just updating why I am not merging this right away.

Also - you guys are using CustomPiOS at LEGO Group? If so cool!

@jxmx

jxmx commented Dec 1, 2024

Copy link
Copy Markdown
Contributor

I had this issue as well and this fixes it. The /sys directory is needed to rebuild the initramfs image for Debian 12 Bookworm during Kernel upgrades now. The one comment/addition I would suggest would be to mount it as ro:

 sudo mount -o bind,ro /sys $mount_path/sys

In fact, the script probably could/should for that for /proc as well.

@guysoft guysoft merged commit e29a331 into guysoft:devel Dec 1, 2024
@guysoft

guysoft commented Dec 1, 2024

Copy link
Copy Markdown
Owner

Merging, it looks like its needed.

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 this pull request may close these issues.

3 participants