Open robbert229 opened 5 years ago
I'm also running Arch Linux, and also seeing the same issue
arm-image output will be in this color.
==> arm-image: Downloading or copying Image
arm-image: Found already downloaded, initial checksum matched, no download needed: http://director.downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2018-11-15/2018-11-13-raspbian-stretch-lite.zip
==> arm-image: Copying source image.
==> arm-image: Image is a zip file.
==> arm-image: Unzipping 2018-11-13-raspbian-stretch-lite.img
arm-image: mappping output-arm-image/image
==> arm-image: kpartx -s -a -v output-arm-image/image
==> arm-image: partitions: [/dev/mapper/loop0p1 /dev/mapper/loop0p2]
arm-image: Mounting: /dev/mapper/loop0p2
arm-image: Mounting: /dev/mapper/loop0p1
==> arm-image: Mounting additional paths within the chroot...
arm-image: Mounting: /proc
arm-image: Mounting: /sys
arm-image: Mounting: /dev
arm-image: Mounting: /dev/pts
arm-image: Mounting: /proc/sys/fs/binfmt_misc
==> arm-image: Installing qemu-user-static in the chroot
==> arm-image: Provisioning with shell script: /tmp/packer-shell329101979
arm-image: /bin/sh: 1: chmod: not found
arm-image: /bin/sh: 1: /tmp/script_1618.sh: Permission denied
@yuval-k Any suggestions?
this seems to be part of the shell provisioner in upstream packer:
I think this error means that chmod
is not found inside the image. can you confirm that?
@yuval-k I think $PATH
might not be set correctly. Setting "execute_command": "/bin/chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
in the shell provisioner makes it work.
thanks for the hint. as you can see here https://github.com/solo-io/packer-builder-arm-image/blob/2a33747c943b22b1e6642a6f226f1ab88f81fb42/pkg/builder/communicator.go#L30 the command is wrapped in a chroot before being executed... is there anything in archlinux that might strip the path env when doing a chroot?
I haven't had a chance to look fully, but here's the Arch wiki page for chroot
and here's the code for arch-chroot
(normally used for installing arch and building packages)
Environment: I am running master branch, though I am experiencing this with older versions. I am running arch linux.
Observed When I do
sudo packer build ./example.json
with the example packer file, I get the following output.Hunch: I assume that this has something to do with me running arch linux, and the chroot not getting set up correctly. Not sure, though I am digging through the source seeing if I can find why this is happening.