cvs commit: hints initrd.txt

timothy at linuxfromscratch.org timothy at linuxfromscratch.org
Mon Jan 13 06:15:54 PST 2003


timothy     03/01/13 09:15:54

  Modified:    .        initrd.txt
  Log:
  I have made all the modules auto-detects from modules.conf.
  
  Revision  Changes    Path
  1.8       +29 -16    hints/initrd.txt
  
  Index: initrd.txt
  ===================================================================
  RCS file: /home/cvsroot/hints/initrd.txt,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- initrd.txt	6 Jan 2003 13:10:14 -0000	1.7
  +++ initrd.txt	13 Jan 2003 14:15:54 -0000	1.8
  @@ -6,7 +6,7 @@
           How to setup initrd for LFS.
   
   HINT:
  -$Revision: 1.7 $
  +$Revision: 1.8 $
   
   Introduction to Initial RAMDisk
   
  @@ -14,6 +14,11 @@
   Which will allow you to add modules at start-up instead of compiling them
   into the kernel.
   
  +The script that is enclosed works with SCSI and USB modules only. IDE
  +devices are recommened to be built-in the kernel. The script will
  +auto-detect all SCSI and USB modules and add them to the initial ramdisk.
  +It will also detect the root from the fstab file
  +
   ---
   Assumptions Made in this document
   
  @@ -71,6 +76,7 @@
   	enabled to enable them remove the //
   
   	#define BB_INSMOD
  +	#define BB_FEATURE_SH_STANDALONE_SHELL
   
   	You can configure the rest as you need, but remember have at
   	least the following enabled to make initrd to work properly.
  @@ -79,6 +85,7 @@
   	#define BB_CHROOT
   	#define BB_ECHO
   	#define BB_INSMOD
  +	#define BB_MKDIR
   	#define BB_MODPROBE
   	#define BB_MOUNT
   	#define BB_PIVOT_ROOT
  @@ -106,15 +113,12 @@
   	This script will create the initial RAM Disk image file.
   	By default this script creates /boot/initrd.img
   
  -	You will need to modify the ROOT_DEVICE="" to match
  -	your fstab.
  -
   	The default location for this file is /sbin
   
   #!/bin/bash
   
   # mkinitrd for LFS by Jim Gifford <giffordj at linkline.com>
  -# $Revision: 1.7 $
  +# $Revision: 1.8 $
   
   # Variables
   TEMP="$1"
  @@ -122,6 +126,9 @@
   KERNEL_VERSION=""
   CONFIG_FILE="/etc/modules.conf"
   
  +FSTAB="/etc/fstab"
  +ROOT_DEVICE=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $FSTAB)
  +
   SCSI_MODULES="`grep scsi_hostadapter $CONFIG_FILE | grep -v '^[    ]*#' | awk '{ print $3 }'`"
   NEEDED_SCSI="scsi_mod sd_mod"
   
  @@ -136,11 +143,6 @@
   MOUNT_POINT="/tmp/initrd.mnt-$$"
   LINUXRC="$MOUNT_IMAGE/linuxrc"
   
  -# This needs to be your root. This must match what
  -# you have in fstab
  -
  -ROOT_DEVICE="/dev/discs/disc0/part2"
  -
   # Check for initrd Directory
   
   if ! [ -e /initrd ]
  @@ -317,6 +319,16 @@
   
   	The following script needs to placed in /etc/rc.d/init.d.
   
  +	You will then need to link it to rcsysinit.d.
  +
  +	It is recommended that this script be run right after
  +	mountfs.
  +
  +	To link the script change to the /etc/rc.d/rcsysinit.d
  +	directory and issue the following command.
  +
  +	ln -sf ../init.d/initrd S41initrd
  +
   #!/bin/bash
   # Begin $rc_base/init.d/initrd
   
  @@ -327,11 +339,12 @@
   source $rc_functions
   
   echo "Clearing Initial RAM Disk..."
  -   if [ -e /initrd/dev/.devfsd ]; then
  -      umount /initrd/dev
  -   fi
  -   umount /initrd
  -   /sbin/blockdev --flushbufs /dev/ram0
  +	if [ -e /initrd/dev/.devfsd ]
  +		then
  +      		umount /initrd/dev
  +   	fi
  +   	umount /initrd
  +   	/sbin/blockdev --flushbufs /dev/ram0
   
   # End $rc_base/init.d/initrd
   		
  @@ -347,7 +360,7 @@
   
   	image=/boot/vmlinuz-2.4.18
   	label=test
  -	initrd=/boot/initrd-2-4-18.img
  +	initrd=/boot/initrd-2.4.18.img
   	read-only
   	append="root=/dev/ram0 init=/linuxrc rw"
   
  
  
  
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe hints' in the subject header of the message



More information about the hints mailing list