PXEboot patch

From T2B Wiki
Revision as of 12:28, 26 August 2015 by Maintenance script (talk | contribs) (Created page with " === PXE boot patch === (steps for RHEL5 and later) *pxeboot start from 2 files: kernel (typically called <tt>vmliuz</tt> and the initrd (called <tt>initrd.img</tt>) *to cr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

PXE boot patch

(steps for RHEL5 and later)

  • pxeboot start from 2 files: kernel (typically called vmliuz and the initrd (called initrd.img)
  • to create new pxeboot kernel?
    • locate the kernel version used (to download precompiled modules for the correct version)
strings vmlinuz |grep '2\.6'
    • eg
[root@localhost test_pxe]# strings vmlinuz |grep '2\.6'
2.6.18-53.el5
2.6.18-53.el5 (mockbuild@builder6.centos.org) #1 SMP Mon Nov 12 02:14:55 EST 2007
    • set the version and architecture (the variables are used later). eg. for centos 5.1 64-bit
KERNEL=2.6.18-53.el5
ARCH=x86_64
    • 3ware modules: 3ware has precompiled modules to boot with at http://www.3ware.com/kb/article.aspx?id=14546. These in general do not include rpms for later kernels, so you have to do that yourself
    • get the file, unzip it and locate the .ko file
    • you also need the pcitable with identifiers so the hardware is recognised
    • XFS
    • centos has kernel modules (in rpms) for XFS in centosplus repository
    • get the rpms
  • to add modules to the initrd
    • download the initrd
    • become root user
su -
    • prepare
HERE=$PWD
mkdir orig initrd-old modules-old
cp initrd.img orig
mv initrd.img initrd-old/initrd.img.gz
cd initrd-old
zcat initrd.img.gz |cpio -i
/bin/rm initrd.img.gz
cp modules/modules.cgz $HERE/modules-old
cd $HERE/modules-old
zcat modules.cgz|cpio -ivd
  • now you have a directory $KERNEL/$ARCHwith all current modules. This is the place to add new ones or replace old one.
    • 3ware
    • unzip the .zip files from 3ware site
[root@localhost 3ware]# unzip ../191-3w-95xx-9650_9690_rhel5-kernel2.6.18-53.EL5-installdisk-x86_64-9.5-GUID083205f49ac341bc980c5c58ff4f1bc0.zip 
Archive:  ../191-3w-95xx-9650_9690_rhel5-kernel2.6.18-53.EL5-installdisk-x86_64-9.5-GUID083205f49ac341bc980c5c58ff4f1bc0.zip
  inflating: modinfo                 
  inflating: modules.alias           
  inflating: modules.cgz             
  inflating: modules.dep             
  inflating: modules.pcimap          
  inflating: pci.ids                 
  inflating: pcitable                
  inflating: Readme                  
  inflating: rhdd                  
    • the module you need is in modules.cgz
zcat modules.cgz |cpio -ivd
    • locate the module and copy it to $HERE/modules-old/$KERNEL/$ARCH/
    • the zip file also comes with a pci.ids file. you now have to compare the contents of this file with the 3ware section of the one in $HERE/initrd-old/modules/pci.ids
      • if fields are missing, add them
    • XFS
    • rename the xfs rpm to xfs.rpm (eg:
cd $HERE
cp kmod-xfs-0.4-1.2.6.18_53.el5.centos.plus.x86_64.rpm xfs.rpm
    • then do
cd $HERE
mkdir xfs
cd xfs
rpm2cpio ../xfs.rpm |cpio -ivd
    • you know should have an xfs.ko file
    • mind that when using centosplus, the kernel name that is used to compile this module is slightly different from the one in vmlinuz/initrd (it has .centos.plus added). This should not give any issues though
    • copy this file to $HERE/modules-old/$KERNEL/$ARCH/
  • repack the modules
cd $HERE/modules-old
/bin/rm modules.cgz
find $KERNEL|cpio -ov -H crc|gzip -c9 > modules.cgz
/bin/rm $HERE/initrd-old/modules/modules.cgz
cp modules.cgz $HERE/initrd-old/modules/modules.cgz
cd $HERE/initrd-old
find . |cpio -o -H newc|gzip > ../initrd.img.new
  • the new initrd is now in $HERE/initrd.img.new


Template:TracNotice