Linux initrd environment setup - Failed to execute /init

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I'm looking for help in getting a basic initrd environment up and running. My goal is to enhance my knowledge on how to create a basic Linux environment. Ideally, I would like to move into Embedded Linux systems later on and this seems the best starting point.



I've yet to find a good basic how-to on this subject, as such I've mostly ended up following a number of half finished or incomplete tutorials on the subject.



Below are links to the how-to's for your reference on what I've done so far.



  • http://web.archive.org/web/20120601223451/http://blog.nasirabed.com/2012/01/minimal-linux-filesystem.html

  • http://revcode.wordpress.com/2012/02/25/booting-a-minimal-busybox-based-linux-distro/

At the moment, when I boot the environment I get a GRUB prompt, I've tried adding a grub.cfg file to it, but it just gets ignored when the system boots and goes straight to the grub prompt.



To boot the initrd environment presently, I have to provide it with the following commands:



set root=(hd0,msdos1)
linux /boot/bzImage
initrd /boot/rootfs.cpio.gz
boot


This boots the mini OS, but gives an error about not being able to locate an init file (which is part of my rootfs.cpio.gz file in the root of its structure)



.bootup errors



How I can go about fixing the problems with this initrd environment?










share|improve this question























  • Been forever since I did one ('00-'01) but a LFS system will walk you through creating and setting up your own init system - linuxfromscratch.org/lfs
    – ivanivan
    Sep 8 at 14:35














up vote
2
down vote

favorite












I'm looking for help in getting a basic initrd environment up and running. My goal is to enhance my knowledge on how to create a basic Linux environment. Ideally, I would like to move into Embedded Linux systems later on and this seems the best starting point.



I've yet to find a good basic how-to on this subject, as such I've mostly ended up following a number of half finished or incomplete tutorials on the subject.



Below are links to the how-to's for your reference on what I've done so far.



  • http://web.archive.org/web/20120601223451/http://blog.nasirabed.com/2012/01/minimal-linux-filesystem.html

  • http://revcode.wordpress.com/2012/02/25/booting-a-minimal-busybox-based-linux-distro/

At the moment, when I boot the environment I get a GRUB prompt, I've tried adding a grub.cfg file to it, but it just gets ignored when the system boots and goes straight to the grub prompt.



To boot the initrd environment presently, I have to provide it with the following commands:



set root=(hd0,msdos1)
linux /boot/bzImage
initrd /boot/rootfs.cpio.gz
boot


This boots the mini OS, but gives an error about not being able to locate an init file (which is part of my rootfs.cpio.gz file in the root of its structure)



.bootup errors



How I can go about fixing the problems with this initrd environment?










share|improve this question























  • Been forever since I did one ('00-'01) but a LFS system will walk you through creating and setting up your own init system - linuxfromscratch.org/lfs
    – ivanivan
    Sep 8 at 14:35












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I'm looking for help in getting a basic initrd environment up and running. My goal is to enhance my knowledge on how to create a basic Linux environment. Ideally, I would like to move into Embedded Linux systems later on and this seems the best starting point.



I've yet to find a good basic how-to on this subject, as such I've mostly ended up following a number of half finished or incomplete tutorials on the subject.



Below are links to the how-to's for your reference on what I've done so far.



  • http://web.archive.org/web/20120601223451/http://blog.nasirabed.com/2012/01/minimal-linux-filesystem.html

  • http://revcode.wordpress.com/2012/02/25/booting-a-minimal-busybox-based-linux-distro/

At the moment, when I boot the environment I get a GRUB prompt, I've tried adding a grub.cfg file to it, but it just gets ignored when the system boots and goes straight to the grub prompt.



To boot the initrd environment presently, I have to provide it with the following commands:



set root=(hd0,msdos1)
linux /boot/bzImage
initrd /boot/rootfs.cpio.gz
boot


This boots the mini OS, but gives an error about not being able to locate an init file (which is part of my rootfs.cpio.gz file in the root of its structure)



.bootup errors



How I can go about fixing the problems with this initrd environment?










share|improve this question















I'm looking for help in getting a basic initrd environment up and running. My goal is to enhance my knowledge on how to create a basic Linux environment. Ideally, I would like to move into Embedded Linux systems later on and this seems the best starting point.



I've yet to find a good basic how-to on this subject, as such I've mostly ended up following a number of half finished or incomplete tutorials on the subject.



Below are links to the how-to's for your reference on what I've done so far.



  • http://web.archive.org/web/20120601223451/http://blog.nasirabed.com/2012/01/minimal-linux-filesystem.html

  • http://revcode.wordpress.com/2012/02/25/booting-a-minimal-busybox-based-linux-distro/

At the moment, when I boot the environment I get a GRUB prompt, I've tried adding a grub.cfg file to it, but it just gets ignored when the system boots and goes straight to the grub prompt.



To boot the initrd environment presently, I have to provide it with the following commands:



set root=(hd0,msdos1)
linux /boot/bzImage
initrd /boot/rootfs.cpio.gz
boot


This boots the mini OS, but gives an error about not being able to locate an init file (which is part of my rootfs.cpio.gz file in the root of its structure)



.bootup errors



How I can go about fixing the problems with this initrd environment?







