If you want to add a new file/directory to an svn repository, you first specify the new file/directory using the command
$svn add 'file/directory name'
It is important to note that the change does not propagate to the server until you issue an 'svn commit'
For any reason, if you would like to revert the addition of file/directory, just follow these
1. If it is a directory, go to the directory and delete the directory named '.svn'
$ rm -rf .svn
Go to the parent directory and edit the file .svn/entries and delete the entry corresponding to the directory you added using 'svn add'. Be very careful while editing the file as it contains the metadata used by svn in a particular format
2. If it is a file, go to the .svn directory in the directory which contains the file and edit the file entries and remove the entry corresponding to the file you added using 'svn add
I just found this by experimentation. However, I am not aware of any other method to revert the changes. If you know of any, please feel free to leave a comment.
Wednesday, March 31, 2010
Monday, March 29, 2010
How to compile the linux kernel
Linux newbies often find it difficult to the compile the linux kernel and get it running. without any problems.
I usually follow the instructions at http://www.howtoforge.com/kernel_compilation_ubuntu
If you use other linux distributions please visit http://www.howtoforge.com/howtos/linux/kernel
I am listing out the instructions here for ubuntu distribution in a much simpler way. The tutorial above goes into a lot of detail. We do not usually need all the instructions listed over there. Feel free to leave comments if you have any related question unanswered or if you encounter any problems in the process. I should be able to get back to you as soon as I can.
1. It is always good to run 'sudo apt-get update' once in a while. This updates the list of packages/updates available for ubuntu. It would also be good to run 'sudo apt-get upgrade'
shell commands:
$sudo apt-get update
$sudo apt-get upgrade
2. Install the needed packages now
$apt-get install kernel-package libncurses5-dev fakeroot wget bzip2
3.If you are running recent linux distributions, you will have 2.6 kernel on it. Get the kernel source of the 2.6 kernel version you would like to compile from here
http://www.kernel.org/pub/linux/kernel/v2.6/
Go to the directory /usr/src
$cd /usr/src
Download and unzip the tarball using the command. 'version' is the linux kernel version that you want to compile
$tar -xzvf linux-'version'.tar.gz
or
$tar -xjvf linux-.'version'tar.bz2
$cd linux-'version'
4. Create a .config file
$make menuconfig
Just leave the standard configuration (unless you know if you want a particular feature), press and press 'exit'. This will write the default configuration into the file '.config'.
If you applied any patch to the kernel, edit the '.config' file thus generated and uncomment the related config options and run
$make oldconfig
It will ask you a few questions, reply with 'm' or 'y' accordingly
5. Execute the following two commands to compile the kernel
$make-kpkg clean
$fakeroot make-kpkg --initrd kernel_headers
Now the kernel compilation will start. Be patient as the compilation may take a few hours
6. Once you notice that the compilation was successful, execute the following
$cd /usr/src
$dpkg -i linux-image-'kernel version'.deb
$dpkg -i linux-headers-'kernel version'.deb
7. Go to '/boot' directory to make sure the initrd file exists
$cd /boot
$ls -l initrd.img-'kernel version'
8. Now open the menu.lst file and check if the boot information of the new kernel version is added to the grub
$vi /boot/grub/menu.lst
find an entry for the new kernel that is installed, eg:
I usually follow the instructions at http://www.howtoforge.com/kernel_compilation_ubuntu
If you use other linux distributions please visit http://www.howtoforge.com/howtos/linux/kernel
I am listing out the instructions here for ubuntu distribution in a much simpler way. The tutorial above goes into a lot of detail. We do not usually need all the instructions listed over there. Feel free to leave comments if you have any related question unanswered or if you encounter any problems in the process. I should be able to get back to you as soon as I can.
1. It is always good to run 'sudo apt-get update' once in a while. This updates the list of packages/updates available for ubuntu. It would also be good to run 'sudo apt-get upgrade'
shell commands:
$sudo apt-get update
$sudo apt-get upgrade
2. Install the needed packages now
$apt-get install kernel-package libncurses5-dev fakeroot wget bzip2
3.If you are running recent linux distributions, you will have 2.6 kernel on it. Get the kernel source of the 2.6 kernel version you would like to compile from here
http://www.kernel.org/pub/linux/kernel/v2.6/
Go to the directory /usr/src
$cd /usr/src
Download and unzip the tarball using the command. 'version' is the linux kernel version that you want to compile
$tar -xzvf linux-
or
$tar -xjvf linux-
$cd linux-'version'
4. Create a .config file
$make menuconfig
Just leave the standard configuration (unless you know if you want a particular feature), press
If you applied any patch to the kernel, edit the '.config' file thus generated and uncomment the related config options and run
$make oldconfig
It will ask you a few questions, reply with 'm' or 'y' accordingly
5. Execute the following two commands to compile the kernel
$make-kpkg clean
$fakeroot make-kpkg --initrd kernel_headers
Now the kernel compilation will start. Be patient as the compilation may take a few hours
6. Once you notice that the compilation was successful, execute the following
$cd /usr/src
$dpkg -i linux-image-'kernel version'
$dpkg -i linux-headers-
7. Go to '/boot' directory to make sure the initrd file exists
$cd /boot
$ls -l initrd.img-'kernel version'
8. Now open the menu.lst file and check if the boot information of the new kernel version is added to the grub
$vi /boot/grub/menu.lst
find an entry for the new kernel that is installed, eg:
title Ubuntu, kernel 2.6.33
root (hd0,0)
kernel /boot/vmlinuz-2.6.33 root=/dev/sda1 ro quiet splash
initrd /boot/initrd.img-2.6.33
savedefault
boot
title Ubuntu, kernel 2.6.33 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.33 root=/dev/sda1 ro single
initrd /boot/initrd.img-2.6.33
boot
9. Now restart the machine and select the kernel version you just installed, when you are on the boot screen
After the system boots execute
$uname -r
to make sure you booted with the kernel version, you just installed
Congratulations! You have just compiled and installed the linux kernel!
Subscribe to:
Comments (Atom)
