[Musix-Help] Kernel: investigación y novedades

Marcos Guglielmetti marcospcmusica en yahoo.com.ar
Sab Feb 11 20:18:04 CET 2006


Estas son las últimas noticias e investigaciones sobre la compilación 
del kernel:

https://www.musix.org.ar/wiki/index.php?title=Kernel%2C_compilar%2C_investigaci%C3%B3n


= Compilando Kernels para Musix =

El objetivo de este material es lograr compilar un kernel que pueda ser 
incluído en el Live-CD sin problemas, y que opere en tiempo real.
Para el 11-2-2006, fecha en la que escribo, he conseguido realizar una 
compilación exitosa que opera en tiempo real, compilé también 
exitosamente el módulo cloop, necesario para incluir el kernel en el 
Live-CD, pero encontré errores al intentar compilar UNIONFS, que 
también es necesario para el Live-CD.

Por lo demás, el nuevo kernel opera muy bien instalado en HD, más abajo 
un testeo lo demuestra:

=Duración de la compilación=

En un equipo Duron 1800Mhz con 120Mb RAM, HD 7200 RPM:

La compilación y armado de paquetes .deb dura aprox 1h

= Testeos, pruebas de rendimiento =

Nota: '''necesitamos más testeos, por favor, sumarse a la cruzada'''

En un equipo Duron 1800Mhz con 120Mb RAM, HD 7200 RPM:

sáb feb 11 18:34:03 CET 2006

Probando Kernel:
Musix GNU/Linux, kernel 2.6.15.3-rt-musix-2006-11-02 

Este kernel es practicamente idéntico al anterior subido a 
http://www.k-maleon.com/musix/deb

* Bien: Una sesión previa de ardour con 7 tracks con efectos funcionó 
muy bien tanto en modo jackd duplex como en modo sólo reproducción con 
512 de buffer.

* MAL: al iniciar JAMIN teniendo esa sesión de Ardour con jackd DUPLEX, 
todo se puso extremadamente lento, aunque al reiniciar jack en modo 
sólo reproducción anduvo normalmente y se pudo masterizar bien.
	
* Regular: Con JAMIN sólo y jackd duplex en 256 de buffer no existe ese 
problema en ese conexto, al abrir una sesión en ardour de 7 pistas, se 
produjeron 4 (28) xruns durante el trabajo intensivo en disco, por lo 
cual se supone que en maquinas con mas RAM esto podría NO suceder. 

* Regular: Pero si nos manejáramos con jackd en modo sólo reproducción: 
4 (12) xruns con ese buffer de 256 en jackd. Para mi PC es mucha 
exigencia la latencia de 11ms con 120 MB de RAM: eso era así también 
con el kernel de DeMuDi. Aún así, es totalmente trabajable Ardour en 
estas condiciones.

* Regular: con un buffer de 512 (23ms latencia) o también con 1024 
(46ms) modo Sólo Reproducción, abriendo la misma sesión de 7 pistas en 
Ardour obtengo 2 (2) xruns durante la carga de la misma, luego no se 
producen xruns.

* Bien: con jack configurado en 48000 Hz, 1024 de buffer (46ms 
latencia), modo sólo reproducción, Ardour con 7 pistas con efectos 
varios en tiempo real NO se produce ningún XRUN. Exigiéndolo un poco 
más: Abriendo JAMIN y haciendo todas las conexiones sin siquiera 
detener el PLAY, no se produce ningun xrun ni problema alguno.

* BIEN: Con un buffer de 128 (5ms latencia) tampoco se producen Xruns: 
el secreto estaba en configurar JACK en 48000Hz en lugar de 44100

* MAL --> error crítico en esas condiciones anteriores, abrí JAMIN y se 
colgó todo el sistema. Se ve que Jamin necesita valores bien definidos 
con este "ecosistema" nuevo.


--o--

=Resultados sobre compilaciones=

11-2-06

Nota: la última imagen de kernel que hice se colgaba al bootear: tomé la 
config de Knoppix, quizá eso sucedió porque faltaba cloop o unionfs, 
aunque no creo, porque boteando del HD , que yo sepa, no usa esos 
módulos...

