LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 06-23-2006, 06:02 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 48
compiling kernel without initrd support


Hi,

I have been using Debian etch since quite some time and I know that by default the Debian kernel uses the initrd method to boot off. Now I would like to re-compile my existing kernel(2.6.15) without the inital ramdisk support.

Is it possible to do so? If yes then where in the kernel configuration do I have to disable it.?

ALso, what are the disadvantages of disabling initrd?

Thanks
 
Old 06-23-2006, 06:12 PM   #2
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,477

Rep: Reputation: 51
Hi

When you recompile your kernel, I believe the option is in general setup and looks like this in the configuration file:

Quote:
CONFIG_INITRAMFS_SOURCE=
Just unselect it. I have recompiled a number of kernels in Slackware (2.6.X) and have never used an initrd to boot. Worked just fine. I believe an initrd is only required if you have some modules which will not load at boot time without it.

Hope this helps

Bob
 
Old 06-23-2006, 08:49 PM   #3
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by BobNutfield
Hi

When you recompile your kernel, I believe the option is in general setup and looks like this in the configuration file:



Just unselect it. I have recompiled a number of kernels in Slackware (2.6.X) and have never used an initrd to boot. Worked just fine. I believe an initrd is only required if you have some modules which will not load at boot time without it.

Hope this helps

Bob
Thanks for replying dude. Well is there any way beforehand by which I can know if my kernel will work or not w/o initrd. In short, which are those modules which require initrd? can you give some light on this?

Thanks
 
Old 06-23-2006, 09:06 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,445

Rep: Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068
Unless you have some *really* oddball hardware not supported natively in the kernel, there should be *NO* requirement for initrd in a hand configured kernel build.
And even if you do manage to screw it up, go back and fix it - make sure you don't overwrite your known good kernel image.

Some (most nowadays ??) distros use initrd to cover all eventualities - not a concern if you build for your own hardware.
 
Old 06-24-2006, 10:51 AM   #5
Phiebie
Member
 
Registered: Oct 2004
Location: Austria
Distribution: Debian testing
Posts: 102

Rep: Reputation: 17
Quote:
Originally Posted by syg00
Unless you have some *really* oddball hardware not supported natively in the kernel, there should be *NO* requirement for initrd in a hand configured kernel build.
Yes and no. There are quite a lot of people who want to keep the kernel as small and lean as possible. These tend to even compile the filesystem(s) as modules! Well it's quite obvious that the new kernel, without an initrd, will not start: he can't read the partition where the module is, that he has to load to read the partition
But besides that I'm not aware of any other real need to make an initrd.
 
Old 06-24-2006, 01:31 PM   #6
utanja
Member
 
Registered: Apr 2004
Location: Europe:Salzburg Austria USA:Orlando,Florida;
Distribution: Debian
Posts: 625

Rep: Reputation: 32
i have been using without initrd for years without any problems....only remember you must include in the kernel everything you need to boot the filesystem....everything else can be modules...
 
Old 06-24-2006, 04:05 PM   #7
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by utanja
i have been using without initrd for years without any problems....only remember you must include in the kernel everything you need to boot the filesystem....everything else can be modules...
And what are the things that you need to boot the filesystem. Can you please post your kernel config(without the initrd enabled) so that I will have an idea what things to compile in. Or if you are not able to post it and then can you just list the critical things which needs to be compiled in.
 
Old 06-24-2006, 04:32 PM   #8
JackieBrown
Member
 
Registered: Dec 2004
Location: San Antonio, TX
Distribution: Debian-AMD64 Sid
Posts: 481

Rep: Reputation: 31
make sure when compiling your kernel to compile your filesystem into the kernel and not as a module if you don't want a initrd
 
Old 06-24-2006, 04:37 PM   #9
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Depending on whether your initrd file is a ramfs image or a compressed cpio archive, you could either mount it, or copy it to your home directory and extract the contents. Then explore the contents to see which modules are present. You could then compile these features into the kernel, and then reexamine the contents of your new initrd.

Is there an init or linuxrc script? Does it do anything that needs to be moved to a script in /etc?

Last edited by jschiwal; 06-24-2006 at 04:44 PM.
 
Old 06-25-2006, 09:44 PM   #10
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 64
You may want to read this article.

http://newbiedoc.sourceforge.net/system/kernel-pkg.html
 
Old 06-25-2006, 10:11 PM   #11
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by jschiwal
Depending on whether your initrd file is a ramfs image or a compressed cpio archive, you could either mount it, or copy it to your home directory and extract the contents. Then explore the contents to see which modules are present. You could then compile these features into the kernel, and then reexamine the contents of your new initrd.

