UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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 -n +3 $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.
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628
Rep:
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.