Sin embargo, el 1º kernel image que hice (subido a k-maleon) en base a 
la config de DeMuDi había funcionado, así que haré eso de nuevo, y 
aplicaré los módulos cloop y UNIONFS

Nota2: no bootea tampoco, debe ser algo que elijo en el menuconfig

Nota3: la última versión realizada bootea perfectamente desde el HD

sáb feb 11 18:34:03 CET 2006
Musix GNU/Linux, kernel 2.6.15.3-rt-musix-2006-11-02 


= Tutorial =

==Fuente==

http://ubuntustudio.com/wiki/index.php/Breezy:Vanilla_Kernel_With_Realtime_Preemption

==Breezy:Vanilla Kernel With Realtime Preemption==
From The Ubuntu Studio Project

To get to the goal of true real-time, low-latency audio work under 
Linux, you will absolutely require Realtime-Preemption. Ingo Molnar, 
who currently works for Red Hat, wrote a patch that will apply to the 
the official vanilla kernel sources. This patch gives you roughly 95% 
preemption, as compared to about 50% preemption without the patch.
	
Take note that in order to follow this tutorial, you may end up breaking 
some of the Ubuntu features. If this is the case, you may require 
additional patches, which will require more work. Ubuntu uses more than 
180 patches on their kernel. Please add to this or post on the 
discussion page if you have additional Ubuntu patches that will apply 
cleanly. If you would rather use basic preemption, which will give you 
roughly 50% preemption, you should follow the page for Enabling 
Preemption in Breezy.
	