Is there an init or linuxrc script? Does it do anything that needs to be moved to a script in /etc?
How do I know if it is a cpio archive or a ramfs? I am using Debian etch kernel 2.6.15. Generally my initrd image is named like initrd.img-2.6.15-1 under /boot directory.

Thanks
 
Old 06-26-2006, 06:47 AM   #12
Col._Panic
LQ Newbie
 
Registered: Sep 2005
Distribution: Xubuntu Edgy AMD64/"Wintendo"
Posts: 19

Rep: Reputation: 0
I build my kernels from kernel.org, all without initrd support. I make sure my .config has the following options set -

Code:
# Block devices
#
CONFIG_BLK_DEV_FD=m
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
CONFIG_BLK_DEV_NBD=m
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_UB is not set
# CONFIG_BLK_DEV_RAM is not set (RAMdisk support)
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_CDROM_PKTCDVD=m
CONFIG_CDROM_PKTCDVD_BUFFERS=8
# CONFIG_CDROM_PKTCDVD_WCACHE is not set
# CONFIG_ATA_OVER_ETH is not set

# ATA/ATAPI/MFM/RLL support
#
CONFIG_IDE=y (a must if you use IDE HDs)
CONFIG_BLK_DEV_IDE=y

#
# Please see Documentation/ide.txt for help/info on IDE drives
#
# CONFIG_BLK_DEV_IDE_SATA is not set (most SATA uses SCSI now, see below)
# CONFIG_BLK_DEV_HD_IDE is not set
CONFIG_BLK_DEV_IDEDISK=y
# CONFIG_IDEDISK_MULTI_MODE is not set
CONFIG_BLK_DEV_IDECD=m
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_IDEFLOPPY is not set
# CONFIG_BLK_DEV_IDESCSI is not set
# CONFIG_IDE_TASK_IOCTL is not set

#
# IDE chipset support/bugfixes
#
# CONFIG_IDE_GENERIC is not set
# CONFIG_BLK_DEV_CMD640 is not set
# CONFIG_BLK_DEV_IDEPNP is not set
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_BLK_DEV_GENERIC is not set
# CONFIG_BLK_DEV_OPTI621 is not set
# CONFIG_BLK_DEV_RZ1000 is not set
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
CONFIG_BLK_DEV_AMD74XX=y (my mobo chipset)
# CONFIG_BLK_DEV_ATIIXP is not set
# CONFIG_BLK_DEV_CMD64X is not set
# CONFIG_BLK_DEV_TRIFLEX is not set
# CONFIG_BLK_DEV_CY82C693 is not set
# CONFIG_BLK_DEV_CS5520 is not set
# CONFIG_BLK_DEV_CS5530 is not set
# CONFIG_BLK_DEV_CS5535 is not set
# CONFIG_BLK_DEV_HPT34X is not set
# CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_SC1200 is not set
# CONFIG_BLK_DEV_PIIX is not set
# CONFIG_BLK_DEV_IT821X is not set
# CONFIG_BLK_DEV_NS87415 is not set
# CONFIG_BLK_DEV_PDC202XX_OLD is not set
# CONFIG_BLK_DEV_PDC202XX_NEW is not set
# CONFIG_BLK_DEV_SVWKS is not set
# CONFIG_BLK_DEV_SIIMAGE is not set
# CONFIG_BLK_DEV_SIS5513 is not set
# CONFIG_BLK_DEV_SLC90E66 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
# CONFIG_IDE_ARM is not set
CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_IVB is not set
CONFIG_IDEDMA_AUTO=y
# CONFIG_BLK_DEV_HD is not set

#
# SCSI device support
#
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y (I boot off SATA)
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y (because I use SATA HDs)
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
CONFIG_CHR_DEV_SG=m
# CONFIG_CHR_DEV_SCH is not set

