| View previous topic :: View next topic |
| Author |
Message |
hedmo l33t


Joined: 29 Aug 2009 Posts: 829 Location: halmstad
|
Posted: Tue Apr 03, 2012 7:17 pm Post subject: initramfs help!!!!(solved) |
|
|
hi all!!!
so its time for me to make initramfs...... i did not fully understand the gentoo initramfs-wiki but i did manage to get me a kernel panic ...... http://imageshack.us/content_round.php?page=done&l=img801/1158/cimg0638o.jpg
here is some info i can give you to help me fix what i have done wrong:
livecd linux # cat /usr/src/initramfs/init
#!/bin/busybox sh
# Mount the /proc and /sys filesystems.
mount -t proc none /proc
mount -t sysfs none /sys
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
# Do your stuff here.
echo "This script mounts rootfs and boots it up, nothing more!"
# Mount the root filesystem.
raidautorun /dev/md3
mount -o ro /dev/md3 /mnt/root
# Mount the devtmpfs filesystem
mount -t devtmpfs none /dev
# Mount my lvm`s
lvm vgscan --mknodes
lvm lvchange -aly vg/{distfiles,home,opt,portage,tmp,usr,var,vartmp}
# Clean up.
umount /proc
umount /sys
umount /dev
# Boot the real thing.
exec switch_root /mnt/root /sbin/init
rescue_shell() {
echo "Something went wrong. Dropping you to a shell."
busybox --install -s
exec /bin/sh
}
mount -o ro /dev/md3 /mnt/root || rescue_shell
livecd linux # ls /usr/src/initramfs/sbin/
lvm mdev
livecd linux #
sorry for the long paste
regards hedmo
Last edited by hedmo on Fri Apr 13, 2012 6:18 pm; edited 3 times in total |
|
| Back to top |
|
 |
forrestfunk81 Guru


Joined: 07 Feb 2006 Posts: 355 Location: münchen.de
|
Posted: Wed Apr 04, 2012 9:55 am Post subject: |
|
|
The kernel panic says 'no init found'.
Have you packed, named and copied your initramfs to /boot/ and configured grub to find the initramfs?
i.e.
| Code: |
find . -print0 | cpio --null -ov --format=newc | gzip -9 > /boot/my-initramfs.cpio.gz
|
and
| Code: |
title=My Linux
root (hd0,0)
kernel /boot/my-kernel
initrd /boot/my-initramfs.cpio.gz
|
Or is your initramfs embedded in your kernel?
| Code: |
General setup --->
(/usr/src/initramfs) Initramfs source file(s) |
With either method, initramfs must be enabled in your kernel (General setup) _________________ # cd /pub/
# more beer |
|
| Back to top |
|
 |
hedmo l33t


Joined: 29 Aug 2009 Posts: 829 Location: halmstad
|
Posted: Wed Apr 04, 2012 8:21 pm Post subject: |
|
|
forrestfunk81
thanks for the reply.yes i have it in my kernel at /usr/src/initramfs and in my /boot/grub/grub.conf:
mybox ~ # cat /boot/grub/grub.conf
# 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
root (hd0,0)
kernel /boot/kernel-3.3.0-rc1-mm1
#root=/dev/md3
initrd /boot/my-initramfs.cpio.gz
#video=radeonfb:1024x768-32@60
#iommu=on
title Gentoo1
root (hd0,0)
kernel /boot/kernel-3.1.0-rc3-mm1 root=/dev/md3
#iommu=calgary
# vim:ft=conf:
mybox ~ #ls /boot
boot kernel-3.0.0-rc6-mm1 kernel-3.3.0-rc1-mm1
grub kernel-3.1.0-rc3-mm1 kernel-3.3.0-rc1-mm12
kernel-2.6.99-3.0.0-rc6-mm1 kernel-3.2.0-gentoo-r1 lost+found
kernel-3.0.0-mm1 kernel-3.2.5-gentoo my-initramfs.cpio.gz
mybox ~ #
regards hedmo |
|
| Back to top |
|
 |
hedmo l33t


Joined: 29 Aug 2009 Posts: 829 Location: halmstad
|
Posted: Thu Apr 05, 2012 7:42 pm Post subject: |
|
|
| dont understad what i have done wrong. giving up........ |
|
| Back to top |
|
 |
hedmo l33t


Joined: 29 Aug 2009 Posts: 829 Location: halmstad
|
Posted: Mon Apr 09, 2012 5:14 pm Post subject: |
|
|
for some how the problem was that i had to re:
cp -a /bin/busybox /usr/src/initramfs/bin/busybox
to get my init to start.but my lvm in my initramfs wont start and some help could bee good
regards hedmo |
|
| Back to top |
|
 |
John R. Graham Administrator


Joined: 08 Mar 2005 Posts: 6443 Location: Somewhere over Atlanta, Georgia
|
Posted: Mon Apr 09, 2012 6:55 pm Post subject: Re: initramfs help!!!! |
|
|
| hedmo wrote: | | so its time for me to make initramfs...... | Why? Could you let us know what you're trying to accomplish? There might be an easier way (even of you do need an initramfs).
- John _________________ This space intentionally left blank. |
|
| Back to top |
|
 |
hedmo l33t


Joined: 29 Aug 2009 Posts: 829 Location: halmstad
|
Posted: Tue Apr 10, 2012 5:05 am Post subject: Re: initramfs help!!!! |
|
|
| John R. Graham wrote: | | Why? Could you let us know what you're trying to accomplish? |
hi John R. Graham.
For some time back I have been told that it have to bee done sooner or later with my setup.i am using raid1 and raid0.
I have /usr in another partition in lvm.what I want to accomplish is building a initramfs for my setup,keep on updating my box and maybe learn some things about boot and stuff like that.
I am not at my box now but I have but i have put some sleep in my init and found out that none of the mount commands
work ( no file or dir.....) and one more thing.if I use ldd busybox,busybox.static or bb it say something about
no dynamic stuff.the only thing I could get from busybox was the blocks when I pack the initramfs( busybox give most blocks) .
regards hedmo |
|
| Back to top |
|
 |
djdunn l33t


Joined: 26 Dec 2004 Posts: 617 Location: Under the moon and all the stars in the sky.
|
Posted: Wed Apr 11, 2012 6:47 am Post subject: |
|
|
you can use genkernel to create only an initramfs, add your boot option to your bootloader and should be good to go _________________ Now, with penguins, (cuddly such), "contented" means it has either just gotten laid, or it's stuffed on herring. Take it from me, I'm an expert on penguins, those are really the only two options.
--Linus Torvalds |
|
| Back to top |
|
 |
hedmo l33t


Joined: 29 Aug 2009 Posts: 829 Location: halmstad
|
Posted: Fri Apr 13, 2012 6:18 pm Post subject: |
|
|
| djdunn wrote: | | you can use genkernel to create only an initramfs, add your boot option to your bootloader and should be good to go |
thanks djdunn!! you made my day |
|
| Back to top |
|
 |
|