Firstly, get the latest patch from 
http://people.redhat.com/mingo/realtime-preempt/. At the time of 
writing, the latest patch listed there is patch-2.6.15-rt16. We also 
will want the bd-claim.patch as well, which fixes EVMS (one of the 
things Ubuntu's patched kernel fixes).


== Download realtime preempt patch==
	sudo -i
	cd /usr/src

wget http://people.redhat.com/mingo/realtime-preempt/patch-2.6.15-rt16

	apt-get install kernel-patch-evms
	gunzip kernel-patches/diffs/evms-bd-claim/2.6-bd-claim.patch.gz

== Download kernel source==

Now download the latest matching official kernel source from

 http://www.kernel.org/. 

At the time of writing, the latest kernel is 2.6.15.3
	
# modificado para actualizar a la version que usé (2.6.15.3)

 wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.15.3.tar.bz2

	
== Descomprimir Kernel==

	tar jxfv linux-2.6.15.3.tar.bz2

# ocupó 253 mb en total

==4 mover y renombrar==

mv linux-2.6.15.3 linux-2.6.15.3-rt

Aquí entro por chroot al source, y hago las cosas pertinentes (o me 
quedo en el sistema "madre" y compilo allí, no hay problemas con eso 
aparentemente)

	cd /usr/src

	mv linux linux.old

==5 Link==

# en mi caso esto que sigue fue así:

	ln -s /mnt/hda1/www/gwget/linux-2.6.15.3-rt/ /usr/src/linux
	
	
If you want to use the deprecated Realtime LSM, then you can prepare to 
make a deb package for it during this process as well:

=6 ignorar realtime-lsm=

Realtime-lsm ya no es necesario para esta versión del kernel en 
adelante.

# lo hice - NO HACERLO, DA UN ERROR QUE no se como resolverlo...

	apt-get install realtime-lsm-source realtime-lsm
	tar jxf realtime-lsm.tar.bz2


== Copiar confg==

# agregué: 

	cd /usr/src/linux

	cp /boot/config-2.6.11 .config 

(esto terminó haciendo un kernel que no booteaba, pero quizá fue por las 
elecciones posteriores)

# O mejor: copiar el config desde el kernel de DeMuDi:

	cp /boot/config-2.6.13-1-multimedia-386 .config

	cd include
	ln -s asm-i386 asm
	cd ..

(en caso de que no esté instalado:)

	apt-get install libncurses5-dev

==Plan==

Este sería el plan según el tutorial de Knoppix: pero OJO: se puede 
hacer de otro modo, antes seguir con el resto... ahora veremos.

		make menuconfig
		make
		make modules
		make modules_install

Bueno ATENCION: lo de antes mencionado por el howto de knoppix lo hago 
después, ahora sigo con el howto de Ubuntu-studio:

There are other modules that you may require as well. Please add them to 
the wiki here if you have the package names. If you require assistance, 
post on the discussion page of this wiki and one of the editors will 
hopefully be able to assist you.
	
== Now, let's patch the kernel source.==

	cd linux/
	patch -p1 < ../patch-2.6.15-rt16
##(eso funcionó perfecto estando chrooted y con el simlink)	

	
== borrar==
	
	rm Makefile.rej
	

	
== Now change the fourth line in this file from==
	
	nano Makefile
# actualizado

	EXTRAVERSION = .3
	
	to:
	
	EXTRAVERSION = .3-rt
	
Save the file and exit nano.
	
== Make menuconfig!==

	make menuconfig
		
If you have never used menuconfig before, you should learn. Look around, 
change the settings that you are certain you want to change. 

==Cambiar==

	In this step, you must deselect the option Kernel Hacking > Automatic 
spinlock/rwlock/mutex/rwsem deadlock detection
	# hecho
	
	, as well as Kernel Hacking > Debug preemptible kernel as these 
increases latency.
	# ya estaba desabilitada en el .config de knoppix 2.6.11
	
	#Detalles, miré para soporte framebuffer y estaba habilitado...

==KERNEL CONFIGS:==

===sáb feb 11 16:23:52 2006===

*'''Nota: este kernel funcionó bastante bien en HD'''

* FRAMEBUFFER: pruebo desabilitándolo. (a ver si no se cuelga al inicio)
* Lo único que agregué fueron los módulos ALSA, el resto no toqué nada.
* Sin SMP (dejé como estaba)

===sáb feb 11 00:00:00 2006 (esta versión no arrancó)===

'''Advertencia''': esto lo dejo como un log, pero no debería ser seguido 
en todos los caso, dado que este conjunto de opciones provocaron que el 
kenrel no iniciara.

	-> Device Drivers
	-> Sound
		-> Advanced Linux Sound Architecture                                                               
-> PCI devices
			
#En la config de DeMuDi: 2.6.13 (no es la que estoy laburando ahora)
# ¡ estaban todas las placas desabilitadas! habilité todas como 
módulos..
# OSS estaba desabilitado, y lo dejé así...

Pero en la config de Knoppix 2.6.11 (la que estoy trabajando ahora) 
estaban todas las PCI para sonido como Modulos, salvo una nueva que 
habilité:
	
	<M> Intel HD Audio  
	
#Experimentando:
	General setup --> [x] Optimize for size (Look out for broken 
compilers!) 
	
Habilité también:
	-> Device Drivers -> Graphics support
	
		<M>   nVidia Framebuffer Support
			[*]     Enable DDC Support  
	
Y HABILITE TOOOODO lo que creí necesario dar soporte a Framebuffer para 
diferentes marcas y modelos (la lista es larga!) En:
	
	-> Device Drivers   -> SCSI device support  -> SCSI device support 
(SCSI [=y]) ->SCSI low-level drivers
	
Estaba habilitado de todo un poco, incluso:    <*> Serial ATA (SATA) 
support
	
Pero en:
	
	-> Device Drivers   -> ATA/ATAPI/MFM/RLL support       -> 
ATA/ATAPI/MFM/RLL support (IDE [=y]) [ ]  Support for SATA (deprecated; 
conflicts with libata SATA driver)
	
	Explica que es preferible el soporte SATA que está activado en SCSI... 
y que ese soporte es necesario para SATA antiguos, y que hace 
conflicto, entonces lo dejo desabilitado.
	
#Habilité el DMA PCI por default: (version que no arrancó)
	
	-> Device Drivers                             
	-> ATA/ATAPI/MFM/RLL support  -> ATA/ATAPI/MFM/RLL support (IDE [=y])      
-> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support(BLK_DEV_IDE 
[=y])  -> PCI IDE chipset support (BLK_DEV_IDEPCI [=y])
	-> Generic PCI bus-master DMA support (BLK_DEV_IDEDMA_PCI [=y])   
	
	# El firewire estaba habilitado:
	IEEE 1394 (FireWire) support  --->
	<M>     IEC61883-6 (Audio transmission) support
	
# OSS estaba todo habilitado en el kernel 2.6.11 de knoppix!, en DeMuDi 
no, por lo tanto lo deshabilito
	
	
# Habilité 2 placas nuevas en ALSA (config de knoppix)
# en la config de demudi estaban todas desabilitadas: las habilité
	
	-> Device Drivers  
	-> Sound    
	-> Advanced Linux Sound Architecture      
	-> PCI devices              
	
	RME Hammerfall DSP MADI 
	<M> Analog Devices AD1889 
	
# Acá cambié:
	Processor type and features
	
Processor family (486)  --->  
	[*]   SMT (Hyperthreading) scheduler support  
	(4)   Maximum number of CPUs (2-255) 
	[*] Enable X86 board specific fixups for reboot  
	
# en Networking Habilité
	
	M>   Generic IEEE 802.11 Networking Stack  
	
(Habilité el SMP para config derivada de demudi, dice que correrá mas 
lento en maquinas con un sólo procesador, pero es más útil por ahora 
tener un kernel que sirva para todo terreno, luego veremos.)


'''fin de KERNEL CONFIGS'''


==Guardar cambios==

Once you have done that, Exit from menuconfig and select Yes to save 
your kernel configuration.

Now build the kernel and module debs. This step will take a long time.
	
	make-kpkg clean
	make-kpkg modules_clean

# eso corrio muy rapido

==Compilar y hacer los paquetes .deb==

#11-2-06

make-kpkg --append_to_version -musix-2006-2-11 --revision 2 --initrd 
kernel_image kernel_headers modules_image

# Un detalle: quizá el modules_image que no está haciendo ahora lo 
podría hacer con el cloop y unionfs, averiguar.
# Actualizado: Efectivamente hizo el módulo cloop!

	cd /mnt/hda1/www/gwget

	du -h *.deb

20K     cloop-module-2.6.15.3-rt-musix_2.02.1+eb.10+1_i386.deb
5,4M    kernel-headers-2.6.15.3-rt-musix_1_i386.deb
11M     kernel-image-2.6.15.3-rt-musix_1_i386.deb

# 11-2-06--instalando los paquetes: funcionó bien.

Once that is complete with no errors, you can then install the new deb 
packages:

=Instalando los paquetes .deb=	
	cd ..
	#cd /mnt/hda1/www/gwget (carpeta que contiene el link en mi caso)
	dpkg -i *2.6.15.3-rt-musix*.deb
	exit
	
# exito: hizo esto:
	
Configurando kernel-headers-2.6.15.3-rt-50studio (1) ...
Configurando kernel-image-2.6.15.3-rt-50studio (1) ...
mkext2fs:
Warning: A debian kernel was found, so mkcramfs will be called.
Use -f to avoid this. You can change parameters and programs
in /etc/mkinitrd/mkinitrd.conf
/initrd.img does not exist. Installing from scratch, eh?
Or maybe you don't want a symbolic link here. Hmm? Lets See.
/vmlinuz does not exist. Installing from scratch, eh?
Or maybe you don't want a symbolic link here. Hmm? Lets See.
Searching for GRUB installation directory ... found: /boot/grub .
Testing for an existing GRUB menu.list file... 
found: /boot/grub/menu.lst .
Searching for splash image... none found, skipping...
Found kernel: /boot/vmlinuz-2.6.15.3-rt-50studio
Found kernel: /boot/vmlinuz-2.6.13-1-multimedia-386
Updating /boot/grub/menu.lst ... done
	

==Reiniciar y probar==	
Now, restart your computer, and you will boot into a new kernel 
realtime-preemption, allowing you to be as close as currently possible 
to true, low-latency real-time audio.
	
If something goes wrong, just choose the original kernel from the Grub 
menu during bootup, and then remove the kernel packages:
	
	sudo apt-get remove kernel-image-2.6.15.3-rt-musix 
kernel-headers-2.6.15.3-rt-musix
	
If you installed modules, you can remove them as well:

	sudo apt-get remove realtime-lsm-module-2.6.15.3-rt-musix



=Tutorial de parte de Knoppix=

Tutorial para incorporar un nuevo kernel a knoppix

http://www.knoppix.net/forum/viewtopic.php?t=21145

HOWTO: Upgrading the kernel
	
Change Log:
* Version 1.2 - Thu Dec 01, 2005
Fixed ommission of making the actual kernel (thanks mcreel).
	
* Version 1.1 - Wed Sep 21, 2005
Elaborated compilation of cloop and unionfs
	
* Version 1.0 - Tue Sep 20, 2005
Initial write
	
	
Acknowledgements:
Snippets are taken from the "Knoppix Custom Kernel" wiki
* Daniel R. Tarsky
* Marc Haber
* Rich Ercolani
	
Disclaimer:
Always needed cause you just never know how people will interpret 
things. Please people, use this at your own risk. Whilst this method 
has and continues to work for me, I will not be held responsible for 
anything that might go wrong, due to an ommision or typo in this 
document. I too, like you, am human and do make mistakes.
	
==Preface==

There are many excellent guides for remastering Knoppix on these forums. 
The better ones, continue to evolve such as UnderScore's at 
http://www.knoppix.net/forum/viewtopic.php?t=13867. The following 
should be used in conjuction with a Remastering Howto as it will not 
cover the requirements for establishing or finishing a remastering 
sesssion.
	
This howto is based on the way I replace kernels. I like nothing better 
than seeing a new kernel release over at kernel.org and upgrading my 
remaster to the bleeding edge. The document will assume remastering of 
Knoppix since the inception of UnionFS and the solitary 2.6.x kernel. 
In time, support for more historic versions may be incorporated.
	
So you have downloaded your preferred version of Knoppix and there is a 
new kernel waiting at kernel.org, itching to be installed on your 
remaster. Taking Knoppix version 3.8.1/2 for example, it utlises the 
2.6.11 kernel that has the command line properties patched to allow 512 
characters instead of 256. And that's about it, it's exact 
configuration can be found at /boot/config-2.6.11 inside the compressed 
filesystem.

(checkear kernel de knoppix COPIAR ESA CONFIG en lugar de la de DeMuDi) 
Nota: no logré hacer un buen kernel con esa base aún.

=The miniroot=
	
Knoppix utilises a special image file known as an Initial RAM Disk 
(inirtd) image (ie. minirt.gz) for bootup. The minirt.gz file is in 
fact a minitaure root environment for Knoppix. It has the essential 
elements of a minimal root filesystem and performs the folling process:

1. Probe the CD/DVD drive,
2. Find the compressed filesystem (on the CD),
3. Mount it,
4. Switch the boot process from the mini root environment to the now 
available (de)compressed filesystem.
	
A look inside the minirt.gz file will reveal a number of directories and 
symlinks. The directories are /cdrom, /etc, /mnt, /modules, /proc 
and /static. Everything else is symlinked to /KNOPPIX, which is where 
the compressed system image will be mounted once minirt has does it's 
job.
	
Aside from the symlinks, /modules and /static stick out as 
non-traditional directories. /static is where the special 
statically-linked ash shell resides, which also doubles as init and 
modutils. When miniroot is mounted as a boot/root environment, the 
kernel executes the linuxrc script on the 'root' of miniroot with the 
static ash-knoppix. 

==Importante modutils==

Because ash-knoppix (or 'init' in this context) is statically linked 
with modutils, you may also need to recompile ash-knoppix to upgrade 
your modutils for any newer kernel versions that may require them. This 
is of course in addition to installing the new modutils in your Knoppix 
image source directory.
	
The only modules in the /modules folder are the cloop module for the 
system image, scsi modules in case you happen to boot your CD from a 
SCSI CD-ROM and unionfs for merging the CDROM with the RAMDisk.
	
As linuxrc executes, it attempts to find the compressed filesystem image 
(ie KNOPPIX) from the medium you are booting from (eg. CD-ROM, USB, 
etc). At this point the whole filesystem is still in ram, so the medium 
must first be mounted to access the compressed filesystem image. Once 
mounted, a second RAMdisk is created with a dynamic size (percentage of 
of available and free memory) which will be used for /home and /var 
directories. Finally, cloop.o is loaded into the kernel and the 
compressed system image is mounted on /KNOPPIX, making all the symlinks 
work as part of the root filesystem. Next, more symlinks are created 
and important system files are migrated to the RAMdisk so they can be 
written to if need be.

==knoppix-autoconfig==
	
Once linuxrc is finished, it gives control back to the kernel init 
process which in turn starts running the rc boot scripts, most notably 
knoppix-autoconfig.

==Qué reemplazaremos==

What are we going to replace/upgrade:
OK, the big issue with upgrading the kernel is that people are not 
always certain of what has to be replaced. If they encounter an error 
they first assumption is that not everything essential has been 
replaced. From my experience, in short, the steps are:
	
For the compressed filesystem (ie chroot environment, /source)
1. Untar linux source
2. Apply any patches
3. Perform a make, make modules and make modules_install
4. Copy bzImage, System.map and update symlinks in boot
	
For the miniroot image (ie /master)
1. Copy bzImage
2. Update modules with those created when compiling (eg. cloop, unionfs, 
etc).
	
In short, that is it ... now for a little elaboration
	
==Compressed Filesystem (chroot environment)==
	
In your chroot environment you need to extract your linux kernel source 
(eg. version 2.X.YY) to the /usr/src directory. It's always good to 
point the linux symlink to the working source.

	Code:
	tar -xjf /path/to/linux-2.X.YY.tar.bz2 -C /usr/src
	cd /usr/src
	ln -s linux-2.X.YY linux
	cd linux
	
	
At this point I will apply any patches I want to use in the kernel, for 
example squashfs, gensplash, etc. Once the kernel is patched to your 
liking it is time to configure it. To ensure the new kernel is 
baselined from the Knoppix kernel I use the Knoppix config as the 
baseline. Taking Knoppix version 3.8.1/2 as an example, and using the 
default options that popup:

	Code:
	cp /boot/config-2.6.11 .config
	make oldconfig
	make menuconfig
	make
	make modules
	make modules_install
	
	
If you are unable to 'make oldconfig' or 'make menuconfig' becuase it 
borks with errors then it is likely that you just need to set up the 
asm symlink as follows:

	Code:
	cd include
	ln -s asm-i386 asm
	cd ..
	
	
I don't do a 'make install' cause I find it simpler to just copy what I 
need.

	Code:
	cp arch/i386/boot/bzImage /boot/vmlinuz-2.X.YY
	cp System.map /boot/System.map-2.X.YY
	cp .config /boot/config-2.X.YY
	
	
Update the boot symlinks

	Code:
	cd /boot
	rm config System.map vmlinuz
	ln -s config-2.X.YY config
	ln -s System.map-2.X.YY System.map
	ln -s vmlinuz-2.X.YY vmlinuz
	

==cloop y unionfs==
Hay que conseguir los fuentes PARA ASEGURAR compatibilidad con el nuevo 
kernel. No es que sea obligatorio, podría funcionar quizá, pero lo 
haremos bien.
	
At this point you will need to obtain both the cloop and unionfs sources 
to ensure compatibilty with the new kernel. I use the cloop-2.01-5 
cause that is readily available from 

==cloop sources=

	http://developer.linuxtag.net/sources

when the site is up of course. 

#Yo lo bajé de:

 
http://ftp.debian.org/debian/pool/main/c/cloop/cloop_2.02.1+eb.10.tar.gz

Lo voy a actualizar igual, porque creo que se compila especialmente para 
el kernel en el cual trabajamos...

==unionfs sources==

(este sí está viejo: apt-cache policy unionfs-module-2.6.11
unionfs-module-2.6.11:
  Instalados: 1.0.11-1
  Candidato: 1.0.11-1
)

I grab the unionfs sources from 

 ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/


, you'll need at least 1.0.14 for kernels 2.6.13 and higher. I extract 
them to the /usr/src/modules directory for clarity.
	
 Code:
 tar -xzf /path/to/cloop-2.01-5.tar.gz -C /usr/src/modules

# haciendo esto en sistema NO chrooted (luego de compilar el kernel allí  
y de hacer los paquetes debian allí)

