LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-11-2012, 07:29 AM   #1
AZOR
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Rep: Reputation: Disabled
GRUB on Oracle Linux (RHEL) - identify selected option in OS/Linux


Hello,
i would like identify in Linux what option in grub was selected, i read a lot of tutorials, but they usually speak about selection partitions or system or kernel. What I would like is a have two or more grub selection for ONE operation system and just give them different parameter (howevery, whatever). In example as setted env. variable. Here is little example for understand my needs - example is much better with my sucks english

Quote:
title Oracle Linux Server (2.6.32-220.el6.x86_64)
root (hd0,7)
kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /initramfs-2.6.32-220.el6.x86_64.img
title Oracle RAC
root (hd0,7)
kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=cs_CZ.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us AZOR_TYPE=RAC rd_NO_DM
initrd /initramfs-2.6.32-220.el6.x86_64.img
Same partition, same kernel but with different "parameter/identification" "AZOR_TYPE".This does not work But I hope it explain my idea. I read something about setenv and grub but never seen a one or more example :// and testing with grub (even in virtual box) is not so nice (every try fear and restart). I read about "chosen" variable in grub, but again - never seen a example and i do not know how use it or where should i put it.

Thank you a lot for suggestion.

Solution should works, not be "nice" - i tried use a LANG value for it, but it does not work either, when i select "chinse" in LANG it is not propaged in envi. variable $ LANG.

Last edited by AZOR; 03-11-2012 at 07:31 AM.
 
Old 03-11-2012, 07:40 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,667

Rep: Reputation: 494Reputation: 494Reputation: 494Reputation: 494Reputation: 494
Quote:
i would like identify in Linux what option in grub was selected, i read a lot of tutorials, but they usually speak about selection partitions or system or kernel. What I would like is a have two or more grub selection for ONE operation system and just give them different parameter (howevery, whatever)
.

What prob has you? did not RHEL using Grub Legacy? That's no problem by Grub legacy, this one boots howevery/whatever same one operation system. Just editing /boot/grub/menu.lst as root add anything there. You can read tutorial Grub Legacy here.

Or even if Grub 2 new, you can change script pointing to same kernel same partition but different name, just run "upadate-grub" afterwards. Tutoring Grub 2 here. I think it should work.

Hope that helps. Goodluck.
 
Old 03-11-2012, 07:52 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,253

Rep: Reputation: 3395Reputation: 3395Reputation: 3395Reputation: 3395Reputation: 3395Reputation: 3395Reputation: 3395Reputation: 3395Reputation: 3395Reputation: 3395Reputation: 3395
You can pass whatever you like as a kernel parameter - as you have done.
No-one cares.

To set an environment variable is your job - grub doesn't know, or care. Use a local initscript.
 
Old 03-11-2012, 07:58 AM   #4
AZOR
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
You can pass whatever you like as a kernel parameter - as you have done.
No-one cares.

To set an environment variable is your job - grub doesn't know, or care. Use a local initscript.
Thank you a lot it looks like a solution, something like :
Quote:
kernel /vmlinuz-2.6.32-220.el6.x86_64 ro rac_type
Or
Quote:
kernel /vmlinuz-2.6.32-220.el6.x86_64 ro type=rac
Ok, it looks like a nice idea, but I never works with it - where I find it? /sbin/sysctl -a?

Thank you for open way of thinking
 
Old 03-11-2012, 08:00 AM   #5
AZOR
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by malekmustaq View Post
.

What prob has you? did not RHEL using Grub Legacy? That's no problem by Grub legacy, this one boots howevery/whatever same one operation system. Just editing /boot/grub/menu.lst as root add anything there. You can read tutorial Grub Legacy here.

Or even if Grub 2 new, you can change script pointing to same kernel same partition but different name, just run "upadate-grub" afterwards. Tutoring Grub 2 here. I think it should work.

Hope that helps. Goodluck.
Thank you, I read article before post this question, first manual does have any solution for my needs. The seconds looks like that is possible to write a own script and setenv, but it looks like that I must upgrade GRUB for it :/ and after configure and write script - it looks like very danger and lot of works for just pass parameter
 
Old 03-11-2012, 08:21 AM   #6
AZOR
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AZOR View Post
Thank you a lot it looks like a solution, something like :

Or


Ok, it looks like a nice idea, but I never works with it - where I find it? /sbin/sysctl -a?

Thank you for open way of thinking
Thank you, it looks like i MUST "select" and set one of kernel parameters and decide logic after based on this parameter, looks like solution althought I tried example from my post and it does not work, problably I can not set my variable, just must select some from kernel (string type ideally) for this purpose, now parameter kstack=N [X86] Print N words from the kernel stack
in oops dumps. -- sound for me for "ready to use"
 
Old 03-11-2012, 08:54 AM   #7
AZOR
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you all KSTACK works
 
Old 03-13-2012, 08:23 AM   #8
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,667

Rep: Reputation: 494Reputation: 494Reputation: 494Reputation: 494Reputation: 494
Glad to hear that AZOR. Enjoy!
 
  


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
LXer: Oracle Enterprise Linux 5.5 Trails RHEL 5.5 LXer Syndicated Linux News 0 04-06-2010 08:00 PM
Grub, which menu option selected afterall Erhnam Linux - General 1 01-09-2010 07:58 AM
Oracle 9i Installation on Linux (Red hat Rhel 4) imughal Linux - Newbie 1 01-09-2008 04:22 AM
LXer: Oracle Linux Is No Longer an RHEL Clone LXer Syndicated Linux News 0 10-23-2007 03:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:41 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration