From 9b4917e39eb31178d76361edd3435fff0112e689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20K=C3=B6hl?= Date: Wed, 29 Nov 2023 17:47:03 +0100 Subject: [PATCH] feat: experimental support for Pi 1, Pi 2, and Pi Zero (#4) --- .cargo/config.toml | 2 +- .vscode/cspell.json | 2 + boot/u-boot/Dockerfile | 2 +- boot/u-boot/armhf_config.txt | 18 ++++++ boot/u-boot/bin/u-boot-armhf-pi1.bin | 3 + boot/u-boot/bin/u-boot-armhf-pi2.bin | 3 + boot/u-boot/bin/u-boot-armhf-zerow.bin | 3 + .../configs/rpi_armhf_pi1_rugpi_defconfig | 61 +++++++++++++++++++ .../configs/rpi_armhf_pi2_rugpi_defconfig | 57 +++++++++++++++++ .../configs/rpi_armhf_zerow_rugpi_defconfig | 57 +++++++++++++++++ boot/u-boot/steps/01-build.sh | 3 + crates/rugpi-bakery/src/config.rs | 20 ++++++ crates/rugpi-bakery/src/tasks/bake.rs | 37 ++++++++--- crates/rugpi-bakery/src/tasks/customize.rs | 10 ++- docker/Dockerfile.rugpi-bakery | 4 +- docker/layers/build-env/10-rust.sh | 2 +- docker/layers/builder/00-prepare.sh | 2 +- docker/layers/builder/10-build.sh | 2 +- recipes/rugpi-ctrl/steps/01-run.sh | 2 +- 19 files changed, 271 insertions(+), 19 deletions(-) create mode 100755 boot/u-boot/armhf_config.txt create mode 100755 boot/u-boot/bin/u-boot-armhf-pi1.bin create mode 100755 boot/u-boot/bin/u-boot-armhf-pi2.bin create mode 100755 boot/u-boot/bin/u-boot-armhf-zerow.bin create mode 100644 boot/u-boot/configs/rpi_armhf_pi1_rugpi_defconfig create mode 100644 boot/u-boot/configs/rpi_armhf_pi2_rugpi_defconfig create mode 100644 boot/u-boot/configs/rpi_armhf_zerow_rugpi_defconfig diff --git a/.cargo/config.toml b/.cargo/config.toml index 93eedfb..0f2c636 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -4,7 +4,7 @@ xtask = "run --package xtask --" [target.x86_64-unknown-linux-gnu] linker = "x86_64-linux-gnu-gcc" -[target.armv7-unknown-linux-musleabihf] +[target.arm-unknown-linux-musleabihf] linker = "arm-linux-gnueabihf-gcc" [target.aarch64-unknown-linux-musl] diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 036eb9c..e9a3e6c 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -1,6 +1,8 @@ { "version": "0.2", "words": [ + "armhf", + "Armhf", "ascii", "avahi", "blkid", diff --git a/boot/u-boot/Dockerfile b/boot/u-boot/Dockerfile index d610ff8..ff43c3b 100644 --- a/boot/u-boot/Dockerfile +++ b/boot/u-boot/Dockerfile @@ -14,7 +14,7 @@ RUN ./00-prepare.sh # Build U-Boot binaries. WORKDIR /home/uboot/u-boot-2023.10 -COPY ./configs/* configs +COPY ./configs/* configs/ COPY ./steps/01-build.sh . RUN ./01-build.sh diff --git a/boot/u-boot/armhf_config.txt b/boot/u-boot/armhf_config.txt new file mode 100755 index 0000000..7f29a33 --- /dev/null +++ b/boot/u-boot/armhf_config.txt @@ -0,0 +1,18 @@ +dtparam=audio=on +camera_auto_detect=1 +display_auto_detect=1 +dtoverlay=vc4-kms-v3d +max_framebuffers=2 + +disable_overscan=1 + +enable_uart=1 + +[pi0w] +kernel=u-boot-armhf-zerow.bin + +[pi1] +kernel=u-boot-armhf-pi1.bin + +[pi2] +kernel=u-boot-armhf-pi2.bin diff --git a/boot/u-boot/bin/u-boot-armhf-pi1.bin b/boot/u-boot/bin/u-boot-armhf-pi1.bin new file mode 100755 index 0000000..18c7be6 --- /dev/null +++ b/boot/u-boot/bin/u-boot-armhf-pi1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:010ed09def3d7b41956234319725ca04e80b5ceb37bb1d2f31f52089edc1922d +size 545388 diff --git a/boot/u-boot/bin/u-boot-armhf-pi2.bin b/boot/u-boot/bin/u-boot-armhf-pi2.bin new file mode 100755 index 0000000..1afac85 --- /dev/null +++ b/boot/u-boot/bin/u-boot-armhf-pi2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c19d09dd02f92822f4763511974b0c1c75a01935ec80a18d504ae76c12f1ab04 +size 539004 diff --git a/boot/u-boot/bin/u-boot-armhf-zerow.bin b/boot/u-boot/bin/u-boot-armhf-zerow.bin new file mode 100755 index 0000000..05f0fba --- /dev/null +++ b/boot/u-boot/bin/u-boot-armhf-zerow.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c13de3976fa50ffacc66296a9542605844e6ba4f72a9454d213d06956443335 +size 545756 diff --git a/boot/u-boot/configs/rpi_armhf_pi1_rugpi_defconfig b/boot/u-boot/configs/rpi_armhf_pi1_rugpi_defconfig new file mode 100644 index 0000000..f88f324 --- /dev/null +++ b/boot/u-boot/configs/rpi_armhf_pi1_rugpi_defconfig @@ -0,0 +1,61 @@ +CONFIG_ARM=y +CONFIG_ARCH_CPU_INIT=y +CONFIG_ARCH_BCM283X=y +CONFIG_TEXT_BASE=0x00008000 +CONFIG_SYS_MALLOC_F_LEN=0x400 +CONFIG_TARGET_RPI=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x7ffff00 +CONFIG_ENV_SIZE=0x4000 +CONFIG_DEFAULT_DEVICE_TREE="bcm2835-rpi-b" +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_SYS_LOAD_ADDR=0x1000000 +CONFIG_BOOTSTD_DEFAULTS=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_FDT_SIMPLEFB=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="pci enum; usb start; setenv kernel_file kernel.img;" +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_MISC_INIT_R=y +CONFIG_SYS_PROMPT="U-Boot> " +CONFIG_SYS_PBSIZE=1049 +CONFIG_CMD_GPIO=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_FS_UUID=y +CONFIG_OF_EMBED=y +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_TFTP_TSIZE=y +CONFIG_BCM2835_GPIO=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_BCM2835=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_GENERIC is not set +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y +CONFIG_USB=y +CONFIG_USB_DWC2=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_SMSC95XX=y +CONFIG_VIDEO=y +# CONFIG_VIDEO_BPP8 is not set +# CONFIG_VIDEO_BPP16 is not set +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_VIDEO_BCM2835=y +CONFIG_CONSOLE_SCROLL_LINES=10 +CONFIG_PHYS_TO_BUS=y +CONFIG_EFI_LOADER=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_BOOTI=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_USE_BOOTARGS=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_BOOTI=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_USE_BOOTARGS=y diff --git a/boot/u-boot/configs/rpi_armhf_pi2_rugpi_defconfig b/boot/u-boot/configs/rpi_armhf_pi2_rugpi_defconfig new file mode 100644 index 0000000..91d4489 --- /dev/null +++ b/boot/u-boot/configs/rpi_armhf_pi2_rugpi_defconfig @@ -0,0 +1,57 @@ +CONFIG_ARM=y +CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_ARCH_CPU_INIT=y +CONFIG_ARCH_BCM283X=y +CONFIG_TEXT_BASE=0x00008000 +CONFIG_SYS_MALLOC_F_LEN=0x400 +CONFIG_TARGET_RPI_2=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x7ffff00 +CONFIG_ENV_SIZE=0x4000 +CONFIG_DEFAULT_DEVICE_TREE="bcm2836-rpi-2-b" +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_SYS_LOAD_ADDR=0x1000000 +CONFIG_BOOTSTD_DEFAULTS=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_FDT_SIMPLEFB=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="pci enum; usb start; setenv kernel_file kernel7.img;" +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_MISC_INIT_R=y +CONFIG_SYS_PROMPT="U-Boot> " +CONFIG_SYS_PBSIZE=1049 +CONFIG_CMD_GPIO=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_FS_UUID=y +CONFIG_OF_EMBED=y +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_TFTP_TSIZE=y +CONFIG_BCM2835_GPIO=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_BCM2835=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_GENERIC is not set +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y +CONFIG_USB=y +CONFIG_USB_DWC2=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_SMSC95XX=y +CONFIG_VIDEO=y +# CONFIG_VIDEO_BPP8 is not set +# CONFIG_VIDEO_BPP16 is not set +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_VIDEO_BCM2835=y +CONFIG_CONSOLE_SCROLL_LINES=10 +CONFIG_PHYS_TO_BUS=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_BOOTI=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_USE_BOOTARGS=y diff --git a/boot/u-boot/configs/rpi_armhf_zerow_rugpi_defconfig b/boot/u-boot/configs/rpi_armhf_zerow_rugpi_defconfig new file mode 100644 index 0000000..9077a59 --- /dev/null +++ b/boot/u-boot/configs/rpi_armhf_zerow_rugpi_defconfig @@ -0,0 +1,57 @@ +CONFIG_ARM=y +CONFIG_ARCH_CPU_INIT=y +CONFIG_ARCH_BCM283X=y +CONFIG_TEXT_BASE=0x00008000 +CONFIG_SYS_MALLOC_F_LEN=0x400 +CONFIG_TARGET_RPI_0_W=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x7ffff00 +CONFIG_ENV_SIZE=0x4000 +CONFIG_DEFAULT_DEVICE_TREE="bcm2835-rpi-zero-w" +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_SYS_LOAD_ADDR=0x1000000 +CONFIG_BOOTSTD_DEFAULTS=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_FDT_SIMPLEFB=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="pci enum; usb start; setenv kernel_file kernel.img;" +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_MISC_INIT_R=y +CONFIG_SYS_PROMPT="U-Boot> " +CONFIG_SYS_PBSIZE=1049 +CONFIG_CMD_GPIO=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_FS_UUID=y +CONFIG_OF_EMBED=y +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_TFTP_TSIZE=y +CONFIG_BCM2835_GPIO=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_BCM2835=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_GENERIC is not set +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y +CONFIG_USB=y +CONFIG_USB_DWC2=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_SMSC95XX=y +CONFIG_VIDEO=y +# CONFIG_VIDEO_BPP8 is not set +# CONFIG_VIDEO_BPP16 is not set +CONFIG_SYS_WHITE_ON_BLACK=y +CONFIG_VIDEO_BCM2835=y +CONFIG_CONSOLE_SCROLL_LINES=10 +CONFIG_PHYS_TO_BUS=y +CONFIG_EFI_LOADER=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_BOOTI=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_USE_BOOTARGS=y diff --git a/boot/u-boot/steps/01-build.sh b/boot/u-boot/steps/01-build.sh index 1284ee0..5b68801 100755 --- a/boot/u-boot/steps/01-build.sh +++ b/boot/u-boot/steps/01-build.sh @@ -27,3 +27,6 @@ function build_uboot() { } build_uboot arm64 64 rpi_arm64_rugpi_defconfig +build_uboot armhf-zerow 32 rpi_armhf_zerow_rugpi_defconfig +build_uboot armhf-pi1 32 rpi_armhf_pi1_rugpi_defconfig +build_uboot armhf-pi2 32 rpi_armhf_pi2_rugpi_defconfig \ No newline at end of file diff --git a/crates/rugpi-bakery/src/config.rs b/crates/rugpi-bakery/src/config.rs index fa35739..607a4f5 100644 --- a/crates/rugpi-bakery/src/config.rs +++ b/crates/rugpi-bakery/src/config.rs @@ -29,6 +29,9 @@ pub struct BakeryConfig { /// Indicates whether to include firmware files in the image. #[serde(default)] pub include_firmware: IncludeFirmware, + /// The target architecture to build an image for. + #[serde(default)] + pub architecture: Architecture, /// Indicates which boot flow to use for the image. #[serde(default)] pub boot_flow: BootFlow, @@ -43,6 +46,23 @@ pub enum IncludeFirmware { Pi5, } +#[derive(Debug, Clone, Copy, Serialize, Deserialize, Default)] +#[serde(rename_all = "lowercase")] +pub enum Architecture { + #[default] + Arm64, + Armhf, +} + +impl Architecture { + pub fn as_str(self) -> &'static str { + match self { + Architecture::Arm64 => "arm64", + Architecture::Armhf => "armhf", + } + } +} + /// Load the configuration file from the current directory. pub fn load_config(args: &Args) -> Anyhow { let current_dir = PathBuf::try_from(env::current_dir()?)?; diff --git a/crates/rugpi-bakery/src/tasks/bake.rs b/crates/rugpi-bakery/src/tasks/bake.rs index 90253ad..c396536 100644 --- a/crates/rugpi-bakery/src/tasks/bake.rs +++ b/crates/rugpi-bakery/src/tasks/bake.rs @@ -15,7 +15,7 @@ use tempdir::TempDir; use xscript::{run, Run}; use crate::{ - config::{load_config, BakeryConfig, IncludeFirmware}, + config::{load_config, Architecture, BakeryConfig, IncludeFirmware}, Args, }; @@ -121,14 +121,33 @@ fn setup_uboot_boot_flow(ctx: &BakeCtx) -> Anyhow<()> { ctx.mounted_config.path() ])?; std::fs::remove_file(&ctx.mounted_config.path().join("kernel8.img"))?; - std::fs::copy( - "/usr/share/rugpi/boot/u-boot/arm64_config.txt", - ctx.mounted_config.path().join("config.txt"), - )?; - std::fs::copy( - "/usr/share/rugpi/boot/u-boot/bin/u-boot-arm64.bin", - ctx.mounted_config.path().join("u-boot-arm64.bin"), - )?; + match ctx.config.architecture { + Architecture::Arm64 => { + std::fs::copy( + "/usr/share/rugpi/boot/u-boot/arm64_config.txt", + ctx.mounted_config.path().join("config.txt"), + )?; + std::fs::copy( + "/usr/share/rugpi/boot/u-boot/bin/u-boot-arm64.bin", + ctx.mounted_config.path().join("u-boot-arm64.bin"), + )?; + } + Architecture::Armhf => { + std::fs::copy( + "/usr/share/rugpi/boot/u-boot/armhf_config.txt", + ctx.mounted_config.path().join("config.txt"), + )?; + for model in ["zerow", "pi1", "pi2"] { + std::fs::copy( + format!("/usr/share/rugpi/boot/u-boot/bin/u-boot-armhf-{model}.bin"), + ctx.mounted_config + .path() + .join(format!("u-boot-armhf-{model}.bin")), + )?; + } + } + } + std::fs::copy( "/usr/share/rugpi/boot/u-boot/bin/boot.scr", ctx.mounted_config.path().join("boot.scr"), diff --git a/crates/rugpi-bakery/src/tasks/customize.rs b/crates/rugpi-bakery/src/tasks/customize.rs index 6a75706..2478de0 100644 --- a/crates/rugpi-bakery/src/tasks/customize.rs +++ b/crates/rugpi-bakery/src/tasks/customize.rs @@ -40,7 +40,7 @@ pub fn run(args: &Args, task: &CustomizeTask) -> Anyhow<()> { let root_dir_path = Utf8Path::from_path(root_dir.path()).unwrap(); println!("Extracting system files..."); run!(["tar", "-x", "-f", &task.src, "-C", root_dir_path])?; - apply_recipes(&jobs, root_dir_path)?; + apply_recipes(&config, &jobs, root_dir_path)?; println!("Packing system files..."); run!(["tar", "-c", "-f", &task.dest, "-C", root_dir_path, "."])?; Ok(()) @@ -127,7 +127,11 @@ fn recipe_schedule(config: &BakeryConfig) -> Anyhow> { Ok(recipes) } -fn apply_recipes(jobs: &Vec, root_dir_path: &Utf8Path) -> Anyhow<()> { +fn apply_recipes( + config: &BakeryConfig, + jobs: &Vec, + root_dir_path: &Utf8Path, +) -> Anyhow<()> { let _mounted_dev = Mounted::bind("/dev", root_dir_path.join("dev"))?; let _mounted_dev_pts = Mounted::bind("/dev/pts", root_dir_path.join("dev/pts"))?; let _mounted_sys = Mounted::bind("/sys", root_dir_path.join("sys"))?; @@ -168,6 +172,7 @@ fn apply_recipes(jobs: &Vec, root_dir_path: &Utf8Path) -> Anyhow<()> let mut vars = vars! { DEBIAN_FRONTEND = "noninteractive", RUGPI_ROOT_DIR = "/", + RUGPI_ARCH = config.architecture.as_str(), RECIPE_DIR = "/run/rugpi/bakery/recipe/", RECIPE_STEP_PATH = &script, }; @@ -181,6 +186,7 @@ fn apply_recipes(jobs: &Vec, root_dir_path: &Utf8Path) -> Anyhow<()> let mut vars = vars! { DEBIAN_FRONTEND = "noninteractive", RUGPI_ROOT_DIR = root_dir_path, + RUGPI_ARCH = config.architecture.as_str(), RECIPE_DIR = &recipe.path, RECIPE_STEP_PATH = &script, }; diff --git a/docker/Dockerfile.rugpi-bakery b/docker/Dockerfile.rugpi-bakery index 58f7e4e..d11cf0b 100644 --- a/docker/Dockerfile.rugpi-bakery +++ b/docker/Dockerfile.rugpi-bakery @@ -82,8 +82,8 @@ RUN /tmp/rugpi-docker/10-setup.sh RUN mkdir -p /usr/share/rugpi/binaries/{arm64,armhf} COPY --from=builder /project/target/aarch64-unknown-linux-musl/release/rugpi-ctrl /usr/share/rugpi/binaries/arm64/ COPY --from=builder /project/target/aarch64-unknown-linux-musl/release/rugpi-admin /usr/share/rugpi/binaries/arm64/ -COPY --from=builder /project/target/armv7-unknown-linux-musleabihf/release/rugpi-ctrl /usr/share/rugpi/binaries/armhf/ -COPY --from=builder /project/target/armv7-unknown-linux-musleabihf/release/rugpi-admin /usr/share/rugpi/binaries/armhf/ +COPY --from=builder /project/target/arm-unknown-linux-musleabihf/release/rugpi-ctrl /usr/share/rugpi/binaries/armhf/ +COPY --from=builder /project/target/arm-unknown-linux-musleabihf/release/rugpi-admin /usr/share/rugpi/binaries/armhf/ WORKDIR /project diff --git a/docker/layers/build-env/10-rust.sh b/docker/layers/build-env/10-rust.sh index b1fecff..7d76811 100755 --- a/docker/layers/build-env/10-rust.sh +++ b/docker/layers/build-env/10-rust.sh @@ -39,7 +39,7 @@ apt-get -y clean && rm -rf /var/lib/apt/lists/* curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ | sh -s -- -y --no-modify-path --default-toolchain "${RUST_VERSION}" -rustup target add armv7-unknown-linux-musleabihf # Raspberry Pi (32-bit) +rustup target add arm-unknown-linux-musleabihf # Raspberry Pi (32-bit) rustup target add aarch64-unknown-linux-musl # Raspberry Pi (64-bit) cargo install cargo-chef --locked diff --git a/docker/layers/builder/00-prepare.sh b/docker/layers/builder/00-prepare.sh index faa7f29..5bc77ff 100755 --- a/docker/layers/builder/00-prepare.sh +++ b/docker/layers/builder/00-prepare.sh @@ -5,5 +5,5 @@ set -euo pipefail cargo chef cook --release --bin rugpi-bakery --recipe-path recipe.json # Prepare to build binaries for both, 32-bit and 64-bit Raspberry Pi. -cargo chef cook --release --target armv7-unknown-linux-musleabihf --recipe-path recipe.json +cargo chef cook --release --target arm-unknown-linux-musleabihf --recipe-path recipe.json cargo chef cook --release --target aarch64-unknown-linux-musl --recipe-path recipe.json diff --git a/docker/layers/builder/10-build.sh b/docker/layers/builder/10-build.sh index 56e087d..d114c69 100755 --- a/docker/layers/builder/10-build.sh +++ b/docker/layers/builder/10-build.sh @@ -5,5 +5,5 @@ set -euo pipefail cargo build --release --bin rugpi-bakery # Build binaries for both, 32-bit and 64-bit Raspberry Pi. -cargo build --release --target armv7-unknown-linux-musleabihf +cargo build --release --target arm-unknown-linux-musleabihf cargo build --release --target aarch64-unknown-linux-musl diff --git a/recipes/rugpi-ctrl/steps/01-run.sh b/recipes/rugpi-ctrl/steps/01-run.sh index d486cce..118dc71 100755 --- a/recipes/rugpi-ctrl/steps/01-run.sh +++ b/recipes/rugpi-ctrl/steps/01-run.sh @@ -2,7 +2,7 @@ set -euo pipefail -cp -rp /usr/share/rugpi/binaries/arm64/* "${RUGPI_ROOT_DIR}/usr/bin" +cp -rp "/usr/share/rugpi/binaries/${RUGPI_ARCH}/"* "${RUGPI_ROOT_DIR}/usr/bin" cat >"${RUGPI_ROOT_DIR}/etc/fstab" <