linux initrd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 8 at 12:47









Jeff Schaller

33.1k849111




33.1k849111










asked Jan 2 '15 at 15:44









Kristiaan

133




133











  • Been forever since I did one ('00-'01) but a LFS system will walk you through creating and setting up your own init system - linuxfromscratch.org/lfs
    – ivanivan
    Sep 8 at 14:35
















  • Been forever since I did one ('00-'01) but a LFS system will walk you through creating and setting up your own init system - linuxfromscratch.org/lfs
    – ivanivan
    Sep 8 at 14:35















Been forever since I did one ('00-'01) but a LFS system will walk you through creating and setting up your own init system - linuxfromscratch.org/lfs
– ivanivan
Sep 8 at 14:35




Been forever since I did one ('00-'01) but a LFS system will walk you through creating and setting up your own init system - linuxfromscratch.org/lfs
– ivanivan
Sep 8 at 14:35










1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










When linux kernel boots into the initramfs filsystem, it doesn't run /sbin/init, but /init. The solution is to symlink the /sbin/init to /init.



UPDATE:
I tried to recreate your problems and I discovered that you probably compiled 64-bit busybox and 32-bit linux kernel. Therefore, the linux kernel doesn't know how to execute the /init program because it's 64-bit. Recompile linux with 64 bit option enabled and replace the old version with it. Also, you'll need to symlink the /init to /sbin/init as I told you before






share|improve this answer






















  • And technically this is specific to initramfs. The older, pure "initrd" system runs /linuxrc. Which shows how old I am, your answer sounded wrong to me :)
    – sourcejedi
    Apr 14 '16 at 19:08










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f177064%2flinux-initrd-environment-setup-failed-to-execute-init%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote



accepted










When linux kernel boots into the initramfs filsystem, it doesn't run /sbin/init, but /init. The solution is to symlink the /sbin/init to /init.



UPDATE:
I tried to recreate your problems and I discovered that you probably compiled 64-bit busybox and 32-bit linux kernel. Therefore, the linux kernel doesn't know how to execute the /init program because it's 64-bit. Recompile linux with 64 bit option enabled and replace the old version with it. Also, you'll need to symlink the /init to /sbin/init as I told you before






share|improve this answer






















  • And technically this is specific to initramfs. The older, pure "initrd" system runs /linuxrc. Which shows how old I am, your answer sounded wrong to me :)
    – sourcejedi
    Apr 14 '16 at 19:08














up vote
2
down vote



accepted










When linux kernel boots into the initramfs filsystem, it doesn't run /sbin/init, but /init. The solution is to symlink the /sbin/init to /init.



UPDATE:
I tried to recreate your problems and I discovered that you probably compiled 64-bit busybox and 32-bit linux kernel. Therefore, the linux kernel doesn't know how to execute the /init program because it's 64-bit. Recompile linux with 64 bit option enabled and replace the old version with it. Also, you'll need to symlink the /init to /sbin/init as I told you before






share|improve this answer






















  • And technically this is specific to initramfs. The older, pure "initrd" system runs /linuxrc. Which shows how old I am, your answer sounded wrong to me :)
    – sourcejedi
    Apr 14 '16 at 19:08












up vote
2
down vote



accepted







up vote
2
down vote



accepted






When linux kernel boots into the initramfs filsystem, it doesn't run /sbin/init, but /init. The solution is to symlink the /sbin/init to /init.



UPDATE:
I tried to recreate your problems and I discovered that you probably compiled 64-bit busybox and 32-bit linux kernel. Therefore, the linux kernel doesn't know how to execute the /init program because it's 64-bit. Recompile linux with 64 bit option enabled and replace the old version with it. Also, you'll need to symlink the /init to /sbin/init as I told you before






share|improve this answer














When linux kernel boots into the initramfs filsystem, it doesn't run /sbin/init, but /init. The solution is to symlink the /sbin/init to /init.



UPDATE:
I tried to recreate your problems and I discovered that you probably compiled 64-bit busybox and 32-bit linux kernel. Therefore, the linux kernel doesn't know how to execute the /init program because it's 64-bit. Recompile linux with 64 bit option enabled and replace the old version with it. Also, you'll need to symlink the /init to /sbin/init as I told you before







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 16 '16 at 9:17

























answered Apr 14 '16 at 16:52









kristjank

73117




73117











  • And technically this is specific to initramfs. The older, pure "initrd" system runs /linuxrc. Which shows how old I am, your answer sounded wrong to me :)
    – sourcejedi
    Apr 14 '16 at 19:08
















  • And technically this is specific to initramfs. The older, pure "initrd" system runs /linuxrc. Which shows how old I am, your answer sounded wrong to me :)
    – sourcejedi
    Apr 14 '16 at 19:08















And technically this is specific to initramfs. The older, pure "initrd" system runs /linuxrc. Which shows how old I am, your answer sounded wrong to me :)
– sourcejedi
Apr 14 '16 at 19:08




And technically this is specific to initramfs. The older, pure "initrd" system runs /linuxrc. Which shows how old I am, your answer sounded wrong to me :)
– sourcejedi
Apr 14 '16 at 19:08

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f177064%2flinux-initrd-environment-setup-failed-to-execute-init%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay