# [solved]custom initramfs woes - no init found

## regomodo

Hi,

I'm trying to solve a long standing issue with my box by creating a custom initramfs. I've followed to hallowed guide but every time I get

 *Quote:*   

> Kernel panic - not syncing: No init found, Try passing init= option to kernel"

 

I can see from the kernel printout that it tries to execute /init and even the /linuxrc (a symlink) but no luck.

My init looks like:

```

#!/bin/busybox sh

# Mount the /proc and /sys filesystems.

mount -t proc none /proc

mount -t sysfs none /sys

# Btrfs stuff

echo "Trying to run btrfsctl"

btrfsctl -a

# Mount the root filesystem.

mount -o ro /dev/sde7 /mnt/root

# Clean up.

umount /proc

umount /sys

# Boot the real thing.

exec switch_root /mnt/root /sbin/init

```

and my relevant grub entry:

```

menuentry "Funtoo (on /dev/sde7)" {

        insmod ext2

        set root='(hd4,5)'

        search --no-floppy --fs-uuid --set 5b77a8a7-25ea-4b72-be99-46449c195bdd

        linux /kernel-2.6.33.3 root=/dev/sde7 

        initrd /custom.cpio.gz

}

```

Maybe this quiet forum could help out?Last edited by regomodo on Fri Apr 30, 2010 6:27 pm; edited 1 time in total

----------

## Rexilion

I use /init . Is it executable (chmod +x) ???

----------

## regomodo

 *Rexilion wrote:*   

> I use /init . Is it executable (chmod +x) ???

 

Yep, it's executable.

----------

## regomodo

Bump

----------

## skellr

I would try including your initramfs directory in the kernel config and letting it compress it. At least to try and eliminate a archive/compression problem.

You won't need the 'root=' option in grub entry as your init will mount the root fs, but I doubt this would cause any issues.

----------

## regomodo

 *skellr wrote:*   

> I would try including your initramfs directory in the kernel config and letting it compress it. At least to try and eliminate a archive/compression problem.
> 
> You won't need the 'root=' option in grub entry as your init will mount the root fs, but I doubt this would cause any issues.

 

I did do that initially but same issues. I did leave the "root=" in but, as you say, likely to cause anything.

----------

## regomodo

Figured out why it wouldn't use the initramfs. busybox wasn't compiled as static. That solved this issue but still the same btrfsctl issue.

----------

## skellr

 :Very Happy:   What is the "same btrfsctl issue". no error messages?

is there a  /dev/btrfs-control in your initramfs?

edit: i see https://forums.gentoo.org/viewtopic-p-6264563.html#6264563

----------

