View previous topic :: View next topic |
Author |
Message |
Gen_Too n00b
Joined: 17 May 2011 Posts: 24
|
Posted: Wed May 18, 2011 3:07 pm Post subject: [SOLVED] How to make a Initramfs image? |
|
|
How could i make an Initramfs image for grub?
Thank you.
Last edited by Gen_Too on Wed May 18, 2011 7:22 pm; edited 2 times in total |
|
Back to top |
|
|
avx Advocate
Joined: 21 Jun 2004 Posts: 2152
|
Posted: Wed May 18, 2011 3:13 pm Post subject: |
|
|
Depends on what you need to have inside it. There's genkernel-stuff, mkinitrd, dracut and of course, you can do it by hand.
I've always done mine myself, it's not that complicated, but you learn something and have full control, so that in case something breaks, you don't have to understand the tool's magic.
Basics for doing it by hand:
- create a folder
- in there create the needed folder structure (dev, etc, bin, sbin, lib, ...)
- build busybox with the options you want/need and install it into the created folder
- populate the folder with statically linked programs you need, for example cryptsetup, udevadm, gpg, ...
- write an init-script, place it in the topdir, make it executable
- add devicenodes, if needed
- pack the whole folder using cpio and gzip
- done _________________ ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>. |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10589 Location: Somewhere over Atlanta, Georgia
|
Posted: Wed May 18, 2011 3:15 pm Post subject: |
|
|
The easiest way is to use Gentoo's genkernel package (sys-kernel/genkernel). See the Gentoo Linux Genkernel Guide and the Handbook, Chapter 10: Configuring the Bootloader, Code Listing 2.4: grub.conf for genkernel users.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
Gen_Too n00b
Joined: 17 May 2011 Posts: 24
|
Posted: Wed May 18, 2011 3:24 pm Post subject: |
|
|
I think i explained bad. Ive an initramfs image and i get a new kernel. do i need to do a new initramfs image for grub and howto? |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10589 Location: Somewhere over Atlanta, Georgia
|
Posted: Wed May 18, 2011 3:29 pm Post subject: |
|
|
Do you mean, "How do I tell grub about this initramfs that I have?" If so, then see the code listing that I referenced from the Handbook. If that's not what you mean, then could you explain further, please?
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
Gen_Too n00b
Joined: 17 May 2011 Posts: 24
|
Posted: Wed May 18, 2011 4:10 pm Post subject: |
|
|
I will explain again.
1. I dont know very much about this things, im new in gentoo and why not, in linux too.
2. I only now how to copy the kernel image to /boot.
3. I dont know nothing about Initramfs and the info in Google is a bit unhuman for my experience.
Now ill explain what have i done. I installed Gentoo. Then, i got a new kernel, copiled it and copied to /boot.
The question is: Now what have i to do with Initramfs??? |
|
Back to top |
|
|
avx Advocate
Joined: 21 Jun 2004 Posts: 2152
|
Posted: Wed May 18, 2011 4:16 pm Post subject: |
|
|
Ok, since you are new, let me ask you this: Are you even sure you need an initrd? It's not that really everyone need one, in fact, most people don't. So if you think you do, tell us what purpose your initrd is for, that makes it easier to help you. _________________ ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>. |
|
Back to top |
|
|
Gen_Too n00b
Joined: 17 May 2011 Posts: 24
|
Posted: Wed May 18, 2011 4:50 pm Post subject: |
|
|
I dont know what is it. Maybe it means i dont need one. |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10589 Location: Somewhere over Atlanta, Georgia
|
Posted: Wed May 18, 2011 4:52 pm Post subject: |
|
|
Is your system booting on its own? If so, please post the kernel line(s) from your /boot/grub/grub.conf file. That'll tell us if you need an initramfs or not.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
Gen_Too n00b
Joined: 17 May 2011 Posts: 24
|
Posted: Wed May 18, 2011 5:03 pm Post subject: |
|
|
Yes, ive it added to grub by default |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10589 Location: Somewhere over Atlanta, Georgia
|
Posted: Wed May 18, 2011 5:07 pm Post subject: |
|
|
Sorry; what I meant to as was, could you show us exactly what the "kernel" line in your /etc/grub/grub.conf file looks like? For example, mine looks like this: Code: | kernel /boot/vmlinuz root=/dev/sda3 | - John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
Gen_Too n00b
Joined: 17 May 2011 Posts: 24
|
Posted: Wed May 18, 2011 5:38 pm Post subject: |
|
|
Its not well configured. Im not using a genkernel config:
# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Gentoo Linux 2.6.37-r4
root (hd0,0)
kernel /boot/kernel-genkernel-x86_64-2.6.37-gentoo-r4 root=/dev/sda3
initrd /boot/initramfs-genkernel-x86_64-2.6.37-gentoo-r4
title Gentoo Linux 2.6.37-r4 (Rescate)
root (hd0,0)
kernel /boot/kernel-genkernel-x86_64-2.6.37-gentoo-r4 root=/dev/sda3 init=/bin/bb
initrd /boot/initramfs-genkernel-x86_64-2.6.37-gentoo-r4
# vim:ft=conf: |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10589 Location: Somewhere over Atlanta, Georgia
|
Posted: Wed May 18, 2011 5:43 pm Post subject: |
|
|
Hmm. You say that you are not using genkernel, but your grub.conf files shows a genkernel-generated kernel. Now I'm confused. Did you build your kernel with genkernel?
Note for ease of reading, it's nice to put code and configuration files inside [code] tags.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
Gen_Too n00b
Joined: 17 May 2011 Posts: 24
|
Posted: Wed May 18, 2011 6:16 pm Post subject: |
|
|
I say that because i used genkernel at first but im configuring it manually right now |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10589 Location: Somewhere over Atlanta, Georgia
|
Posted: Wed May 18, 2011 6:26 pm Post subject: |
|
|
Well, two comments:- First, if you configure manually, like this
Code: | cd /usr/src/linux
make menuconfig | and then you compile it manually, like this Code: | make
make modules_install
| then, the resultant kernel is not named "kernel-genkernel-x86_64-2.6.37-gentoo-r4". In other words, no matter what you're doing with your manual kernel build, you don't yet have grub set up to launch your manually configured and built kernel. What is the name of the kernel in /boot that you manually built?
Second, your current grub.conf is not using the initramfs that is mentioned there, so that answers your initial question. You do not need an initramfs.- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
avx Advocate
Joined: 21 Jun 2004 Posts: 2152
|
Posted: Wed May 18, 2011 6:26 pm Post subject: |
|
|
Gen_Too wrote: | I say that because i used genkernel at first but im configuring it manually right now | Do you (plan to) use anything not standard, ie. luks, mdadm/special RAID-controller, etc.? If not, then you won't really need an initrd.
Mine for example is just used, since I have fulldisk encryption running and I've got a minimal rescue system in there. _________________ ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>. |
|
Back to top |
|
|
Gen_Too n00b
Joined: 17 May 2011 Posts: 24
|
Posted: Wed May 18, 2011 7:11 pm Post subject: No |
|
|
Quote: | then, the resultant kernel is not named "kernel-genkernel-x86_64-2.6.37-gentoo-r4". In other words, no matter what you're doing with your manual kernel build, you don't yet have grub set up to launch your manually configured and built kernel. What is the name of the kernel in /boot that you manually built? |
You are in error. Its only the name that says "genkernel", but i overwritted my own kernel to that with TAB (i said it hasnt configured well).
Thank you all very much! |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10589 Location: Somewhere over Atlanta, Georgia
|
Posted: Wed May 18, 2011 7:28 pm Post subject: Re: No |
|
|
Gen_Too wrote: | ...
You are in error.
... | Well, I'm glad you were able to straighten me out.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
kipas_angin n00b
Joined: 08 Oct 2011 Posts: 3
|
Posted: Mon Oct 10, 2011 4:22 pm Post subject: |
|
|
well, it seems that this problem is quite the same as mine, but i think it's not solved yet,
here's the situation, i'm a baby-born to linux, just about a month using ubuntu and trying gentoo for my long lasting os
first, i've followed all the handbook intructed, and getting my sistem ready for first boot. the problem start after myself-compiled kernel extracted
it cannot enter the desktop like when i use live DVD. my screen just showing a message :"this is cacaa.unknown_domain (linux i686 2.6.39-gentoo-r3)"
FYI, cacaa is my localhost name, and my user that i've created after setting root's passwd (chapter 8.c on the handbook), i name my compiled kernel by gentoo, not linux i686 2.6.39-gentoo-r3
i thought that was my kernel problem, so i rebuilt it with genkernel. this time the log says error :"* ERROR: Could not copy the initramfs image to /boot!"
i've no idea of what is initramfs, and what it's used for.
FYI, i set my /boot on another partition which 7.4MiB harddrive.
the question is:
1 may my sistem could start without initramfs?
2 or if it has to have initramfs, should i resize my /boot?
3 is there any solution so i can resize my windows partition and /boot partition without making me to log in to windows first? because in fdisk there is no option for it. |
|
Back to top |
|
|
gerard27 Advocate
Joined: 04 Jan 2004 Posts: 2377 Location: Netherlands
|
Posted: Mon Oct 10, 2011 5:46 pm Post subject: |
|
|
Slamet kipas_angin,
When you use genkernel and want to copy the kernel and initramfs to boot you should have boot mounted.
Initramfs contains modules needed to boot your system.
I suggest using rescuecd to install or repair the system.My sig contains a link where you can d/l it.
It also has tools to shrink Windows.Remember to defragment Windows first.
Gerard. _________________ To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download |
|
Back to top |
|
|
kipas_angin n00b
Joined: 08 Oct 2011 Posts: 3
|
Posted: Mon Oct 10, 2011 6:41 pm Post subject: |
|
|
actually i've mounted /boot on my sistem, but it full.
when i'm making /boot partition, i've choose 5GB actually, but fdisk says that i don't have that much space, actually i have 50GB empty space, but i can't set 5GB for /boot partition, is there any partition size limit for the primary drive? all i know, the limit was for 4 primary partition, not for it size.
allright, I'd rather to defrag and shrink my windows partition from windows itself, so i do not lose any of my data.
thank you for your advice |
|
Back to top |
|
|
|