LinuxQuestions.org
Review your favorite Linux distribution.
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 12-29-2008, 10:36 PM   #1
xenios
LQ Newbie
 
Registered: Dec 2008
Distribution: Devuan
Posts: 23

Rep: Reputation: 1
grub and commenting


I use Lenny and recently updated with aptitude. Among the pkgs was "linux-image-2.6.26-1-686 2.6.26-10 -> 2.6.26-12" so a new menu.lst was generated. First stanza in the updated menu.lst:

Quote:
title Debian GNU/Linux, kernel 2.6.26-1-686
root (hd0,10)
kernel /boot/vmlinuz-2.6.26-1-686 root=/dev/hda11 ro
initrd /boot/initrd.img-2.6.26-1-686
Thing is, the Lenny I updated is on hda9. There used to be a Lenny on hda11 but I moved it to hda9 when redoing the partition scheme, then deleted the Lenny on hda11. I used the grub cmds (root, update) to switch to hda9's menu.lst then edited the fstab and menu.lst files, yet there's something (command? file?) I missed.

I was about to post when I found the referenced line:
Quote:
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,10)
I edited it to "groot=(hd0,8)" and then tested it by reinstalling the linux-image. The updated stanza's root was correct but not the kernel. Also, the grub auto-update re-commented the groot line I'd uncommented. I then found the kernel reference "# kopt=root=/dev/hda11 ro," so I edited it to hda9 and left it commented. Another reinstall updated menu.lst correctly.

After working through this stuff and seeing why I'd initially dismissed the groot and kopt lines, it got me curious. Is the menu.lst file the only exception to commenting or are there other configuration files where a commented line is referenced?
 
Old 12-30-2008, 05:31 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
If I understood well, the commented groot and kopt lines are being used to generate the new menu.lst after performing a grub update.

Which means that the line is a true comment during boot while Grub uses the menu.lst. But during menu.lst generation, the comment is used to create the correct stanza.

Yes, it is dual, something with '#' should have no influence whatsoever, but it seems to be the only way to put someting into the file which is ignored by grub, but recognized by grub-install.

jlinkels
 
Old 12-30-2008, 06:22 PM   #3
xenios
LQ Newbie
 
Registered: Dec 2008
Distribution: Devuan
Posts: 23

Original Poster
Rep: Reputation: 1
You understood exactly what I posted and why. I think you're right about it being dual purpose and the distinctions you made.

Thanks!
 
Old 12-30-2008, 06:42 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,161

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
I suspect you mean update-grub, which is a Debian-ism.
 
Old 01-06-2009, 09:21 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634

Rep: Reputation: Disabled
Quote:
Originally Posted by jlinkels View Post
...
Yes, it is dual, something with '#' should have no influence whatsoever...
Well, shebang comes to mind at once ("#!/bin/bash" in scripts). So it is done all the time...
 
Old 01-06-2009, 09:34 AM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
You are right. Something preceeded with '#' is not interpreted in a shell script except the shebang. OK, if you want to cut it real fine, the shebang is interpreted by the shell before lauching the shell which interpretes the script.

It might be that the shebang is limited to the first line or the first statement in a script file, I forgot that.

jlinkels
 
  


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
bash - question about commenting babag Programming 5 09-20-2008 11:33 AM
commenting/un Cron rajwinder Linux - Software 3 07-27-2008 08:29 PM
VIM finding and commenting lines shamgar03 Linux - Software 3 06-06-2006 04:49 PM
commenting more than one line in VI editor newbloggy Linux - Software 1 04-18-2006 07:09 AM
proper commenting in C joesbox Programming 6 02-13-2005 11:11 PM

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

All times are GMT -5. The time now is 02:25 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