guysoft / CustomPiOS

A Raspberry Pi and other ARM devices distribution builder
GNU General Public License v3.0
516 stars 150 forks source link

Mounting sys directory to allow building of arm64 images #238

Open sharpn opened 5 days ago

sharpn commented 5 days ago

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 commented 5 days ago

Did you test it?

sharpn commented 5 days ago

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 commented 4 days ago

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!