Re: [CentOS] Adding a kernel module to the ISO/installer initrd?

2009-05-29 Thread Jim Wight
Tim Nelson wrote:
 Surely someone has rebuilt the initrd for the installer ISO? I recall seeing 
 something on the list about it previously in regards to storage controllers 
 but I cannot seem to find it now...
 
 Is there somewhere I can look to see the original mkinitrd command used to 
 build the initrd on the ISO? I could then ensure I have all of the modules 
 specified there along with my additional module.

I've tweaked distributions' initrd files by doing

gunzip -c --suffix '.img' /boot/initrd-version.img | cpio -i

to unpack the file, and

find . -print | cpio -c -o | gzip -c9 /path/of/new/initrd

after making changes.

Jim
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


RE: [CentOS] parsing /proc/cmdline

2008-03-10 Thread Jim Wight
On Fri, 2008-03-07 at 11:59 -0500, Ross S. W. Walker wrote:
 Ross S. W. Walker wrote:
  Jerry Geis wrote:
   
   Hi - I am not an expert at shell script writing.
   If /proc/cmdline looks like
   
   option1 option2 ... ks=http://192.168.1.8/ks/ks.cfg option3 
   option 4 ...
   
   How can I get the 192.168.1.8 out of this cmdline.
  
  Try:
  
  # IPADDR=`cat /proc/cmdline | sed 
  's/.*\/\([1-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)\/.*/\1/'`
  
  This will find an IP in between /.../
 
 Actually shorter sed line:
 
 # IPADDR=`cat /proc/cmdline | sed 
 's/.*\/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\/.*/\1/'`

And shorter still:

   sed 's/.*\/\(\([0-9]\+\.\)\{3,\}[0-9]\+\).*/\1/'

which uses \{3,\} to specify the 3 occurrences of [0-9]\+\.

However, I would simply go for something like:

   sed 's,.*http://\(.*\)/ks/.*,\1,'

Jim


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] How to create initrd.img

2007-11-15 Thread Jim Wight
On Wed, 2007-11-14 at 13:56 -0800, semi linux wrote:
 On Nov 13, 2007 5:49 AM, David Hrbáč [EMAIL PROTECTED] wrote:
  Alain Spineux napsal(a):
   On Oct 15, 2007 2:09 PM, David Hrbáč [EMAIL PROTECTED] wrote:
   Hi,
   anyone to point me URL on initrd.img creating? I have custom kernel and
   want to create initrd.img for install media.
   mkinitrd /tmp/initrd.img 2.6.18-8.1.14.el5.hrb -v -f create unusable
   file for install media.
  
   Maybe you could extract original initrd image, replace its components
   with yours and then rebuild the initrd !
   gzip, mount -o are your friend
 
  Not anymore, use buildinstall.
  D.
 
 David is right...

Not necessarily. For the changes I make I find the following sufficient:

mkdir initrd; cd initrd
gunzip -c --suffix '.img' /boot/initrd-abc.img | cpio -i

and

find . -print | cpio -c -o | gzip -c9 /boot/initrd-xyz.img

Jim


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Disabling shutdown button

2007-06-27 Thread Jim Wight
On Wed, 2007-06-27 at 16:58 +0200, Web and Co sprl - P. Derwael wrote:
 What I mean is the shutdown option that you have at the GUI screen before
 login.
 In other words, I would like to prevent anyone from shutting down my
 system before logging in.

I've done a similar thing on Fedora systems by putting the following
in /etc/gdm/custom.conf

[daemon]
HaltCommand=
RebootCommand=

I don't have any CentOS boxes with a GUI screen to check it on, but I
wouldn't be surprised if it was equally applicable there.

Jim


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos