Subject: Failed to execute /init (error -13)

From: kok leong soo <[email-masked]>
Date: Sun, 14 Jun 2020 14:25:56 +0800

Hi all,
I'm stuck on this error Failed to execute /init (error -13) when i'm trying
to create a custom pxe boot using chroot method.
I have verified that the file existed in the image and boot using the
following kernel option in my ipxe script.

kernel tftp://192.168.1.80/linux initrd=initrd.gz vga=788
initrd tftp://192.168.1.80/initrd.gz

Can anyone advise what might have happened?

Thanks.

---

From: Ariadne Conill <[email-masked]>
Date: Sun, 14 Jun 2020 00:23:16 -0600

> Can anyone advise what might have happened?

The way the kernel handles launching the init process is, unfortunately, not 
very transparent when it fails.

In the error message, errno -13 means "permission denied."  This means your 
initrd either does not have the correct permission on /init itself, or 
Alpine's ELF interpreter (provided by musl) lacks correct permissions.  Check 
the permissions on /lib/ld-musl-x86_64.so.1 as well.  If you are using a 
different architecture than x86_64, the ELF interpreter path will be slightly 
different, but you should be able to find it in the initramfs.  It should be 
present and executable.

Once you fix these two problems, your initrd image should work correctly.

Ariadne