Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have compiled the linux kernel. My bzImage is 1,14 mb big
Anyway. It's only 2 programs i need and it's Python and Busybox. I have compiled python and busybox and put them together in a folder. Busybox is 146 kb and pyton is 4,4 mb.
But how do i make an initrd file of them? Or should a make an initrd file of them?
I get this error when a runt with a compiled busybox to gz format as initrd, and without initrd.
Quote:
VFS: Cannot open root device "sda1" or unknow-block(0,0)
Please append a correct "root=" boot option; here are the available partions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)Pid: 1, comm: swapper Not tainted 2.6.38.3 #1
It is probably beyond the scope of this forum to explain all of the details of such an endeavor. When I Google searched for 'How do make an initrd file', I got over 400,000 hits, of which the first 20 or so looked like they were pretty clearly on topic. Maybe you could try that, and if there are aspects that are still not clear, ask here.
In general, an initrd is a compressed cpio archive. The bootloader uses it to create a RAM disk, and then tells the kernel where to find the RAM disk. You haven't said anything about the system architecture on which you are building the initrd, nor about the system architecture for the target host. These are both germane to the subject.
An initrd is usually used in one of two cases. If the host lacks any other form of block media, then it can run entirely from a RAM disk. This will usually result in a fast boot time, but no non-volatile storage. Emebdded systems sometimes use this. Another use-case is for a kernel that is generic with respect to supported hardware, and the initrd supplies the necessary kernel drivers for the specific host, in order to perform a more complete boot. This is a common practice for desktop and server oriented hosts. Your application seems to lean toward the former case.
It is probably beyond the scope of this forum to explain all of the details of such an endeavor. When I Google searched for 'How do make an initrd file', I got over 400,000 hits, of which the first 20 or so looked like they were pretty clearly on topic. Maybe you could try that, and if there are aspects that are still not clear, ask here.
In general, an initrd is a compressed cpio archive. The bootloader uses it to create a RAM disk, and then tells the kernel where to find the RAM disk. You haven't said anything about the system architecture on which you are building the initrd, nor about the system architecture for the target host. These are both germane to the subject.
An initrd is usually used in one of two cases. If the host lacks any other form of block media, then it can run entirely from a RAM disk. This will usually result in a fast boot time, but no non-volatile storage. Emebdded systems sometimes use this. Another use-case is for a kernel that is generic with respect to supported hardware, and the initrd supplies the necessary kernel drivers for the specific host, in order to perform a more complete boot. This is a common practice for desktop and server oriented hosts. Your application seems to lean toward the former case.
--- rod.
Yea, i know that. But how do make it - dono?
Can i make a init file. Just a file. The file contains with...
Quote:
#!/bin/busybox sh
mkdir -p /dev /proc /sys
mount -t devtmpfs devfs /dev
mkdir -p /dev/pts
mount -t devpts ptsfs /dev/pts
mount -t proc procfs /proc
mount -t sysfs sysfs /sys
exec /bin/busybox sh
An initrd usually must contain enough of a filesystem to be mounted as a root filesystem. So, no, you cannot just make it a shell script. The shell script is referring to all sorts of things. Where do you think the kernel will find any of the files you reference in the script? The answer must be that it is in the filesystem, which IS the initrd.
Perhaps if you find an existing initrd, and unroll its contents, you will be able to see what form to follow.
1. You are very well on the right track. You should make links in bin/ of your initrd to all of the busybox modules, so that there is a mount command present that you have mentioned in your init script.
2. You have to satisfy dependencies for dynamic executables, i.e
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.