<snip>
#
# SCSI low-level drivers
#
# CONFIG_ISCSI_TCP is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
CONFIG_SCSI_SATA=y
# CONFIG_SCSI_SATA_AHCI is not set
# CONFIG_SCSI_SATA_SVW is not set
# CONFIG_SCSI_ATA_PIIX is not set
# CONFIG_SCSI_SATA_MV is not set
# CONFIG_SCSI_SATA_NV is not set
# CONFIG_SCSI_PDC_ADMA is not set
# CONFIG_SCSI_SATA_QSTOR is not set
# CONFIG_SCSI_SATA_PROMISE is not set
# CONFIG_SCSI_SATA_SX4 is not set
CONFIG_SCSI_SATA_SIL=y (my SATA controller)
# CONFIG_SCSI_SATA_SIL24 is not set
# CONFIG_SCSI_SATA_SIS is not set
# CONFIG_SCSI_SATA_ULI is not set
# CONFIG_SCSI_SATA_VIA is not set
# CONFIG_SCSI_SATA_VITESSE is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_PIO is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_FC is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
CONFIG_SCSI_QLA2XXX=y
# CONFIG_SCSI_QLA21XX is not set
# CONFIG_SCSI_QLA22XX is not set
# CONFIG_SCSI_QLA2300 is not set
# CONFIG_SCSI_QLA2322 is not set
# CONFIG_SCSI_QLA6312 is not set
# CONFIG_SCSI_QLA24XX is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_NSP32 is not set
# CONFIG_SCSI_DEBUG is not set
<snip>
# File systems
#
CONFIG_EXT2_FS=m
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=m
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_JBD=m
# CONFIG_JBD_DEBUG is not set
CONFIG_FS_MBCACHE=m
CONFIG_REISERFS_FS=y (I boot off Reiser)
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
# CONFIG_REISERFS_FS_XATTR is not set
# CONFIG_JFS_FS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_XFS_FS=m
CONFIG_XFS_QUOTA=y
CONFIG_XFS_SECURITY=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
CONFIG_INOTIFY=y
CONFIG_QUOTA=y
CONFIG_QFMT_V1=m
CONFIG_QFMT_V2=m
CONFIG_QUOTACTL=y
CONFIG_DNOTIFY=y
CONFIG_AUTOFS_FS=m
CONFIG_AUTOFS4_FS=m
# CONFIG_FUSE_FS is not set

# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set (used by some RAMdisk images)
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
Basically, you just need to make sure your mobo chipset driver, boot drive disk type and controller, and root filesystem are all compiled in to the kernel. As for the RAMdisk options, I don't think it matters, but I leave them out for the sake of completeness.

This should also work for kernels built from Debian-patched sources, but I'm not 100% sure. I've been using the kernel.org method since 2.6.12 without any problems. Recommended are also the 'ck' performance patches from http://members.optusnet.com.au/ckolivas/kernel/ if you don't already know of them.

Last edited by Col._Panic; 06-26-2006 at 06:48 AM.
 
Old 06-26-2006, 10:51 AM   #13
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 53
Quote:
Originally Posted by kushalkoolwal
How do I know if it is a cpio archive or a ramfs? I am using Debian etch kernel 2.6.15. Generally my initrd image is named like initrd.img-2.6.15-1 under /boot directory.

Thanks
With the powerfull file command:

Code:
file -z /boot/initrd.img-2.6.15-1
 
Old 06-27-2006, 05:23 PM   #14
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by nx5000
With the powerfull file command:

Code:
file -z /boot/initrd.img-2.6.15-1
here is the output of the above command:
Code:
root@debian:~# file -z /boot/initrd.img-2.6.15-1
/boot/initrd.img-2.6.15-1: ASCII cpio archive (SVR4 with no CRC) (gzip compressed data, from Unix, last modified: Wed May 10 17:54:40 2006, max compression)
root@debian:~#
What is the difference between cpio and rmafs initrd image? Also how can I access the contents of my cpio initrd as suggested in the previous posts.

Many thanks

Last edited by kushalkoolwal; 06-27-2006 at 05:24 PM.
 
Old 06-28-2006, 07:40 AM   #15
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 53
Quote:
Also how can I access the contents of my cpio initrd as suggested in the previous posts.
Code:
cd /tmp && zcat /boot/initrd.img-2.6.16-2-686 | cpio -idv
Do this as non root user, as usual


For the differences, google is your friend
And always think about looking in the kernel documentation:

vi /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt
vi /usr/src/linux/Documentation/filesystems/cramfs.txt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling kernel without agpgart support? rabalder321 Linux - Newbie 3 01-18-2006 03:48 PM
Compiling network support into kernel 2.6.5 vincebs Linux - Networking 1 08-14-2004 07:10 PM
compiling kernel, initrd can't make image, 'loop devices busy' infamous41md Linux - Newbie 2 06-02-2004 12:59 PM
compiling kernel 2.6.3 with initrd ykcorse Linux - Software 3 05-06-2004 03:05 PM
initrd support for kernel version 2.4.22 hangover Linux - Newbie 2 12-16-2003 12:49 PM


All times are GMT -5. The time now is 08:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration