Centos option deletion possible - linux

In my boot options of my installed CentOS on VBox, I have the followings that really mess me up to figure out how to eliminate those that doesn't work anymore, e.g the first one which is reported as unavailability of kernel root to boot. I can only choose the last one to boot the system.
> CentOS(2.6.32-200.17.1.e16.x86_64)
> CentOS(2.6.32-200.17.1.e16.x86_64.debug)
> CentOS(2.6.32-200.4.2.e16.x86_64.debug)
> CentOS(2.6.32-200.4.2.e16.x86_64)
> CentOS(2.6.32-200.4.1.e16.x86_64)
> CentOS(2.6.32-200.e16.x86_64)
Where are these stored once I boot the system with the last option ? What if I would like to delete (completely) one of them ? I don't know what the xxx.debug's are there for ?
Thank you for any help

On most distros today the boot manager is GRUB. The configuration of boot menu is usually stored in /boot/grub in a file called menu.lst or grub.cfg depending on GRUB version and distro. In that file, you can comment out sets of lines corresponding to the OS you don't want in the menu - syntax should be pretty intuitive.
On some distros the file is generated by a set of scripts, in this case a comment at the top say you shouldn't edit that file directly. For example in Debian, the scripts which generate the configuration reside in /etc/grub.d/ and they do all sorts of auto-probing for available OS's. In this case one needs to either modify the script or to remove the OS images which are automatically appended to the menu. The exact way to do this cleanly may vary depending on your setup - perhaps some of these boot images can be removed using a package manager which would be more elegant than just removing files manually.
Either way, be careful, since removing the wrong file related to booting may make it impossible to boot your OS or even to start GRUB at all if you're extremely unlucky.

Related

How to create a consistent .config file to compile Linux kernel?

To compile Linux kernel, I created a default .config file using make defconfig. Since I didn't want to browse thousands of options through a menu-driven interface (make menuconfig), I set CONFIG_KALLSYMS=n manually, and then triggered the build (make -j8). I noticed the build system overwrote my changes and set CONFIG_KALLSYMS=y again. I suspect there might be other options present in the configuration which rely on CONFIG_KALLSYMS. How can I create a consistent .config file without using any menu-driven interface?
It might be burdensome to browse thousands of options through a menu-driven interface (make menuconfig). When you only want to change a couple of options and don't remember where they are in the menu hierarchy, you can use search to find any specific option. Just press / (slash) and type the full or partial name of the option. The result of the search will show where the options are located in the menu hierarchy, and what are the dependencies. Save and exit after you are done with the changes, and you should have a consistent .config file.
After you create a .config using make defconfig, to change just a few config options after that "make menuconfig" is the best way to do this. It also tells you about the dependencies and doesn't allow you to make a change unless the dependencies are met.

Compiling a Linux kernel and checking the logs for the same

I have built, installed my custom kernel. I need to prove that the new kernel is built and running. I have tried exploring /var/log/ for the log messages. I searched Xorg.log and dmesg.log and boot.log files for getting information about my newly built kernel, but I am unable to find the logs for the same. Can anyone let me know how and where I can find the logs for my new kernel. I am using ubuntu.
Thanks.
#user2559758 you need to go into General Settings tab and select the older kernel version as the default Kernel. (there is a drop down menu, choose your old kernel as default kernel). Now save your changes (top left corner). exit grub loader. reboot. Once the reboot happens, cp /var/log/dmseg ~/oldlog. Again run grub-customizer switch to General Settings (2nd tab) choose new kernel version, save, reboot. Now you can copy cp /var/log/dmesg ~/newlog . Now do diff oldlog newlog
Let me know if you have issues. If the answer is still unclear, please send the screenshot of General Settings tab. Also give the name of new and old kernel version names and I will be able to assist you better.
You can get the kernel version by running uname -a. If you built your new kernel with a unique version name (I don't recall off hand where the setting is in the kernel configuration), it'll be obvious which kernel you're running.

let ./configure find library files in specific directory

I'm currently installing R software on a shared space across several servers. After installation I found that when I login on different servers, R is not guaranteed to run due to the missing of some library files on different machines.
Here is what I'm trying to do: since the installation of R is machine-dependent, I'd like to put all missing library files like libtermcap.so.2, libg2c.so.1, etc, to a single directory on the shared space, so that when I run ./configure, it will also search for this directory. Since this directory is shared, the installation could become machine-independent, so I won't need to add missing files on each server.
Is there an option to achieve this when I run ./configure? Thanks.
Assuming you have copied the library files to /shared/lib/ and the header files to /shared/include/, you can run
./configure LDFLAGS=-L/shared/lib CPPFLAGS=-I/shared/include ...other options...
Note, however, that you are bound to run into trouble at run time, when you have to convince your installation to use the shared libraries from the right directory, especially in case someone decides to upgrade the default version on the respective host. That whole business is platform and installation dependent. I think if your hosts are not at least mostly identical, you ought to install your software (R) locally in a way suitable to the respective system.
Peter's answer is correct (+1), and please take special note of his suggestion to install locally. Using the local package management system and auto updating on each box is (in the long run) a much easier solution than trying to get compatible binaries/libraries on a shared drive. To simplify using Peter's solution, note that you can place the appropriate arguments in /shared/share/config.site. For example:
$ cat > /shared/share/config.site << EOF
: ${LDFLAGS=-L/shared/lib}
: ${CPPFLAGS=-I/share/include}
EOF
Whenever you run configure with --prefix=/shared, the config.site file will be read and defaults will be set.

Cygwin/vim Windows 7 file access issue

It appears that on Windows 7 Cygwin/vim thinks all files are read only. You can edit the files fine in Textpad/Notepad but vim thinks they are read only. There are number of reported occurrences but I can't see a solution. ??
Update: Per accepted answer, created the file C:\cygwin\etc\fstab.d\myname with the entry below.
none /cygdrive cygdrive binary,posix=0,user 0 0,acl
Per the comment you'll see in C:\cygwin\etc\fstab, this statement is the default Cygwin mount, save for the acl which I added.
Cygwin tries to impose a POSIX compatibility layer over the windows access control lists, which often leads to many problems.
In older versions of Cygwin a cheap solution was to disable this POSIX compatibility layer by setting the environment variable "CYGWIN=ntsec". Nowadays it seems as one must set the "acl" option for your drive(s).
http://www.cygwin.com/cygwin-ug-net/using.html#mount-table
This has some drawbacks. If you try to run a secured cygwin installation for multiple users, then better use a real linux, this will save so much hassle.
I guess another solution would be to use the native version of Vim instead of the cygwin one.

Capturing all the data that has changed during a Linux install

I am trying to figure out which files were changed when I run an app install via make install. I can look at the script, but that calls other scripts and may or may not touch other files, etc. How can I do this programmatically?
Implementation: http://asic-linux.com.mx/~izto/checkinstall/
Several ways come to mind. First, use some sort of LD_PRELOAD to track all files opened. Second approach, compare filesystem before and after.
If your kernel supports it, you can use inotify (a handy interface is inotify tools) and watch your home directory, if the package was configured with --prefix=/home/myusername
I've noticed that checkinstall (using installwatch via LD_PRELOAD) does not always catch everything, the last time I used it it did not catch empty directories that were created for spooling, which caused the subsequent generated .deb's to break.
Note, don't use inotify if you are installing to /, in that case you have to use installwatch or just read all of the makefiles / install scripts closely.

Resources