Skip to content
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

Failing for newer images of Raspberrypi OS #367

Closed
hkfuertes opened this issue Feb 10, 2025 · 1 comment
Closed

Failing for newer images of Raspberrypi OS #367

hkfuertes opened this issue Feb 10, 2025 · 1 comment

Comments

@hkfuertes
Copy link

Hello, I have a little script in docker that simply adds the usb-gadget to the OS. The thing is that i'm able to run it without any issue for 2024-03-15 but not for latest 2024-11-13:

x-builder: &builder
  image: mkaczanowski/packer-builder-arm
  command: build raspios-lite.json
  privileged: true 
  volumes:
    - /dev:/dev
    - .:/build

services:
  lite:
    <<: *builder
    environment:
      # - IMG_URL=https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz
      # - FILENAME=2024-03-15-raspios-bookworm-armhf-lite.img
      - IMG_URL=https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-11-18/2024-11-13-raspios-bookworm-armhf-lite.img.xz
      - FILENAME=2024-11-13-raspios-bookworm-armhf-lite.img

And i'm getting this error:

2025/02/10 20:38:01 packer-builder-arm plugin: 2025/02/10 20:38:01 Uploading to chroot dir: /tmp/1408696431/etc/network/interfaces.d/usb0
2025/02/10 20:38:01 packer-provisioner-file plugin: [INFO] 95 bytes written for 'uploadData'
2025/02/10 20:38:01 [INFO] 95 bytes written for 'uploadData'
==> arm: Upload failed: exit status 1
2025/02/10 20:38:01 packer-provisioner-file plugin: closing
2025/02/10 20:38:01 closing
2025/02/10 20:38:01 packer-builder-arm plugin: 2025/02/10 20:38:01 closing
    arm: usb0 95 B / 95 B [============================] 100.00% 0s
    arm: usb0 95 B / 95 B [============================] 100.00% 0s
==> arm: error while running provision hook: exit status 1
    arm: optional (please ignore) `fuser -k` failed with exit status 1:

Has anything change from their side that you know of? What can it be?

@hkfuertes
Copy link
Author

if it helps, here is the json:

{
    "variables": {
        "url": "{{env `IMG_URL`}}",
        "md5_url": "{{env `IMG_URL`}}.sha256",
        "image_path": "{{env `FILENAME`}}"
    },
    "builders": [
        {
            "type": "arm",
            "file_urls": [
                "{{user `url`}}"
            ],
            "file_checksum_url": "{{user `md5_url`}}",
            "file_checksum_type": "sha256",
            "file_target_extension": "xz",
            "file_unarchive_cmd": [
                "xz",
                "--decompress",
                "$ARCHIVE_PATH"
            ],
            "image_build_method": "reuse",
            "image_path": "{{user `image_path`}}",
            "image_size": "2G",
			"image_type": "dos",
            "image_partitions": [
                {
                    "name": "boot",
                    "type": "c",
                    "start_sector": "8192",
                    "filesystem": "vfat",
                    "size": "256M",
                    "mountpoint": "/boot"
                },
                {
                    "name": "root",
                    "type": "83",
                    "start_sector": "532480",
                    "filesystem": "ext4",
                    "size": "0",
                    "mountpoint": "/"
                }
            ],
            "image_chroot_env": [
                "PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
            ],
            "qemu_binary_source_path": "/usr/bin/qemu-arm-static",
            "qemu_binary_destination_path": "/usr/bin/qemu-arm-static"
        }
    ],
    "provisioners": [
        {
            "type": "shell",
            "inline": [
                "sudo apt-get update",
                "sudo apt-get install -y dnsmasq"
            ]
        },
        {
            "type": "file",
            "source": "sources//etc/dnsmasq.d/usb0",
            "destination": "/etc/dnsmasq.d/usb0"
        },
        {
            "type": "file",
            "source": "sources//etc/network/interfaces.d/usb0",
            "destination": "/etc/network/interfaces.d/usb0"
        },
        {
            "type": "shell",
            "inline": [
                "echo dtoverlay=dwc2,dr_mode=peripheral >> /boot/config.txt",
                "sed -i 's/$/ modules-load=dwc2,g_ether/' /boot/cmdline.txt",
                "echo denyinterfaces usb0 >> /etc/dhcpcd.conf"
            ]
        }
    ],
    "post-processors": [
        {
            "type": "compress",
            "format": "zip",
            "output": "{{user `image_path`}}.zip",
            "keep_input_artifact": true,
            "compression_level": 9
        }
    ]
}

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

No branches or pull requests

1 participant