LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-18-2010, 11:02 AM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Rep: Reputation: 60
Xubuntu 10.10 Kernel Updates modifying Kernel Settings PenStick


I have made a several modifications to my penstick running Xubuntu 10.10 that have greatly enhanced its performance. It took me several weeks to get to this point. I have added entries to /etc/rc.local and added kernel tweaks in /etc/grub.d/40_Custom so that my entries wont be erased. I have also added entries in my /etc/fstab. I have read this document in regards to the kernel but I am concerned about my /etc/fstab,/etc/rc.local and /etc/grub.d/40_Linux files being overwritten from updates.

https://help.ubuntu.com/community/Grub2

I am concerned about when one of my users decides he wants to run his updates via apt-get or package managers that all of the configs that I have done will be wiped away. Can someone enlighten me on this. Thanks

Last edited by metallica1973; 11-19-2010 at 08:54 AM.
 
Old 11-18-2010, 11:07 PM   #2
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by metallica1973 View Post
I am concerned about when one of my users decides he wants to run his updates via apt-get or package managers that all of the configs that I have done will be wiped away.
If the users only run updates and install software, the entries in /etc/fstab, /etc/rc.local, and /etc/grub.d/40_custom will persist after any updates, including kernel updates.
Unless your users edit or change fstab, rc.local, or 40_custom, all of your configurations in those files will persist. By the way, there are also a lot of configure options for grub2 in /etc/default/grub that you may want to look at.
Also, the correct file name is /etc/grub.d/40_custom, not /etc/grub.d/40_Linux. If you changed the file name to 40_Linux it probably will still work ok though.
Hope this helps.
 
Old 11-19-2010, 08:56 AM   #3
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
sorry for the typo and many thanks. I will definitely look into /etc/default/grub. I feel better knowing this. One more questions:

If I create a custom entry using /etc/grub.d/40_Custom like this:

PHP Code:
#!/bin/sh
exec tail -+$0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        
recordfail
        insmod part_msdos
        insmod ext2
        set root
='(hd1,msdos1)'
        
search --no-floppy --fs-uuid --set d6d52b91-aa3c-491b-b760-479da6a957cf
        linux   
/boot/vmlinuz-2.6.35-22-generic root=UUID=d6d52b91-aa3c-491b-b760-479da6a957cf ro   quiet splash elevator=noop
        initrd  
/boot/initrd.img-2.6.35-22-generic

and a user runs his updates and a new kernel is downloaded and installed. I am pretty confident that this entry will not hold. Please tell me I am wrong. If this is the case how can I prevent the user from downloading and using a different kernel build on my penstick? thanks

Last edited by metallica1973; 11-19-2010 at 09:04 AM.
 
Old 11-19-2010, 01:10 PM   #4
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
The only thing that would change the boot from that entry would be a change in its place in the menu order.

The easy way to prevent this is to change the permissions of /etc/grub.d/10_linux to not be executable. This is assuming you are booting from the grub on your usb device. If that is the case then 10_linux is what generates the menu entry.

Disable that and change the name of 40_custom to 06 custom, which will put it at the top of your menu and make sure /etc/default/grub is calling for;
Quote:
GRUB_DEFAULT=0
will make it impossible for the user to boot to anything but your entry.

If you just change the name to 06_custom, have the above in /etc/default/grub and leave 10_linux alone it will still be the default boot but any kernel updates will be listed right under it in the menu so that they can be used.
 
Old 11-20-2010, 12:15 AM   #5
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by metallica1973 View Post
If I create a custom entry using /etc/grub.d/40_Custom like this: ...
Just for reference, here is mu custom boot file in /etc/grub.d/ that I use for booting Slackware's generic-smp kernel. I named the file 31_Slackware32-13.1 so it would show up after the Ubuntu entries in the grub2 menu on bootup:
Code:
menuentry "Slackware32-13.1 on /dev/sda5" {
        set root=(hd0,5)
        linux  /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5 ro 
        initrd  /boot/initrd.gz
}
Then I just made this file executable and ran "sudo update-grub" and it persists in the grub2 menu after any Ubuntu kernel updates.
 
Old 11-24-2010, 08:58 AM   #6
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
many thanks. After really thinking about, all I need is to just add what I need in /etc/rc.local and that will add the junk I need every time the system starts but If needed I will definitely modify what is needed to /etc/grub.d/. Awesome thanks
 
  


Reply



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
Xubuntu on a Penstick Best Performance metallica1973 Ubuntu 3 11-26-2010 06:01 AM
Kernel updates and kernel specific software udeleng Linux - Newbie 1 11-08-2008 12:31 AM
How to restore out-of-box kernel settings if my kernel compile fails? brgr88 Slackware 8 04-18-2006 06:51 AM
How to modifying boot kernel in RHEL3.0 install CD kvadivel80 Linux - Enterprise 2 04-03-2006 11:34 PM
Modifying / replacing a kernel module dplazz Linux - General 1 07-22-2005 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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