QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3318|回复: 34

Where to find initrd .img and

[复制链接]
发表于 2005-8-5 07:21:14 | 显示全部楼层 |阅读模式
Hi folks,

Installation of LFS 6.1 has been finished.  Now I'm going to edit /etc/grub.conf of the FC3 Host making dual boot at starting the PC.  

I found LFS Kernel = lfskernel-2.6.11.12

Under
The path to the kernel image........
On 8.3. Linux-2.6.11.12
http://www.linuxfromscratch.org/lfs/view/stable/chapter08/kernel.html

Where can I find its initrd .img and the kernel parameter.

TIA

B.R.
satimis
发表于 2005-8-5 09:19:01 | 显示全部楼层
use mkinitrd to create.
回复

使用道具 举报

发表于 2005-8-5 09:28:01 | 显示全部楼层
the initrd.img is not needed for LFS. In this section, the initrd is for your host system. the initrd can be found in the /boot of you host system.
you can find it by:
#cd /mnt
#mkdir hostroot
#mount /dev/hda3 /mnt/hostroot          (change /dev/hda3 to the root filesystem of you host system)
#cd hostroot
#cd boot
#ls
you can find the file kernel-..., and initrd-...
then:

#cat >> /boot/grub/menu.lst << "EOF"
>title Red Hat
>root (hd0,2)                       (change hd0,2 to you hostsystem's root)
>kernel /boot/kernel-2.4.20 root=/dev/hda3      (change /dev/hda3 to you hostsystem's root, kernel-2.4.20 to the filename you found in previous step)
>initrd /boot/initrd-2.4.20     (change initrd-2.4.20 to the filename you found in previous step)
>EOF
回复

使用道具 举报

发表于 2005-8-5 09:28:22 | 显示全部楼层
the initrd.img is not needed for LFS. In this section, the initrd is for your host system. the initrd can be found in the /boot of you host system.
you can find it by:
#cd /mnt
#mkdir hostroot
#mount /dev/hda3 /mnt/hostroot          (change /dev/hda3 to the root filesystem of you host system)
#cd hostroot
#cd boot
#ls
you can find the file kernel-..., and initrd-...
then:

#cat >> /boot/grub/menu.lst << "EOF"
>title Red Hat
>root (hd0,2)                       (change hd0,2 to you hostsystem's root)
>kernel /boot/kernel-2.4.20 root=/dev/hda3      (change /dev/hda3 to you hostsystem's root, kernel-2.4.20 to the filename you found in previous step)
>initrd /boot/initrd-2.4.20     (change initrd-2.4.20 to the filename you found in previous step)
>EOF
回复

使用道具 举报

 楼主| 发表于 2005-8-5 17:24:37 | 显示全部楼层
Hi blackwolf,

Tks for your advice.

Hereunder is /etc/grub.conf of the FC3 Host
[code:1]#boot=/dev/hda
default=0
timeout=15
splashimage=(hd0,0)/grub/splash.xpm.gz
# hiddenmenu
title Fedora Core (2.6.12-1.1372_FC3)
        root (hd0,0)
        kernel /vmlinuz-2.6.12-1.1372_FC3 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.12-1.1372_FC3.img
title Fedora Core (2.6.11-1.35_FC3)
        root (hd0,0)
        kernel /vmlinuz-2.6.11-1.35_FC3 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.11-1.35_FC3.img[/code:1]
I'm going to add LFS kernel here so that LFS can be booted if selected at start[code:1]#boot=/dev/hda
default=0
timeout=15
splashimage=(hd0,0)/grub/splash.xpm.gz
# hiddenmenu
title Fedora Core (2.6.12-1.1372_FC3)
        root (hd0,0)
        kernel /vmlinuz-2.6.12-1.1372_FC3 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.12-1.1372_FC3.img
title Fedora Core (2.6.11-1.35_FC3)
        root (hd0,0)
        kernel /vmlinuz-2.6.11-1.35_FC3 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.11-1.35_FC3.img
title LFS (lfskernel-2.6.11.12)
root (hd0,5)
kernel /lfs_kernel ro root=/dev/hda5 lfs_kernel_parameter
initrd /lfs_initrd.img[/code:1]
LFS is on /dev/hda6

Please advise where can I find those information, lfs_kernel, lfs_kernel_parameter, etc.   Is it the information of LFS or the FC3 Host.

TIA

B.R.
satimis
回复

使用道具 举报

发表于 2005-8-7 11:39:30 | 显示全部楼层
For the LFS, after you compile the kernel, you must copy the kernel... from your source directory to /boot(/mnt/lfs/boot).
[code:1]cp arch/i386/boot/bzImage /boot/lfs_kernel
cp System.map /boot/System.map
cp .Config /boot/Config
[/code:1]
then in the grub.conf, add
[code:1]
title LFS (lfskernel-2.6.11.12)
root (hd0,5)
kernel /boot/lfs_kernel ro root=/dev/hda6
[/code:1]
回复

使用道具 举报

 楼主| 发表于 2005-8-7 19:26:03 | 显示全部楼层
Hi blackwolf,

Tks for your advice.

For the LFS, after you compile the kernel, you must copy the kernel... .
I completed follows;

8.3.1. Installation of the kernel
cp arch/i386/boot/bzImage /boot/lfskernel-2.6.11.12
cp System.map /boot/System.map-2.6.11.12
cp .config /boot/config-2.6.11.12

I left out running "chown -R 0:0 on the linux-2.6.11.12 directory".  Whether it matters?

then in the grub.conf, add........
Then I manually edited /mnt/lfs/etc/grub.conf

adding:[code:1]
title LFS 6.1 (2.6.11.12)
        root (hd0,5)
        kernel /boot/lfskernel-2.6.11.12 ro root=/dev/hda6 vga=795[/code:1]I think this step should be mentioned on LFS 6.1 book.  I could not discover it.

B.R.
satimis
回复

使用道具 举报

发表于 2005-8-7 21:51:49 | 显示全部楼层
I left out running "chown -R 0:0 on the linux-2.6.11.12 directory". Whether it matters?

NO matter.
I think this step should be mentioned on LFS 6.1 book. I could not discover it.

http://www.linuxfromscratch.org/lfs/view/stable/chapter08/kernel.html

This page and the next page.
回复

使用道具 举报

 楼主| 发表于 2005-8-7 22:38:23 | 显示全部楼层
Hi linky_fan

<snip>

http://www.linuxfromscratch.org/lfs/view/stable/chapter08/kernel.html

This page and the next page.
I went through both pages.  From my Notes it indicates;[code:1]grub> root (hd0,5) [Enter]

Error 21: Selected disk does not exist

grub> setup (hd0) [Enter]

Error 12: Invalid device requested

grub> root

Tab no function[/code:1]There was problem here unsolved.  The HD is connected to Primary IDE as master withoug SLAVE attacehed to its cable.  Therefore I havc to edit /mnt/lfs/etc/grub.conf manually.

B.R.
satimis
回复

使用道具 举报

发表于 2005-8-8 08:56:54 | 显示全部楼层
type "root (hd0, " and press Tab, you can see all the partition of hd0, and make sure you select the correct partition of the LFS.
回复

使用道具 举报

 楼主| 发表于 2005-8-8 09:22:46 | 显示全部楼层
Hi blackwolf,

type "root (hd0, " and press Tab......
Sorry, no output.  I tried before as;

root  (pressing TAB, no output)
root (hd  (pressing TAB, no output)
root (h  (pressing TAB, output=(hd)

On my previous post, I posted
"The HD is connected to Primary IDE as master without SLAVE attacehed to its cable."

which was just for your information, if suspecting cable connection problem.  

On searching Internet I found postings concerning this problem but without solution and the threads just hanging there.

B.R.
satimis
回复

使用道具 举报

发表于 2005-8-8 10:58:40 | 显示全部楼层
In my PC, One harddisk, One cdrom, One FD,
grub>root (       (press TAB)
Possible disks are:   fd0, hd0
grub>root (hd0,     (press TAB)
Possible partitions are:
      Partition num: 0 ,  Filesystem type is ext2fs, partition type 0x83
      Partition num: 1 ,  Filesystem type unknown, partition type 0x82
grub>root (hd0,0)

I'm sorry I have a mistake on
[quote:63c26bf149="blackwolf"]For the LFS, after you compile the kernel, you must copy the kernel... from your source directory to /boot(/mnt/lfs/boot).
[code:1]cp arch/i386/boot/bzImage /boot/lfs_kernel
cp System.map /boot/System.map
cp .Config /boot/Config
[/code:1]
then in the grub.conf, add
[code:1]
title LFS (lfskernel-2.6.11.12)
root (hd0,5)
kernel /boot/lfs_kernel ro root=/dev/hda6
[/code:1][/quote]
It must be /boot/grub/menu.lst but not grub.conf, sorry.
回复

使用道具 举报

 楼主| 发表于 2005-8-8 11:21:42 | 显示全部楼层
Hi blackwolf,

In my PC, One harddisk, One cdrom, One FD,........

Tried as follows on FC3 Host;

# grub [Enter][code:1]
GNU GRUB  version 0.95  (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]

grub> r  (pressed TAB)
Possible commands are: read reboot root rootnoverify

grub> root (pressed TAB)
Possible commands are: root rootnoverify

grub> root[/code:1]

.......It must be /boot/grub/menu.lst but not grub.conf.
On FC3 Host
[root@localhost satimis]# mount /dev/hda6 /mnt/lfs
[root@localhost satimis]# cat /mnt/lfs/boot/grub/menu.lst[code:1]# Begin /boot/grub/menu.lst

# By default boot the first menu entry.
default 0

# Allow 30 seconds before booting the default.
timeout 30

# Use prettier colors.
color green/black light-green/black

# The first entry is for LFS
title LFS 6.1
root (hd0,5)
kernel /boot/lfskernel-2.6.11.12 root=/dev/hda6
title Windows
rootnoverify (hd0,0)
chainloader +1
[/code:1]I did not performed this step.  Is it mentioned somewhere.

Tks

B.R.
satimis
回复

使用道具 举报

发表于 2005-8-8 11:34:27 | 显示全部楼层
what happend when you type "root (" and press TAB?
回复

使用道具 举报

 楼主| 发表于 2005-8-8 11:41:43 | 显示全部楼层
[quote:848ee5c9d9="blackwolf"]what happend when you type "root (" and press TAB?[/quote]grub> root (hd0,

B.R.
satimis
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-10-6 16:53 , Processed in 0.105373 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表