• No se han encontrado resultados

Origen de los créditos y prelación en el pago

In document CURSO DERECHO CONCURSAL (página 83-87)

PROCEDIMIENTOS DE RECONOCIMIENTOS DE CRÉDITOS

INTRODUCCIÓN DE LA UNIDAD 3

3.2 Origen de los créditos y prelación en el pago

Back in the mid-1990s, recompiling the kernel was something of a necessity, and it was also a good test that a user had mastered the basics of administering Linux. These days,

the stock kernel that comes with most distros has much improved, removing the necessity of kernel recompilation for basic use. However, there are cases where it’s well worth becoming familiar with this area of tweaking your system. For one thing, it’s a must if you want to access the latest and greatest kernel improvements, hot off the press, so to speak. It’s also a good way of understanding how the kernel and other fundamental parts of a Linux system actually

work. It can also be useful when troubleshooting: the newest kernel might bug-fi x the problem you’re having. On the other hand, an older kernel might be the workaround that you need.

We’ll start you off with a simple example that begins with fetching the source archive for the kernel that you are currently running, proceeding through to confi guration, compilation and installation. Following this, we’ll go through some examples that are a bit more specialist. Most of the examples are for Debian-derived distros, but we’ve deliberately kept things as neutral as possible and added some notes for how to handle things on Red Hat-based distros such as Fedora. .config is the file

in which you will make most of your changes

Fortunately, there are a few different ways of editing .config, including xconfig, a GUI editor

Compiling the kernel takes a long time, but fortunately, you can leave it running in a terminal window and get on with other work

Once the kernel is complete, you can add it to the system using the standard package tools

01

Install prerequisites

Begin by fetching the tools needed to create a suitable build environment. Enter ‘sudo apt-get install fakeroot crash kexec- tools makedumpfi le kernel-wedge git-core libncurses5 python libncurses5-dev kernel- package libelf-dev binutils-dev’ followed by ‘sudo apt-get build-dep linux-image’.

02

Fetch the kernel (source archive)

If you need the latest kernel, use Git to fetch it (see later step), but we are going to use the standard package tools in the fi rst example. Use ‘apt-get source linux-image-$(uname -r)’ to install the source for the currently running kernel.

03

Examine the source directory

You should now have a source directory in the current directory. Move into it using the cd command. Note that there is an archived (tar.gz) copy as well. In addition, there is a diff fi le that contains the Ubuntu-specifi c additions to the standard kernel source tree.

04

Generate a .confi g fi le

The (hidden) fi le ‘.confi g’, located in the source code directory, tells the compiler what to build. The confi guration fi le for each installed kernel is stored in the /boot directory, but you can capture the confi guration of the current kernel (a good starting point) by typing ‘make oldconfi g’.

05

Edit .confi g

Open up .confi g in a text editor. Note that there are thousands of options, and this approach is best if you know exactly what settings you would like to edit. It’s a good idea to search for ‘CONFIG_LOCALVERSION’ to add a small identifying string for your custom kernel.

08

Prepare Debian scripts

