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

./setup-alpine.sh: line 208: update-binfmts: command not found #15

Open
Kreyren opened this issue Feb 29, 2024 · 5 comments
Open

./setup-alpine.sh: line 208: update-binfmts: command not found #15

Kreyren opened this issue Feb 29, 2024 · 5 comments

Comments

@Kreyren
Copy link

Kreyren commented Feb 29, 2024

name: Build U-Boot on Tag

on:
  push:
    tags:
      - 'v*' # Trigger only for tags starting with 'v'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Setup latest Alpine Linux
        uses: jirutka/setup-alpine@v1
        with:
          arch: aarch64
          packages: >
            build-base
    
      - name: Run script inside Alpine chroot with aarch64 emulation
        run: uname -m
        shell: alpine.sh {0}
❄️ raptor@pelagus  20:40:52 29.02.2024 +00:00  1m47s71ms
├─ u-boot on  CICD via ❄️  impure (shell) 
╰───❯ act
[Build U-Boot on Tag/build] 🚀  Start image=catthehacker/ubuntu:act-latest
INFO[0000] Parallel tasks (0) below minimum, setting to 1 
[Build U-Boot on Tag/build]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
INFO[0003] Parallel tasks (0) below minimum, setting to 1 
[Build U-Boot on Tag/build]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build U-Boot on Tag/build]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build U-Boot on Tag/build]   ☁  git clone 'https://github.com/jirutka/setup-alpine' # ref=v1
[Build U-Boot on Tag/build] ⭐ Run Pre Setup latest Alpine Linux
[Build U-Boot on Tag/build]   ☁  git clone 'https://github.com/webiny/action-post-run' # ref=3.1.0
[Build U-Boot on Tag/build]   ✅  Success - Pre Setup latest Alpine Linux
[Build U-Boot on Tag/build] ⭐ Run Main actions/checkout@v2
[Build U-Boot on Tag/build]   🐳  docker cp src=/home/raptor/src/u-boot/. dst=/home/raptor/src/u-boot
[Build U-Boot on Tag/build]   ✅  Success - Main actions/checkout@v2
[Build U-Boot on Tag/build] ⭐ Run Main Setup latest Alpine Linux
[Build U-Boot on Tag/build]   🐳  docker cp src=/home/raptor/.cache/act/jirutka-setup-alpine@v1/ dst=/var/run/act/actions/jirutka-setup-alpine@v1/
[Build U-Boot on Tag/build] 'runs-on' key not defined in Build U-Boot on Tag/build
[Build U-Boot on Tag/build] ⭐ Run Main sudo -E ./setup-alpine.sh
[Build U-Boot on Tag/build]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-setup.sh] user= workdir=/var/run/act/actions/jirutka-setup-alpine@v1
[Build U-Boot on Tag/build]   ❓  ::group::Prepare rootfs directory
| ▷ Alpine will be installed into: /home/root/rootfs/alpine-latest-aarch64
[Build U-Boot on Tag/build]   ❓  ::endgroup::
[Build U-Boot on Tag/build]   ❓  ::group::Download static apk-tools
| ▷ Downloading https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.0/x86_64/apk.static
| apk: OK
[Build U-Boot on Tag/build]   ❓  ::endgroup::
[Build U-Boot on Tag/build]   ❓  ::group::Install qemu-aarch64 emulator
| ▷ Fetching qemu-aarch64 from the latest-stable Alpine repository
| fetch http://dl-cdn.alpinelinux.org/alpine/latest-stable/community/x86_64/APKINDEX.tar.gz
| Downloading qemu-aarch64-8.1.5-r0
| ▷ Unpacking qemu-aarch64 and installing on the host system
| ▷ Registering binfmt for aarch64
| ./setup-alpine.sh: line 208: update-binfmts: command not found
| 
| Error occurred at line 208:
|   205 |               rm ./$qemu_cmd-*.apk
|   206 | 
|   207 |               info "Registering binfmt for $qemu_arch"
| > 208 |               update-binfmts --import "$SCRIPT_DIR"/binfmts/$qemu_cmd
|   209 |       fi
|   210 | fi
|   211 | 
[Build U-Boot on Tag/build]   ❗  ::error title=setup-alpine: Install qemu-aarch64 emulator::Error occurred at line 208:                update-binfmts --import "$SCRIPT_DIR"/binfmts/$qemu_cmd (see the job log for more information)
[Build U-Boot on Tag/build]   ❌  Failure - Main sudo -E ./setup-alpine.sh
[Build U-Boot on Tag/build] exitcode '1': failure
[Build U-Boot on Tag/build] 'runs-on' key not defined in Build U-Boot on Tag/build
[Build U-Boot on Tag/build]   ⚙  ::set-output:: root-path=
[Build U-Boot on Tag/build]   ❌  Failure - Main Setup latest Alpine Linux
[Build U-Boot on Tag/build] exitcode '1': failure
[Build U-Boot on Tag/build] ⭐ Run Post Setup latest Alpine Linux
[Build U-Boot on Tag/build]   🐳  docker cp src=/home/raptor/.cache/act/jirutka-setup-alpine@v1/ dst=/var/run/act/actions/jirutka-setup-alpine@v1/
[Build U-Boot on Tag/build]   ✅  Success - Post Setup latest Alpine Linux
[Build U-Boot on Tag/build] 🏁  Job failed
Error: Job 'build' failed
@spvkgn
Copy link

spvkgn commented Oct 14, 2024

Same error

Run jirutka/setup-alpine@v1
Run sudo -E ./setup-alpine.sh
Prepare rootfs directory
Download static apk-tools
Install qemu-aarch64 emulator
  ▷ Fetching qemu-aarch64 from the latest-stable Alpine repository
  fetch http://dl-cdn.alpinelinux.org/alpine/latest-stable/community/x86_64/APKINDEX.tar.gz
  Downloading qemu-aarch64-9.0.2-r0
  ▷ Unpacking qemu-aarch64 and installing on the host system
  ▷ Registering binfmt for aarch64
  ./setup-alpine.sh: line 208: update-binfmts: command not found
  
  Error occurred at line 208:
    205 | 		rm ./$qemu_cmd-*.apk
    206 | 
    207 | 		info "Registering binfmt for $qemu_arch"
  > 208 | 		update-binfmts --import "$SCRIPT_DIR"/binfmts/$qemu_cmd
    209 | 	fi
    210 | fi
    211 | 
  Error: Error occurred at line 208: 		update-binfmts --import "$SCRIPT_DIR"/binfmts/$qemu_cmd (see the job log for more information)
  Error: Process completed with exit code 1.

@spvkgn
Copy link

spvkgn commented Oct 15, 2024

This error occurs on ubuntu-latest - GH switched it to 24.04 release recently. With ubuntu-22.04 still works flawlessly.

@saghul
Copy link

saghul commented Oct 15, 2024

I guess installing the binfmt-support package on the host system should also work?

saghul added a commit to quickjs-ng/quickjs that referenced this issue Oct 15, 2024
saghul added a commit to quickjs-ng/quickjs that referenced this issue Oct 15, 2024
@saghul
Copy link

saghul commented Oct 15, 2024

Replying to myself: yeah, installing that package works too.

saghul added a commit to quickjs-ng/quickjs that referenced this issue Oct 15, 2024
@jirutka
Copy link
Owner

jirutka commented Nov 10, 2024

Is this still a problem? I use ubuntu-latest in this repository’s CI workflow and it still works: https://github.com/jirutka/setup-alpine/actions/runs/11766683795/job/32774514075.

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

4 participants