Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2008-07-25T08:44:59Z by SystemAdmin
CAOS
CAOS
29 Posts
ACCEPTED ANSWER

Pinned topic Problems with GRUB and preinstall modification

‏2008-07-25T08:05:09Z |
Hi,

I'm trying to modify a GRUB option with this installprereboot script (named 901CSM_updateKernelParameter._AllNodes):

"
#!/bin/bash
sed -i 's/root=.*part1/root=\/dev\/sda1/g' /boot/grub/menu.lst
"

If I only install the default kernel, the 901CSM_updateKernelParameter doesn't run right (why?). However, If I install a second kernel located into /csminstall/Linux/SLES/10/x86_64/install/, it is installed correctly and my script modify line "root=........" but JUST in the second kernel options, not in the default kernel options (look at my menu.lst from GRUB):

"
  1. Modified by YaST2. Last modification on Fri Jul 25 09:42:11 CEST 2008
default 2
timeout 8
gfxmenu (hd0,0)/boot/message
##YaST - activate

title SUSE Linux Enterprise Server 10 SP1 - 2.6.16.46-PAPI-0.12
root (hd0,0)
kernel /boot/vmlinuz-2.6.16.46-PAPI-0.12-smp root=*/dev/sda1* load_ramdisk=1 console=tty1 console=ttyS0,19200 resume=/dev/sda2 splash=silent showopts
initrd /boot/initrd-2.6.16.46-PAPI-0.12-smp.img

title Failsafe -- SUSE Linux Enterprise Server 10 SP1 - 2.6.16.46-PAPI-0.12
root (hd0,0)
kernel /boot/vmlinuz-2.6.16.46-PAPI-0.12-smp root=*/dev/sda1* showopts ide=nodma apm=off acpi=off noresume edd=off
initrd /boot/initrd-2.6.16.46-PAPI-0.12-smp.img
###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE Linux Enterprise Server 10 SP1
root (hd0,0)
kernel /boot/vmlinuz-2.6.16.46-0.12-smp root=*/dev/disk/by-id/scsi-SServeRA_8k-l_Volume_E361800300-part1* load_ramdisk=1 console=tty1 console=ttyS0,19200 resume=/dev/sda2 splash=silent showopts
/boot/initrd-2.6.16.46-PAPI-0.12-smp.img /boot/initrd-2.6.16.46-0.12-smp
###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- SUSE Linux Enterprise Server 10 SP1
root (hd0,0)
kernel /boot/vmlinuz-2.6.16.46-0.12-smp root=*/dev/disk/by-id/scsi-SServeRA_8k-l_Volume_E361800300-part1* showopts ide=nodma apm=off acpi=off noresume edd=off 3
/boot/initrd-2.6.16.46-PAPI-0.12-smp.img /boot/initrd-2.6.16.46-0.12-smp

"

Also, I want to install a customized kernel by default, in other words, what I'm doing is locating RPM into /csminstall/csm/scripts/data/kernel and applying scripts. Doing it, GRUB modifications doesn't run OK.

Can you help me?????

Thanks!
Updated on 2008-07-25T08:44:59Z at 2008-07-25T08:44:59Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    476 Posts
    ACCEPTED ANSWER

    Re: Problems with GRUB and preinstall modification

    ‏2008-07-25T08:44:59Z  in response to CAOS
    If I only install the default kernel, the 901CSM_updateKernelParameter doesn't run right (why?).
    Has this script been run with problems or has not been run at all? The /var/log/csm/install.log on the node should have the hints.
    it is installed correctly and my script modify line "root=........" but JUST in the second kernel options, not in the default kernel options (look at my menu.lst from GRUB)
    According to your menu.lst, "root=*/dev/sda1*", seems this should be the result of your scripts, if it is modified by your scripts, it should be "root=/dev/sda1" instead of "root=*/dev/sda1*".

    Also, I want to install a customized kernel by default, in other words, what I'm doing is locating RPM into /csminstall/csm/scripts/data/kernel and applying scripts. Doing it, GRUB modifications doesn't run OK.
    If you are want to use /opt/csm/samples/install/updateKernel to update kernel, you need to make sure that your script 901CSM_updateKernelParameter._AllNodes will be run after the updateKernel.
    Besides, the /boot/grub/menu.lst is a soft link to /boot/grub/grub.conf, I am not so sure about when the soft link is created during the os installation, I had ever done some grub parameters change before, I used the /boot/grub/grub.conf, maybe you can try to update /boot/grub/grub.conf, to avoid the overwritten when the os creates the soft link from /boot/grub/menu.lst to /boot/grub/grub.conf.