Some required scripts lose their execution privileges due to how apt-get works. Rectify this by typing ‘chmod -R u+x debian/ scripts/*’ and then ‘chmod u+x debian/rules’.

07

Invoke xconfi g

Type ‘make xconfi g’ to launch the GUI confi g fi le editor. It’s a good way to gain an overview, and it offers information for most of the options. Run ‘sudo apt-get install libqt4-core libqt4-dev libqt4-gui’ if it complains about not being able to fi nd Qt.

06

Turn off debugging

One way to speed things up and produce smaller fi les is to turn off debugging.

09

Recreating the Source Tree

If you mess things up and want to start from scratch, delete the source directory. Backup your .config file first, if needed. Then run “tar xzf” on the source archive to unpack it. Move into the directory and type “zcat ../[name of diff archive] | patch -p1” to add the Ubuntu patches into the source tree.

It’s a specialist feature and mainly used by developers. You can use xconfi g for this. Set ‘CONFIG_DEBUG_INFO:’ to ‘n’.

16

Begin the build (Red Hat)

Generate and edit the .confi g fi le as before. Open ~/rpmbuild/SPECS/kernel.spec and change the line ‘#% defi ne buildid’ from ‘.local’ to something unique to identify your kernel. From within, type ‘~/rpmbuild/SPECS/’ then ‘rpmbuild -bb --without debug debuginfo --target=`uname -m` kernel.spec’ to build.

10

Compile the kernel

Tell the build environment how many cores you want to use with ‘export CONCURRENCY_LEVEL=[number of cores]’. Begin the build process with ‘fakeroot make- kpkg --initrd --append-to-version=-luad kernel- image kernel-headers’, which takes about an hour on a Core Duo 2.7GHz system.

11

Install kernel

Warning: This is stage where you actually make some changes to your machine. Using our method means that we can install our custom kernel just like any other package. Type ‘sudo dpkg -i linux-image[version].deb’ and then, ‘sudo dpkg -i linux-headers-[version].deb’.

12

Edit GRUB 2

Open up /etc/default/grub in a text editor. Edit the line ‘GRUB_HIDDEN_TIMEOUT=0’ to remove the zero. Now run ‘update-grub’. The Grub Menu will be displayed at startup. The old, stock

13

Fetch the kernel using Git (Ubuntu)

This gives you the latest version of the Ubuntu kernel source. Install Git: ‘sudo apt- get install git-core’. Fetch the source with ‘git clone git://kernel.ubuntu.com/ubuntu/ubuntu- oneiric.git’. Substitute ‘oneiric’ with the offi cial distribution name that you are using.

14

Fetch kernel manually

Now that you’re familiar with compiling the kernel, consider grabbing a newer kernel from kernel.org, although these kernels don’t have the extra additions of Ubuntu. Unpack the kernel with ‘tar xjfv linux.<version>.tar.bz2’ and repeat the earlier steps.

17

Install ccache

ccache is a compiler cache that is particularly useful when compiling the kernel, although you only start to see the full benefi t on repeat compilations. Enter ‘sudo apt-get install ccache’. Then type ‘export CC="ccache gcc" ’ and then ‘export CXX="ccache g++" ’.

15

Building the kernel on Red Hat

Many of the techniques already applied can be used with Red Hat-derived distributions such as Fedora. Begin by installing the prerequisites: ‘su -c 'yum install rpmdevtools yum-utils' ’. Then type, ‘rpmdev-setuptree’, and then ‘yumdownloader --source kernel’ to fetch the kernel. ‘su -c 'yum-builddep kernel-[use tab completion].src.rpm' ’ and then ‘rpm -Uvh kernel- [use tab completion].src.rpm’. Move into the SPECS directory with ‘cd ~/rpmbuild/SPECS’ and type ‘rpmbuild -bp --target=$(uname -m) kernel. spec’. Now cd into the source directory (something like, rpmbuild/BUILD/kernel-3.6.fc17/linux-3.6.8-2. fc17.i686/)

kernel can be found under the ‘Previous Linux Versions’ entry. On reboot, type ‘uname -a’ to check the kernel version.

19

Fetch the source

On the PC, create a directory and then move into it. Then type ‘git clone https://github. com/raspberrypi/fi rmware’ followed by ‘git clone https://github.com/raspberrypi/linux.git’. Now move into the ‘linux’ directory.

20

Confi guration

You can fetch the confi g from a running Raspberry Pi by typing ‘sudo zcat /proc/confi g.gz > .confi g’ into a shared directory, and then copying it to the ‘linux’ directory on the PC. Type ‘make ARCH=arm CR O S S _ C OMPIL E=/usr/ bin /ar m-linu x- gnueabi- oldconfi g’.

21

Cross-compile kernel

You can then edit the confi g with ‘make ARCH=arm CROSS_COMPILE=/usr/bin/ arm-linux-gnueabi- xconfi g’. Now run ‘make ARCH=arm CROSS_COMPILE=/usr/bin/arm- linux-gnueabi- -k’ to compile. Place the new kernel (linux/arch/arm/boot/Image /boot/ kernel.img) in /boot/kernel.img.

23

Tweak for MIDI performance 2

Follow the steps as for a normal installation, but fi rst carry out some tweaks in the .confi g fi le. Ensure that ‘CONFIG_HZ_1000’ is set to ‘y’ and that ‘CONFIG_APM’ is set to ‘n’.

24

Work inside a virtualiser

If this is the fi rst time you’ve built a kernel, you might like to start by working inside a virtualiser (eg QEMU). This gives numerous advantages such as being able to pause the build process. Try to devote as much memory and as many cores as you possibly can.

18

Cross-compilation (Raspberry Pi)

You can use a powerful machine to ‘cross-compile’ a kernel for a smaller one. We’ll use the Raspberry Pi as an example. You will need a way of accessing fi les on the Pi storage device. Type ‘sudo apt-get install gcc-arm-linux- gnueabi make git-core ncurses-dev’ on the PC.

22

Tweak for MIDI performance 1

Here’s an example to tweak the kernel for improved MIDI latency for an AV workstation. First, fetch a patch archive at an appropriate level for your kernel from www.kernel.org/pub/linux/ kernel/projects/rt/. Repeat the procedure for recreating the source tree, but apply the RT patch before the Ubuntu one.

In document CURSO DERECHO CONCURSAL (página 83-87)