tar -xzf unionfs-1.0.14.tar.gz -C /usr/src/modules
cd /usr/src/modules
	
===Compilar cloop===

When compiling cloop, it is important to have conf.vars available 
(resides in /usr/src/linux) as it requires a couple of variables to 
read the version of the kernel, if it's missing here is an example of 
my conf.vars file.

	VERSION = 2
	PATCHLEVEL = 6
	SUBLEVEL = 13
	EXTRAVERSION =
	KPKG_SELECTED_MODULES =
	Debian Revision = 10.00.Custom
	KPGK_ARCH =
	do_parallel =
	fast_dep =
	
	
	Code:
	cd cloop-2.01
	make
	
# acá no dio este error con el kernel 2.6.13 por ahora...

With the 2.01-5 sources you may face this following compilation issue:
cc -I/usr/src/linux/include -I/usr/src/linux/include/asm/mach-default 
-D__KERNEL__ -DMODULE -fno-builtin -nostdlib -DKBUILD_MODNAME="cloop" 
-DKBUILD_BASENAME="cloop" compressed_loop.c -c -o compressed_loop.o
compressed_loop.c: In function `clo_read_actor':
compressed_loop.c:205: error: structure has no member named `buf'
compressed_loop.c: In function `clo_read_from_file':
compressed_loop.c:231: error: structure has no member named `buf'
make: *** [compressed_loop.o] Error 1
	
	
This is ok you just need to modify, funnily enough as the previous 
output says, lines 205 and 231 of compressed_loop.c from:

205: struct clo_read_data *p = (struct clo_read_data*)desc->buf;
231: desc.buf = (char*)&cd;
	
to

205: struct clo_read_data *p = (struct clo_read_data*)desc->arg.buf;
231: desc.arg.buf = (char*)&cd;
	
###
	
With that done cloop should compile just fine and resulting in a 
cloop.ko module in the current directory.

# Si, eso funcionó: cloop.ko existe! (kernel 2.6.13)

==UnionFS==

Now for unionfs, the latest version as of writing is version 1.0.14. The 
compilation requires ctags to be installed, so you'll have to apt-get 
install it if you haven't got it already. 
# tuve que instalar esto:
apt-get install ctags

Also the following example is compiling for 2.6.XX kernel.
	Code:

# yo hice: cd /usr/src/modules/unionfs-1.1.2 y no anduvo, entonces bajé 
esa versión 1.0.14 con apt-get
	cd ../unionfs-1.0.14
	make unionfs2.6
# yo lo terminé copiando acá:
/usr/src/modules/unionfs1-0-14/modules/unionfs# make unionfs2.6

#PERO dio muchos errores, así que bajé el source desde debian: otra 
versión:Des:1 http://ftp.debian.org unstable/main unionfs-source 
1.0.14-1 

Además al compilar se mete con el kernel actual: 2.6.13, así que tengo 
que reiniciar con el nuevo kernel sí o sí.

La versión 1.0.14 también dio errores (pero se compiló como módulo 
correctamente cuando compilé el 2.6.15.3-rt-musix 11-2-06):

/usr/src/modules/unionfs1-0-14/modules/unionfs/super.c: In function 
'unionfs_read_inode':
/usr/src/modules/unionfs1-0-14/modules/unionfs/super.c:52: error: 
'SPIN_LOCK_UNLOCKED' undeclared (first use in this function)
/usr/src/modules/unionfs1-0-14/modules/unionfs/super.c:52: error: (Each 
undeclared identifier is reported only once
/usr/src/modules/unionfs1-0-14/modules/unionfs/super.c:52: error: for 
each function it appears in.)
make[2]: *** [/usr/src/modules/unionfs1-0-14/modules/unionfs/super.o] 
Error 1
make[1]: *** [_module_/usr/src/modules/unionfs1-0-14/modules/unionfs] 
Error 2
make[1]: Leaving directory 
`/usr/src/kernel-headers-2.6.13-1-multimedia-386'
make: *** [unionfs2.6] Error 2

	
By default the compiled 2.6.XX cloop.ko modules is 5389704 bytes 
(~5.3MB), this is pretty big and won't always fit inside your initrd 
image. You can reduce the size by compiling without the debuging 
infomation or by running the strip command. To remove the debugging 
information you just need to modify one line in the Makefile from:

	UNIONFS_DEBUG_CFLAG = -g
	
	to
	UNIONFS_DEBUG_CFLAG =
	
	
A summary of the sizes using combination of no debug and stripped 
information, that I found, are shown below:
clean compile - 5389704 bytes (~5.3MB)
clean compile (stripped) - 2423568 bytes (~2.4MB)
no debug compile - 2440188 bytes (~2.4MB)
no debug compile (stripped) - 2423568 bytes (~2.4MB)
	
As you can see stripping will produce the smallest module, and either a 
clean or no debug compile will result in the same size. With that done 
you should now have a unionfs.ko to be used at a later stage.
	
At this point, it's your choice to leave the kernel source intact when 
building the compressed image, but be warned that it can take a large 
chunk of space. Now we've done the compressed filesystem, time to 
update the miniroot image.
	
=Miniroot image (minirt.gz)=

Just before we update the minirt.gz image, we need to update the linux 
kernel in the master directory. Just copy the new vmlinuz-2.X.YY to the 
master/boot/isolinux directory
	
If you don't need SCSI support or you don't need to boot from a SCSI 
CD-ROM, you can safely remove all the scsi modules. If you do so, be 
sure to comment out the 'SCSIMODULES=' section of linuxrc and replace 
it with SCSIMODULES="" so the script will skip SCSI autoprobing.
	
Now what I do is remove the current cloop.o and unionfs.o module from 
the modules directory. Then copy the newly compiled cloop.ko and 
unionfs.ko to the modules directory. Lastly a simply modification to 
linuxrc will see us load the newly named cloop.ko and unionfs.ko 
modules. Search for any reference to cloop.o (or cloop.*o) and change 
to cloop.ko. and similarly, search for unionfs.o (or unionfs.*o) and 
change to unionfs.ko.
	
That is it
	
Closing:

This HOWTO is in its infancy and will continue to evolve from any 
constructive feedback received. For now ... use it, abuse it, and let 
me know what you think.
	
=Experimentando pam modules=
Sitio:
 http://seite9.de/~burkhard/pam_debian_rlimits/
	
Instalación:
 dpkg -i /var/cache/apt/archives/libpam-modules_0.79-4_i386.deb
	
Preparando para reemplazar libpam-modules 0.76-22 
(usando ./libpam-modules_0.79-4_i386.deb) ...
Desempaquetando el reemplazo de libpam-modules ...
Configurando libpam-modules (0.79-4) ...
Instalando una nueva versión del fichero de 
configuración /etc/security/access.conf ...
Instalando una nueva versión del fichero de 
configuración /etc/security/pam_env.conf ...
	
Instalando una nueva versión del fichero de 
configuración /etc/security/limits.conf ...

---> Esto es lo que agregó allí:
	
	# limit realtime and memory locking access to users in the group audio
	# there is no way to say "allow locking all memory", 4G should be 
enough
	#
	*               -       rt_priority     0
	*               -       nice            0
	#
	@audio          -       rt_priority     100
	@audio          -       nice            -10
	@audio          -       memlock         4000000


NOTA: no sé si hay que hacer modprobe del módulo o qué cosa!	


-- 
Marcos Guglielmetti  
Coordinador del desarrollo de Musix GNU+Linux 
(www.musix.org.ar) 
Mirrors: (www.musix.distrux.net) (www.pc-musica.com.ar/musix) 
(www.k-maleon.com/musix)

	
	
		
___________________________________________________________ 
1GB gratis, Antivirus y Antispam 
Correo Yahoo!, el mejor correo web del mundo 
http://correo.yahoo.com.ar 






Más información sobre la lista de distribución Musix-Help