Results 1 to 5 of 5

Thread: 5.3.1 heavily remastered + 18 kernels (2.6.12-28)

  1. #1
    Junior Member registered user
    Join Date
    Jul 2006
    Posts
    14

    5.3.1 heavily remastered + 18 kernels (2.6.12-28)

    Hi peoples. I'm pretty close to finishing a 5.3.1 heavily remastered featuring 17 extra kernels besides the original 2.6.24.4. HAL working OK, all kernels working with aufs and cloop and ALSA 1.0.17 (hm, ALSA except 2.6.14 ), lots of packages added, lots of -dev packages also added, looks better anyway. Electronics stuff added, like some 8 different gEDA versions (compiled) and Xcircuit and lots of others, also Firefox 2 and 3, VLC 0.9.8 (compiled), peazip and p7zip, mplayer compiled and more.

    In this thread I created I intend to put everything I know and experimented: how to remaster a 5.3.1 starting from the original ISO, details about new kernel compilation, details and tricks about the scripts in knoppix (5.3.1) and where to change things if you want to make things work etc. etc. etc.

    My personal approach to remastering (at least for now) is to make it a direct competitor and efficient replacement of Windblows. So I will focus especially on a remaster with all the X features required for an easy to use graphical operating system.

    As I go on, I will probably edit this first post here and insert some table of contents, which will take you directly to what you're looking for

    Also I think it would be best if nobody else would post here, not for a while anyway, until I get the whole thing started properly. Well, of course this is at your choice, it's not a request but rather a preference.

    I'm starting with kernels, by giving example scripts and scripts that you can test directly under the Live Knoppix 5.3.1 DVD running on a machine with enough RAM for experimenting directly on the ramdisk.


    DISCLAIMER:

    THE FOLLOWING IS ONLY ADDRESSED TO LINUX BEGINNERS, THOSE WHO CANNOT EASILY FIND THEIR WAY AROUND LINUX.
    IF YOU ARE AN EXPERT, PLEASE DON'T LAUGH AT THIS POST. I WROTE ALL THE FOLLOWING SO THAT AS MANY PEOPLE AS POSSIBLE
    CAN UNDERSTAND WHAT I'M SAYING. IF YOU FIND THIS POST RETARDED, PLEASE CHANGE THE WEB ADDRESS OR WATCH SOME TV.
    I'M NOT A LINUX EXPERT MYSELF, THERE ARE HUNDREDS OF THINGS I WOULD LIKE TO HAVE TRIED AND GONE THROUGH, BUT...

    LIFE IS SHORT!!

  2. #2
    Junior Member registered user
    Join Date
    Jul 2006
    Posts
    14
    Ok, I'm back after a busy while, and this time I'm going to describe a few things I managed to do while tailoring knoppix to my preferences.

    I see there are people asking around about ways to compile / upgrade the kernel, so I'm going to write here everything I've done while adding new kernels to knoppix 5.3.1.

    First, I will describe in simple steps how can you compile a (new) kernel in the knoppix environment

    Compared to the general way of kernel compilation in Linux, doing this in knoppix is somewhat simplified, in that you don't have to do "make bzImage" and "make modules" anymore.
    Suppose we want to add kernel 2.6.12 to the existing 2.6.24.4 in Knoppix 5.3.1.

    Well, to do that, I used this particular script, ran under the original Knoppix 5.3.1 environment, in a chroot under a directory where I put the entire knoppix filesystem, uncompressed.
    All my remastering takes place under the original Knoppix 5.3.1 environment, that is under X.
    So, to be more clear: under the original Knoppix 5.3.1 environment, I mount the original knoppix ISO stored somewhere on my harddrive, I then mount those two big files KNOPPIX and KNOPPIX2 as cloop devices, and I copy their contents to a directory on a partition of my harddrive (let's say /mnt/hda2/KNOPPIX), then I open another konsole window where I chroot to the freshly copied filesystem (chroot /mnt/hda2/KNOPPIX), from there I mount the partition containing my remastering kit (remastering scripts + additional data files used, let's say /dev/hda4), I then change dir to the remastering kit and then I run this script:

    Code:
    #!/bin/sh
    
    odir=`pwd`
    
    cd /usr/bin
    rm -f gcc
    rm -f g++
    ln -s gcc-3.3 gcc
    ln -s g++-3.3 g++
    
    [ -d /lib/modules/2.6.12 ] && echo -en "\n\n---------------------------------------------------------------\nremoving /lib/modules/2.6.12 ..." && rm -rf /lib/modules/2.6.12 && echo "done."
    rm -rfv /boot/*2.6.12
    [ -d /usr/src/linux-2.6.12 ] && echo -n "removing /usr/src/linux-2.6.12 ..." && rm -rf /usr/src/linux-2.6.12 && echo "done."
    [ -d /usr/share/doc/linux-image-2.6.12 ] && echo -n "removing /usr/share/doc/linux-image-2.6.12 ..." && rm -rf /usr/share/doc/linux-image-2.6.12 && echo "done."
    [ -d /usr/src/modules/atl1-2.6.12 ] && echo -n "removing /usr/src/modules/atl1-2.6.12 ..." && rm -rf /usr/src/modules/atl1-2.6.12 && echo "done."
    [ -d /usr/src/modules/aufs-2.6.12 ] && echo -n "removing /usr/src/modules/aufs-2.6.12 ..." && rm -rf /usr/src/modules/aufs-2.6.12 && echo "done."
    [ -d /usr/src/modules/cloop-2.6.12 ] && echo -n "removing /usr/src/modules/cloop-2.6.12 ..." && rm -rf /usr/src/modules/cloop-2.6.12 && echo "done."
    
    echo -e "\n\n######################### COMPILING KERNEL 2.6.12 ################################\n\n"
    cd /usr/src
    echo "------------------------- extracting kernel ----------------------------"
    tar -xjf $odir/kernels/kernel.org/linux-2.6.12.tar.bz2
    echo "------------------------- changing /usr/src/linux link -----------------"
    rm -fv linux
    ln -sv linux-2.6.12 linux
    
    cd /usr/src/linux
    [ -f $odir/kernels/.config-2.6.12 ] || cp -fpv $odir/kernels/.config-k4.0.2 .config
    [ -f $odir/kernels/.config-2.6.12 ] && cp -fpv $odir/kernels/.config-2.6.12 .config
    
    ############################# KERNEL PATCHING #################################
    #patch -p1 </usr/src/modules/aufs-2.6.12/patch/deny_write_access.patch		## >= 2.6.17
    #sed -i -e "s/CONFIG_AUFS_DENY_WRITE_ACCESS_PATCH \=/CONFIG_AUFS_DENY_WRITE_ACCESS_PATCH = y/" /usr/src/modules/aufs-2.6.12/local.mk
    #patch -p0 </usr/src/modules/aufs-2.6.12/patch/put_filp.patch			      ## >= 2.6.19
    #sed -i -e "s/CONFIG_AUFS_PUT_FILP_PATCH \=/CONFIG_AUFS_PUT_FILP_PATCH = y/" /usr/src/modules/aufs-2.6.12/local.mk
    #patch -p1 </usr/src/modules/aufs-2.6.25/patch/sec_perm-2.6.24.patch		  ## >= 2.6.24
    #sed -i -e "s/CONFIG_AUFS_SEC_PERM_PATCH \=/CONFIG_AUFS_SEC_PERM_PATCH = y/" /usr/src/modules/aufs-2.6.25/local.mk
    #patch -p0 </usr/src/modules/aufs-2.6.25/patch/splice-2.6.23.patch		    ## >= 2.6.23
    #sed -i -e "s/CONFIG_AUFS_SPLICE_PATCH \=/CONFIG_AUFS_SPLICE_PATCH = y/" /usr/src/modules/aufs-2.6.25/local.mk
    #patch -p0 </usr/src/modules/aufs-2.6.25/patch/sysfs_get_dentry.patch
    
    #sed -i -e "s/CONFIG_AUFS_SYSAUFS \= y/CONFIG_AUFS_SYSAUFS =/" /usr/src/modules/aufs-2.6.25/local.mk	## <= 2.6.24
    #sed -i -e "s/CONFIG_AUFS_STAT \=/CONFIG_AUFS_STAT = y/" /usr/src/modules/aufs-2.6.25/local.mk		## >= 2.6.25
    #patch -p1 <../kernel-patches/knoppix-kernel.patch  ### USING sed INSTEAD
    sed -i -e "s/console_loglevel \= 4/console_loglevel = 1/" init/main.c
    ###############################################################################
    
    echo "------------------------ make menuconfig -------------------------------"
    [ -f $odir/kernels/.config-2.6.12 ] || make menuconfig
    cd ..
    make kernel
    #dpkg -i linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb
    dpkg-deb -x linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb /
    
    echo "------------------------- make atl1 ------------------------------------"
    cd modules
    unzip $odir/hardware/ASUS/net/lan_Linux_V11400.zip
    mv -fv lan atl1-2.6.12
    cd atl1-2.6.12/src
    sed -i -e "s/^BUILD_KERNEL\=.*$/BUILD_KERNEL=2.6.12/" Makefile
    make
    cd ../../..
    echo "------------------------- make cloop -----------------------------------"
    cd modules
    tar -xzf cloop-2.06.tar.gz
    mv -f cloop-2.06 cloop-2.6.12
    cd cloop-2.6.12
    make KERNEL_DIR=/usr/src/linux
    cd ../..
    echo "------------------------- extracting aufs ----------------------------"
    cd modules
    tar -xjf $odir/aufs-cvs_2007-02-10.tar.bz2
    mv aufs-2007-02-10 aufs-2.6.12
    cd aufs-2.6.12
    cp $odir/aufs-patch-2.6.11.patch .
    patch -p1 <aufs-patch-2.6.11.patch
    echo "------------------------- make aufs ------------------------------------"
    #make KDIR=/lib/modules/2.6.12/build -f local.mk kconfig
    make KDIR=/usr/src/linux -f local.mk
    
    mkdir /lib/modules/2.6.12/kernel/drivers/net/atl1
    cp -fpv /usr/src/modules/atl1-2.6.12/src/atl1.ko /lib/modules/2.6.12/kernel/drivers/net/atl1/
    cp -fpv /usr/src/modules/atl1-2.6.12/src/atl1.ko $odir/dvd/KNOPPIX/modules/2.6.12/
    cp -fpv /usr/src/modules/cloop-2.6.12/cloop.ko $odir/dvd/KNOPPIX/modules/2.6.12/
    cp -fpv /usr/src/modules/aufs-2.6.12/fs/aufs/aufs.ko $odir/dvd/KNOPPIX/modules/2.6.12/
    cd ..
    
    depmod -a 2.6.12
    Now I will explain every line of this script:

    Code:
    odir=`pwd`
    This creates a variable named "odir" containing the current directory at the beginning. This directory contains (along with this script) others subdirectories where I keep files used by this script. The directories used in this particular script are:

    kernels/ ___________this contains the kernels configurations for all new kernels, which configurations I created manually for each kernel.
    kernels/kernel.org/ ___this contains the kernels downloaded from kernel.org, as tar.bz2 archives
    hardware/ _________this contains drivers for various hardware I have, including ALSA drivers archives downloaded from the ALSA site
    dvd/ ______________this contains the exact file structure of the original Knoppix 5.3.1 DVD, EXCEPT FOR the compressed filesystem (that is files KNOPPIX/KNOPPIX and KNOPPIX/KNOPPIX2)

    Next:

    Code:
    cd /usr/bin
    rm -f gcc
    rm -f g++
    ln -s gcc-3.3 gcc
    ln -s g++-3.3 g++
    What this does is it changes the symbolic link "gcc" in /usr/bin to point to the gcc version 3.3.

    Why? Because the kernel evolved in time, and so did the C compiler. Older kernels are supposed to be compiled with some C compiler of the same age, that is older compilers, or at least that's my approach. For my remaster I used gcc 3.3 to compile kernels 2.6.12 to 2.6.19, and gcc 4.0 to compile kernels 2.6.20 to 2.6.28. Don't ask how I came to this conclusion, I just felt like I needed to do it this way. That does not mean you are not free to use whatever compiler you wish. Only one thing I want to make clear here: When you compile a kernel, you have to use the same compiler to compile extra modules for it. For instance, if you compile kernel 2.6.12 with gcc-3.3, and you also want to compile (some newer) ALSA drivers for this kernel, you have to use the same gcc-3.3 for ALSA

    Next:

    Code:
    [ -d /lib/modules/2.6.12 ] && echo -en "\n\n---------------------------------------------------------------\nremoving /lib/modules/2.6.12 ..." && rm -rf /lib/modules/2.6.12 && echo "done."
    rm -rfv /boot/*2.6.12
    [ -d /usr/src/linux-2.6.12 ] && echo -n "removing /usr/src/linux-2.6.12 ..." && rm -rf /usr/src/linux-2.6.12 && echo "done."
    [ -d /usr/share/doc/linux-image-2.6.12 ] && echo -n "removing /usr/share/doc/linux-image-2.6.12 ..." && rm -rf /usr/share/doc/linux-image-2.6.12 && echo "done."
    [ -d /usr/src/modules/atl1-2.6.12 ] && echo -n "removing /usr/src/modules/atl1-2.6.12 ..." && rm -rf /usr/src/modules/atl1-2.6.12 && echo "done."
    [ -d /usr/src/modules/aufs-2.6.12 ] && echo -n "removing /usr/src/modules/aufs-2.6.12 ..." && rm -rf /usr/src/modules/aufs-2.6.12 && echo "done."
    [ -d /usr/src/modules/cloop-2.6.12 ] && echo -n "removing /usr/src/modules/cloop-2.6.12 ..." && rm -rf /usr/src/modules/cloop-2.6.12 && echo "done."
    What this does is, in case I run this script twice or more times, it deletes 2.6.12 kernel files left from previous compilation attempts. This is not really necessary when I have everything working OK, after the script is thoroughly tested and proved to do exactly what it supposed to. But since I used this code in the beginning, I just left it here uncommented.
    So, the files that have to be deleted are: the directory /lib/modules/2.6.12 containing kernel modules, the directory /usr/src/linux-2.6.12 containing the kernel sources (unpacked from the tar.bz2 downloaded from kernel.org), the directory /usr/share/doc/linux-image-2.6.12 (part of the installed kernel 2.6.12), the directory /usr/src/modules/atl1-2.6.12 (this is where I unpack the driver source for my particular network interface, which is not contained in the kernel since the kernel is much older than the hardware), the directory /usr/src/modules/aufs-2.6.12 which contains the sources for the aufs module used with this particular kernel, and the directory /usr/src/modules/cloop-2.6.12 which contains the sources for the cloop module used with this particular kernel.

    Next:

    Code:
    echo -e "\n\n######################### COMPILING KERNEL 2.6.12 ################################\n\n"
    cd /usr/src
    echo "------------------------- extracting kernel ----------------------------"
    tar -xjf $odir/kernels/kernel.org/linux-2.6.12.tar.bz2
    echo "------------------------- changing /usr/src/linux link -----------------"
    rm -fv linux
    ln -sv linux-2.6.12 linux
    
    cd /usr/src/linux
    [ -f $odir/kernels/.config-2.6.12 ] || cp -fpv $odir/kernels/.config-k4.0.2 .config
    [ -f $odir/kernels/.config-2.6.12 ] && cp -fpv $odir/kernels/.config-2.6.12 .config
    Here, I change dir to /usr/src, I extract the kernel sources for 2.6.12 from $odir/kernels/kernel.org/linux-2.6.12.tar.bz2, thus creating a new subdirectory named "2.6.12" under "/usr/src" and then I change the symbolic link "linux" found in "/usr/src", so that it points to "2.6.12".

    #----------------------------------------------------------------#
    For those who don't know yet, /usr/src/linux is always a link pointing to the current kernel sources, in this case 2.6.12.
    Why?, because it's a general rule expected to be true by many other programs, so I keep it true.

    Another thing is, you probably notice that instead of simply commenting my actions in the script, I actually print them on the console with "echo". That shoots two birds with one bullet: I see the comment when I read and check my script, and I also see the comment in the compilation log left in the konsole window.
    #-----------------------------------------------------------------#

    Then I cd into the freshly unpacked kernel sources. Here, I copy the kernel configuration file. If I do not already have a custom configuration file that suits my preferences, I start from the kernel configuration copied from Knoppix 4.0.2, which happens to use the same kernel, 2.6.12. It's a starting point anyway better than kernel 2.6.24.4 which comes with knoppix 5.3.1.

    #-----------------------------------------------------------------#
    As a comment, I will say here that when you unpack a kernel and start configuring it (with "make menuconfig" for instance) the configuration script will try and find a default kernel configuration file in the system. If it doesn't find a file named ".config" in the root of the kernel source being compiled, it will look for one in the directory "/boot". This directory contains the configuration file for the kernel currently running, which in our case is 2.6.24.4.
    Now this kernel being much newer than 2.6.12, when the configuration script (for 2.6.12) tries to import the configuration (for 2.6.24.4) it will complain about attempts to import unknown variables, which is normal, since newer kernels have more and newer config variables (newer drivers, newer features etc.). Also it is possible that some of the config variables for 2.6.12 do not exist anymore in 2.6.24.4, so they will not be imported in 2.6.12, which means more manual work to do for 2.6.12 at configuration time.

    Anyway, the idea is I'm using the config from knoppix 4.0.2 as a starting point for my 2.6.12 kernel.
    I do "make menuconfig", I go through all menus checking what I want in my 2.6.12 kernel and what not, then I save this configuration, then I start compiling the kernel. I watch the whole process and check for error messages for different drivers/features. If I see some error while compiling a particular driver in the kernel, I start configuring 2.6.12 again, making sure I disable that pesky driver. And so on, until I get a compilation log as clean as possible. When I'm satisfied with my compilation log, I save that kernel configuration as ".config-2.6.12" in the $odir/kernels/ directory I previously mentioned
    #-----------------------------------------------------------------#

    So, if I already have the final config file for my 2.6.12 kernel (in other words, the file $odir/kernels/.config-2.6.12 exists), then I copy this file to my 2.6.12 source tree.
    If I don't have a final configuration according to my preferences (in other words, the file $odir/kernels/.config-2.6.12 does not exist) then I copy the file $odir/kernels/.config-k4.0.2 to my 2.6.12 source tree. Notice that the file is being copied as ".config" in both cases.

    Next:

    Code:
    ############################# KERNEL PATCHING #################################
    #patch -p1 </usr/src/modules/aufs-2.6.12/patch/deny_write_access.patch		## >= 2.6.17
    #sed -i -e "s/CONFIG_AUFS_DENY_WRITE_ACCESS_PATCH \=/CONFIG_AUFS_DENY_WRITE_ACCESS_PATCH = y/" /usr/src/modules/aufs-2.6.12/local.mk
    #patch -p0 </usr/src/modules/aufs-2.6.12/patch/put_filp.patch			## >= 2.6.19
    #sed -i -e "s/CONFIG_AUFS_PUT_FILP_PATCH \=/CONFIG_AUFS_PUT_FILP_PATCH = y/" /usr/src/modules/aufs-2.6.12/local.mk
    #patch -p1 </usr/src/modules/aufs-2.6.25/patch/sec_perm-2.6.24.patch		## >= 2.6.24
    #sed -i -e "s/CONFIG_AUFS_SEC_PERM_PATCH \=/CONFIG_AUFS_SEC_PERM_PATCH = y/" /usr/src/modules/aufs-2.6.25/local.mk
    #patch -p0 </usr/src/modules/aufs-2.6.25/patch/splice-2.6.23.patch		## >= 2.6.23
    #sed -i -e "s/CONFIG_AUFS_SPLICE_PATCH \=/CONFIG_AUFS_SPLICE_PATCH = y/" /usr/src/modules/aufs-2.6.25/local.mk
    #patch -p0 </usr/src/modules/aufs-2.6.25/patch/sysfs_get_dentry.patch
    
    #sed -i -e "s/CONFIG_AUFS_SYSAUFS \= y/CONFIG_AUFS_SYSAUFS =/" /usr/src/modules/aufs-2.6.25/local.mk	## <= 2.6.24
    #sed -i -e "s/CONFIG_AUFS_STAT \=/CONFIG_AUFS_STAT = y/" /usr/src/modules/aufs-2.6.25/local.mk		## >= 2.6.25
    #patch -p1 <../kernel-patches/knoppix-kernel.patch  ### USING sed INSTEAD
    sed -i -e "s/console_loglevel \= 4/console_loglevel = 1/" init/main.c
    ###############################################################################
    This section of the script takes care of the required kernel patching in order for the aufs module to actually get compiled and work with kernel 2.6.12.

    After each patch I put in a comment the kernel versions that require that patch. For instance the "deny_write_access.patch" is only required for kernels starting with 2.6.17

    So since for this particular kernel (2.6.12) no patch is required, I just commented out all patches. The only patch I use is the kernel log level patch aka the knoppix kernel patch, which changes the kernel log level from 4 to 1, and I actually do this patch using the "sed" command instead of patching with a "patch" command.

    #-----------------------------------------------------------------#
    NOTE: you probably noticed that this section is in the wrong place. It should be AFTER the aufs source code is unpacked. What happened is that I moved the code that unpacks the aufs source towards the end of the script, because no patch is actually required anyway and I wanted to have all the code pertaining to aufs in one single place.
    Historically speaking, I started experimenting with kernels from 2.6.20 downwards until I got to 2.6.12.
    #-----------------------------------------------------------------#

    Next:

    Code:
    echo "------------------------ make menuconfig -------------------------------"
    [ -f $odir/kernels/.config-2.6.12 ] || make menuconfig
    cd ..
    make kernel
    #dpkg -i linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb
    dpkg-deb -x linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb /
    OK, so what happens here is that IF I already have the final 2.6.12 kernel configuration file ($odir/kernels/.config-2.6.12), I DO NOT RUN "make menuconfig" anymore, because there is no point in doing that. I just proceed with the kernel compilation since I already know the compilation will be successfull and with minimum warnings.
    IF I don't already have the final 2.6.12 configuration, that means I'm using the configuration taken from knoppix 4.0.2, so further adjustments are necessary, so I run "make menuconfig".
    Next, I'm exiting the kernel source directory (/usr/src/linux, or /usr/src/linux-2.6.12) and go to the parent dir, that is /usr/src
    Now comes the nice part: thanks to Mr. Klaus Knopper's great work, the kernel compilation is being done by one single command, "make kernel", ran from the "/usr/src" directory. That's because there is a "Makefile" file in this directory, that takes care of everything including the creation of a debian package with the custom kernel being compiled. You will have this debian package in "/usr/src" afterwards. All you have to do next is to install it.
    And what I actually do is, instead of installing the package (with "dpkg -i") I just unpack it (with "dpkg-deb -x") like any regular archive into the root of the chrooted environment. Why? Because the debian package has some postinstall script that tries to do some things after unpacking the kernel, like trying to mess with the LILO setup, which is useless since this is a live CD/DVD and we don't need any LILO.
    All I have to do after simply unpacking the kernel is to run "depmod -a 2.6.12" at the end of remastering, to make sure that all kernel modules for 2.6.12 have the correct dependency.

    Next:

    Code:
    echo "------------------------- make atl1 ------------------------------------"
    cd modules
    unzip $odir/hardware/ASUS/net/lan_Linux_V11400.zip
    mv -fv lan atl1-2.6.12
    cd atl1-2.6.12/src
    sed -i -e "s/^BUILD_KERNEL\=.*$/BUILD_KERNEL=2.6.12/" Makefile
    make
    cd ../../..
    Here I compile the network driver for my particular network interface. There's not much to comment here, except that I unpack the driver sources in the "/usr/src/modules" directory, in a separate subdir called "atl1-2.6.12" and before compiling I make a little change in the Makefile. After compiling the driver, I exit back to the "/usr/src" directory

    Next:

    Code:
    echo "------------------------- make cloop -----------------------------------"
    cd modules
    tar -xzf cloop-2.06.tar.gz
    mv -f cloop-2.06 cloop-2.6.12
    cd cloop-2.6.12
    make KERNEL_DIR=/usr/src/linux
    cd ../..
    Here I cd into "/usr/src/modules", I unpack the cloop module sources, from the file "cloop-2.06.tar.gz" that came with knoppix, into a separate subdirectory called "cloop-2.6.12", within "/usr/src/modules".
    Then I compile the module according to the instructions, running "make KERNEL_DIR=/usr/src/linux". Once again I say, "/usr/src/linux" is a symbolic link now pointing to "/usr/src/linux-2.6.12"
    After all is done, I exit back to "/usr/src"

    Next:

    Code:
    echo "------------------------- extracting aufs ----------------------------"
    cd modules
    tar -xjf $odir/aufs-cvs_2007-02-10.tar.bz2
    mv aufs-2007-02-10 aufs-2.6.12
    cd aufs-2.6.12
    cp $odir/aufs-patch-2.6.11.patch .
    patch -p1 <aufs-patch-2.6.11.patch
    What happens here is that I cd into "/usr/src/modules", I unpack the aufs module sources into a separate directory called "aufs-2.6.12" which I then enter, and there I copy a patch for aufs that makes it work with kernel 2.6.12. Then I apply the patch to the aufs source

    Next:

    Code:
    echo "------------------------- make aufs ------------------------------------"
    #make KDIR=/lib/modules/2.6.12/build -f local.mk kconfig
    make KDIR=/usr/src/linux -f local.mk
    Here, I just compile the aufs module, according to the instructions, as an external module, using the command "make KDIR=/usr/src/linux -f local.mk". The command before it that I commented out is used when you wish to have the module embedded into the kernel, which I'm not interested in, so you just ignore that line.

    Next:

    Code:
    mkdir /lib/modules/2.6.12/kernel/drivers/net/atl1
    cp -fpv /usr/src/modules/atl1-2.6.12/src/atl1.ko /lib/modules/2.6.12/kernel/drivers/net/atl1/
    cp -fpv /usr/src/modules/atl1-2.6.12/src/atl1.ko $odir/dvd/KNOPPIX/modules/2.6.12/
    cp -fpv /usr/src/modules/cloop-2.6.12/cloop.ko $odir/dvd/KNOPPIX/modules/2.6.12/
    cp -fpv /usr/src/modules/aufs-2.6.12/fs/aufs/aufs.ko $odir/dvd/KNOPPIX/modules/2.6.12/
    cd ..
    
    depmod -a 2.6.12
    OK, we're finally at the end of the script. What happens here is this: I create a separate directory for my network module (/lib/modules/2.6.12/kernel/drivers/net/atl1) where I copy the module I previously compiled. The module name is atl1.ko. I also copy this module to my remastering package in case I need it later. Then I also copy the aufs and cloop modules to my remastering package. The aufs and cloop modules are used as external modules, they are loaded when knoppix is booted, from the linuxrc script. On the original Knoppix DVD these two modules are placed in the "KNOPPIX/modules" directory. What I did is, I kept the original modules that came with Knoppix and I created separate subdirectories "2.6.12", "2.6.13", "2.6.14", ..... "2.6.28" for my extra kernels, inside this "KNOPPIX/modules" directory on the DVD. In these directories I then copied the cloop and aufs modules I use for my extra kernels.

    OK folks, there's more to this episode ("The 2.6.12 episode"), but I have to take a break here, it's almost one hour after midnight and I have to kinda go to bed or something. But I'll be back soon with the rest of this episode. Thank God it's been Friday night, otherwise I wouldn't have so much time to write all this

  3. #3
    Junior Member registered user
    Join Date
    Jul 2006
    Posts
    14
    OK, I'm back, and as I write I'm testing a script I assembled from my actual separate scripts I use for remastering.

    What this script does is it downloads a proper version of aufs from the repository, it also downloads the 2.6.12 kernel from kernel.org and then starts compiling the kernel along with the aufs and cloop modules and after that it creates a minirt.gz for use with this kernel (and KNOPPIX 5.3.1 of course).

    This has just an instructional/educational purpose, at least for now, because even with the kernel compiled along with the modules, we still have to install the kernel in the KNOPPIX filesystem. That means the compressed filesystem has to be unpacked, chrooted into and the 2.6.12 kernel installed in it.

    But whatever, I just want to show a script that does all the kernel stuff starting from as little as possible, using 2.6.12 as an example.

    REQUIREMENTS:

    - A computer with 2GB RAM
    - The KNOPPIX 5.3.1 DVD
    - The "2.6.12-knoppix-kernel-compiler-installer" script
    - The ".config-2.6.12" file (kernel configuration for 2.6.12)
    - The "aufs-patch-2.6.11.patch" file (aufs patch to make it work with 2.6.12 kernel)
    - The "linuxrc" file (a script which is included in minirt.gz; this is modified by me in a few places)

    So basically what you need is my script and three additional files. I posted all these four below as code.
    You just have to save these four code sections with the names indicated above, make the "2.6.12-knoppix-kernel-compiler-installer" script executable and run it.
    That's it.

    === EXTREMELY IMPORTANT !!!!!! ===
    You will have to use your mouse and copy the code posted below. When doing this, please enlarge your web browser's window as much as possible until you see NO LINE in the script reaching the right margin of the window code. If you don't do that, some lines in the script being very long, they will be split on two rows and the code will not work.
    You might want to use Iceweasel as browser for this (comes with Knoppix 5.3.1) and use the "Ctrl -" key combination (that is CTRL and the "minus" key on the numeric keypad) to make the fonts smaller so all the lines can fit your screen in one piece.
    Scroll up and down and make sure you see NO LINE in the code reaching the right margin. After that, position your mouse cursor at the beginning of the code and keeping the left button pressed drag down until you select all the code. Then press Ctrl-C.
    ================================

    Now, for those really unfamiliar with Linux in general, I will give some detailed instructions:
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    What you have to do:
    ==================
    - Start your computer with KNOPPIX 5.3.1 DVD
    - Open a konsole window (it's on the taskbar on the left)
    - Change the font for the konsole (from the menu, Settings -> Font -> Shrink Font, a few times until the font gets smaller)
    - Change to root (type "su" and Enter)
    - Run mc (Midnight Commander)
    - From mc, create in /home/knoppix a directory with whatever name you want, let's say "kernel-test"
    - cd into the directory you just created
    - Press the "Shift+F4" key combination (this will start editing a new file)
    - Press F9, the menu will show up, go to Options -> General and make sure the option for "Return Does Autoindent" is NOT CHECKED
    - Click, drag, select and copy (Ctrl+C) the first code in this post as instructed previously.
    - Go back to the konsole window in mc and press "Shift+Insert". This will paste the code in mc.
    - Press F2 to save the code and give it the name "2.6.12-knoppix-kernel-compiler-installer"
    - Make this script executable: type "chmod 755 2.6.12-knoppix-kernel-compiler-installer" at the command prompt in mc and then Enter
    - Click, drag, select and copy (Ctrl+C) the second code in this post as instructed previously.
    - Go back to the konsole window in mc and press "Shift+F4" again
    - Press "Shift+Insert". This will paste the code in mc.
    - Press F2 to save the code and give it the name ".config-2.6.12" (PAY ATTENTION, THE NAME STARTS WITH A DOT ".")
    - Click, drag, select and copy (Ctrl+C) the third code in this post as instructed previously.
    - Go back to the konsole window in mc and press "Shift+F4" again
    - Press "Shift+Insert". This will paste the code in mc.
    - Press F2 to save the code and give it the name "aufs-patch-2.6.11.patch"
    - Click, drag, select and copy (Ctrl+C) the fourth code in this post as instructed previously.
    - Go back to the konsole window in mc and press "Shift+F4" again
    - Press "Shift+Insert". This will paste the code in mc.
    - Press F2 to save the code and give it the name "linuxrc"
    - Got to the konsole window menu, Settings -> History and set History to Unlimited. This way you will have the full log at the end to look through it if you want.
    - Make sure these four files are in the same directory (the one you created, i.e. "kernel-test") and then just press Enter from mc on the script (2.6.12-knoppix-kernel-compiler-installer)
    - Now relax and wait for it to finish
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    When all is done, you will notice some changes in the directory where you saved the files in the beginning.

    A few new files appeared:

    - "dvd/boot/isolinux/minirt-2.6.12.gz" and "dvd/boot/isolinux/vmlinuz-2.6.12" should be placed on the DVD, in the "dvd/boot/isolinux/" directory
    - the "dvd/KNOPPIX/modules/2.6.12" directory should be copied on the DVD in the "dvd/KNOPPIX/modules/"
    - the "kernels/linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb" file is a debian package containing the 2.6.12 kernel. This should be installed in the KNOPPIX filesystem. That means uncompressing the filesystem somewhere on the harddrive, chrooting into it, and installing the package with "dpkg -i linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb"
    - the "kernels/loop-aes-modules-2.6.12_3.2b-5_i386.deb" is a debian package containing the loop-aes module. Should be installed the same way as the kernel package.
    - For everything to work, there should be a few lines added to the "isolinux.cfg" on the dvd:

    Code:
    LABEL linux-2.6.12
    KERNEL vmlinuz-2.6.12
    APPEND ramdisk=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt-2.6.12.gz nomce noudev acpi=off dma noeject noprompt quiet BOOT_IMAGE=knoppix
    ============= The first code: save this as "2.6.12-knoppix-kernel-compiler-installer"

    Code:
    #!/bin/sh
    
    
    [ ! -f ".config-2.6.12" ] && echo "2.6.12 kernel config is missing... exiting." && exit 0
    [ ! -f "aufs-patch-2.6.11.patch" ] && echo "aufs patch is missing... exiting" && exit 0
    odir=`pwd`
    mkdir -pv dvd/KNOPPIX/modules/2.6.12 dvd/boot/isolinux system_scripts/2.6.12-19
    mkdir -pv kernels/kernel.org
    mv -f .config-2.6.12 kernels/
    chmod 755 linuxrc
    mv -f linuxrc system_scripts/2.6.12-19/
    day="20070312"
    cvs -d:pserver:anonymous@aufs.cvs.sourceforge.net:/cvsroot/aufs login <<<$(echo -en "\n")
    echo -en "\n\n===================================== Retrieving aufs $day      =====================================\n\n"
    cvs -z3 -d:pserver:anonymous@aufs.cvs.sourceforge.net:/cvsroot/aufs co -D "$day" aufs
    mv aufs aufs-$day
    tar -cf aufs-$day.tar aufs-$day
    bzip2 -9 aufs-$day.tar
    rm -rf aufs-$day
    cd kernels/kernel.org
    echo -en "\n\n===================================== Downloading 2.6.12 kernel =====================================\n\n"
    dload="err"
    while [ "$dload" = "err" ]; do
    	rm -f linux-2.6.12.tar.bz2
    	wget http://www.kernel.org/pub/linux/kern...2.6.12.tar.bz2 && dload="ok"
    done
    
    cd /usr/bin
    rm -f gcc
    rm -f g++
    ln -s gcc-3.3 gcc
    ln -s g++-3.3 g++
    echo -en "\n\n===================================== Removing possible 2.6.12 kernel existing files ================\n\n"
    [ -d /lib/modules/2.6.12 ] && echo -en "\n\n------------------------\nremoving /lib/modules/2.6.12 ..." && rm -rf /lib/modules/2.6.12 && echo "done."
    rm -rfv /boot/*2.6.12
    [ -d /usr/src/linux-2.6.12 ] && echo -n "removing /usr/src/linux-2.6.12 ..." && rm -rf /usr/src/linux-2.6.12 && echo "done."
    [ -d /usr/share/doc/linux-image-2.6.12 ] && echo -n "removing /usr/share/doc/linux-image-2.6.12 ..." && rm -rf /usr/share/doc/linux-image-2.6.12 && echo "done."
    [ -d /usr/src/modules/aufs-2.6.12 ] && echo -n "removing /usr/src/modules/aufs-2.6.12 ..." && rm -rf /usr/src/modules/aufs-2.6.12 && echo "done."
    [ -d /usr/src/modules/cloop-2.6.12 ] && echo -n "removing /usr/src/modules/cloop-2.6.12 ..." && rm -rf /usr/src/modules/cloop-2.6.12 && echo "done."
    
    echo -e "\n\n######################### COMPILING KERNEL 2.6.12  ################################\n\n"
    cd /usr/src
    echo "------------------------- extracting kernel ----------------------------"
    tar -xjf $odir/kernels/kernel.org/linux-2.6.12.tar.bz2
    echo "------------------------- changing /usr/src/linux link -----------------"
    rm -fv linux
    ln -sv linux-2.6.12 linux
    
    cd /usr/src/linux
    [ -f $odir/kernels/.config-2.6.12 ] || cp -fpv $odir/kernels/.config-k4.0.2 .config
    [ -f $odir/kernels/.config-2.6.12 ] && cp -fpv $odir/kernels/.config-2.6.12 .config
    
    ############################# KERNEL PATCHING #################################
    #patch -p1 </usr/src/modules/aufs-2.6.12/patch/deny_write_access.patch          ## >= 2.6.17
    #sed -i -e "s/CONFIG_AUFS_DENY_WRITE_ACCESS_PATCH \=/CONFIG_AUFS_DENY_WRITE_ACCESS_PATCH = y/" /usr/src/modules/aufs-2.6.12/local.mk
    #patch -p0 </usr/src/modules/aufs-2.6.12/patch/put_filp.patch                   ## >= 2.6.19
    #sed -i -e "s/CONFIG_AUFS_PUT_FILP_PATCH \=/CONFIG_AUFS_PUT_FILP_PATCH = y/" /usr/src/modules/aufs-2.6.12/local.mk
    #patch -p1 </usr/src/modules/aufs-2.6.25/patch/sec_perm-2.6.24.patch            ## >= 2.6.24
    #sed -i -e "s/CONFIG_AUFS_SEC_PERM_PATCH \=/CONFIG_AUFS_SEC_PERM_PATCH = y/" /usr/src/modules/aufs-2.6.25/local.mk
    #patch -p0 </usr/src/modules/aufs-2.6.25/patch/splice-2.6.23.patch              ## >= 2.6.23
    #sed -i -e "s/CONFIG_AUFS_SPLICE_PATCH \=/CONFIG_AUFS_SPLICE_PATCH = y/" /usr/src/modules/aufs-2.6.25/local.mk
    #patch -p0 </usr/src/modules/aufs-2.6.25/patch/sysfs_get_dentry.patch
    
    #sed -i -e "s/CONFIG_AUFS_SYSAUFS \= y/CONFIG_AUFS_SYSAUFS =/" /usr/src/modules/aufs-2.6.25/local.mk    ## <= 2.6.24
    #sed -i -e "s/CONFIG_AUFS_STAT \=/CONFIG_AUFS_STAT = y/" /usr/src/modules/aufs-2.6.25/local.mk          ## >= 2.6.25
    #patch -p1 <../kernel-patches/knoppix-kernel.patch  ### USING sed INSTEAD
    sed -i -e "s/console_loglevel \= 4/console_loglevel = 1/" init/main.c
    ###############################################################################
    
    echo "------------------------ make menuconfig -------------------------------"
    [ -f $odir/kernels/.config-2.6.12 ] || make menuconfig
    cd ..
    make kernel
    #dpkg -i linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb
    dpkg-deb -x linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb /
    mv -f linux-image-2.6.12_2.6.12-10.00.Custom_i386.deb $odir/kernels/
    
    echo "------------------------ make loop-aes ---------------------------------"
    make loop-aes
    dpkg -i modules/loop-aes-modules-2.6.12_3.2b-5_i386.deb
    mv -f modules/loop-aes-modules-2.6.12_3.2b-5_i386.deb $odir/kernels/
    
    echo "------------------------- make cloop -----------------------------------"
    cd modules
    tar -xzf cloop-2.06.tar.gz
    mv -f cloop-2.06 cloop-2.6.12
    cd cloop-2.6.12
    make KERNEL_DIR=/usr/src/linux
    cd ../..
    
    echo "------------------------- extracting aufs ------------------------------"
    cd modules
    tar -xjf $odir/aufs-$day.tar.bz2
    mv aufs-$day aufs-2.6.12
    cd aufs-2.6.12
    cp $odir/aufs-patch-2.6.11.patch .
    patch -p1 <aufs-patch-2.6.11.patch
    
    echo "------------------------- make aufs ------------------------------------"
    make KDIR=/usr/src/linux -f local.mk
    
    cp -fpv /usr/src/modules/cloop-2.6.12/cloop.ko $odir/dvd/KNOPPIX/modules/2.6.12/
    cp -fpv /usr/src/modules/aufs-2.6.12/fs/aufs/aufs.ko $odir/dvd/KNOPPIX/modules/2.6.12/
    cd ..
    
    depmod -a 2.6.12
    
    ###############################################################################################
    
    minirtgz_modules_search_replace(){
    
    # Parameters to this script:
    # $1: kernel version (ex. 2.6.12)
    # $2: (optional) directory with filesystem root (where kernel is installed) (ex. /mnt/hda2/KNOPPIX)
    # If $2 not given, / will be used
    
    # This script is meant to be used when changing the minirt.gz for a remaster.
    # After running the minirt.gz-cpio-edit, go to the unpacked minirt in the modules/ dir
    #   and from there run this script (previously copied to /usr/local/bin)
    #   giving as parameter the version of the kernel you are making this minirt.gz for.
    #
    # Ex.:  >  minirt.gz-modules-search-replace 2.6.25
    #
    # The result will be replacing all modules in the modules/ dir with their equivalent
    # found in the /mnt/hda2/KNOPPIX/lib/modules/2.6.25/kernel/drivers dir. If any module
    # is left unreplaced, it can be safely erased from the modules/ dir.
    
    for j in *.ko; do
            src=$(find $2/lib/modules/$1/kernel/drivers -type f -name $j)
            [ -n "$src" ] && cp -fpv $src .
    done
    
    # The next operation is necessary if USB support is not built-in kernel
    
    for j in usbcore.ko ehci-hcd.ko ohci-hcd.ko uhci-hcd.ko libusual.ko ff-memless.ko usbhid.ko usb-storage.ko ub.ko; do
            src=$(find $2/lib/modules/$1/kernel/drivers -type f -name $j)
            [ -n "$src" ] && cp -fpv $src .
    done
    
    }
    
    ###############################################################################################
    
    # This script generates the necessary minirt-2.6.xx.gz files in initrd format
    # for all kernels enumerated below.
    # The files are then copied into dvd/KNOPPIX/boot/isolinux
    # along with the vmlinuz-2.6.xx files.
    # This script is indended to be run under the original Knoppix 5.3.1 environment
    
    #odir=`pwd`
    kernels="12"
    workdir="/home/knoppix/tmp"
    rootdir="new-root"
    remaster_root=""
    
    [ -d $workdir/$rootdir ] || mkdir -pv $workdir/$rootdir
    
    
    cp -fpv /cdrom/boot/isolinux/minirt.gz $workdir/
    gunzip $workdir/minirt.gz
    
    
    for i in $kernels; do
    
        echo -en "\n\n====================== PROCESSING INITRD FOR 2.6.$i =======================\n\n"
        dd if=/dev/zero of=$workdir/minirt-2.6.$i bs=1M count=10
        losetup /dev/loop3 $workdir/minirt-2.6.$i
        mke2fs /dev/loop3
        mount -o rw /dev/loop3 $workdir/$rootdir
        cd $workdir/$rootdir
    
        #cpio -imvd --no-absolute-filenames -I ../tmp/minirt
        cpio -i -d -H newc -F $workdir/minirt --no-absolute-filenames
        cd modules
        minirtgz_modules_search_replace 2.6.$i ${remaster_root}
        cp -fpv $odir/dvd/KNOPPIX/modules/2.6.$i/aufs.ko .
        find . -perm /111 -a -name "*.ko" -exec rm -fv '{}' ';'
        cd ..
        [ $i -lt 20 ] && cp -fpv $odir/system_scripts/2.6.12-19/linuxrc .
        [ $i -gt 19 ] && cp -fpv $odir/system_scripts/linuxrc .
        cd ..
    
        umount /dev/loop3
        losetup -d /dev/loop3
        gzip -9 minirt-2.6.$i
        cp -fpv minirt-2.6.$i.gz $odir/dvd/boot/isolinux/
    
        cp -fpv ${remaster_root}/boot/vmlinuz-2.6.$i $odir/dvd/boot/isolinux/
    
    done
    
    rm -rfv $workdir/*
    ============= Next, copy this code and save it as ".config-2.6.12"

    Code:
    SORRY FOLKS, WHEN I TRIED TO POST THE KERNEL CONFIG, THE FORUM DID NOT TAKE IT ALL, THERE WAS SOME ERROR.
    
    MAYBE WE'RE NOT SUPPOSED TO POST CODES THAT BIG ?...
    ============= Next, copy this code and save it as "aufs-patch-2.6.11.patch":

    Code:
    diff -up -r aufs-20070327/fs/aufs/aufs.h aufs-20070327-new/fs/aufs/aufs.h
    --- aufs-20070327/fs/aufs/aufs.h        2007-03-27 23:41:11.000000000 +0200
    +++ aufs-20070327-new/fs/aufs/aufs.h    2007-03-28 18:21:04.694373683 +0200
    @@ -22,11 +22,19 @@
     #define __AUFS_H__
    
     #include <linux/version.h>
    +#include <linux/types.h>    /* for size_t */
    
     /* ---------------------------------------------------------------------- */
    
    -// limited support before 2.6.16, curretly 2.6.15 only.
    -#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,15)
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
    +#    define LOCK_INODE(inode)   mutex_lock(&(inode)->i_mutex)
    +#    define UNLOCK_INODE(inode) mutex_unlock(&(inode)->i_mutex)
    +#else
    +#    define LOCK_INODE(inode)   down(&(inode)->i_sem)
    +#    define UNLOCK_INODE(inode) up(&(inode)->i_sem)
    +#endif
    +
    +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
     #define atomic_long_t		atomic_t
     #define atomic_long_set		atomic_set
     #define timespec_to_ns(ts)	({(long long)(ts)->tv_sec;})
    @@ -35,6 +43,19 @@
     #define D_CHILD			d_u.d_child
     #endif
    
    +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
    +# ifdef __CHECKER__
    +#  define __bitwise__ __attribute__((bitwise))
    +# else
    +#  define __bitwise__
    +# endif
    +
    +typedef unsigned __bitwise__ gfp_t;
    +void *kzalloc(size_t size, gfp_t flags);
    +
    +#define do_exit(a)  /* not yet exported */
    +#endif
    +
     /* ---------------------------------------------------------------------- */
    
     #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
    diff -up -r aufs-20070327/fs/aufs/branch.c aufs-20070327-new/fs/aufs/branch.c
    --- aufs-20070327/fs/aufs/branch.c      2007-03-27 23:41:11.000000000 +0200
    +++ aufs-20070327-new/fs/aufs/branch.c  2007-03-28 16:16:01.956799716 +0200
    @@ -740,5 +740,5 @@
     				dput(br->br_plink);
     				br->br_plink = NULL;
     			}
    -#if 1 // test here
    +#if 0 // test here
     			// no need file_list_lock() since sbinfo is locked
    diff -up -r aufs-20070327/fs/aufs/branch.h aufs-20070327-new/fs/aufs/branch.h
    --- aufs-20070327/fs/aufs/branch.h      2007-03-27 23:41:11.000000000 +0200
    +++ aufs-20070327-new/fs/aufs/branch.h  2007-03-29 09:42:07.897314461 +0200
    @@ -100,10 +100,10 @@
     /* --------------------------------------------------------------------- */
    
     #define _AufsNoNfsBranchMsg "NFS branch is not supported"
    -#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,15)
    -#define AufsNoNfsBranch
    -#define AufsNoNfsBranchMsg _AufsNoNfsBranchMsg
    -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) \
    +//#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
    +//#define AufsNoNfsBranch
    +//#define AufsNoNfsBranchMsg _AufsNoNfsBranchMsg
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) \
     	&& !defined(CONFIG_AUFS_LHASH_PATCH)
     #define AufsNoNfsBranch
     #define AufsNoNfsBranchMsg _AufsNoNfsBranchMsg \
    diff -up -r aufs-20070327/fs/aufs/debug.h aufs-20070327-new/fs/aufs/debug.h
    --- aufs-20070327/fs/aufs/debug.h       2007-03-27 23:41:12.000000000 +0200
    +++ aufs-20070327-new/fs/aufs/debug.h   2007-03-28 15:40:51.459788803 +0200
    @@ -31,10 +31,14 @@
     #define DEBUG_ON(a)	/* */
     #endif
    
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
     static inline void MtxMustLock(struct mutex *mtx)
     {
            DEBUG_ON(!mutex_is_locked(mtx));
     }
    +#else
    +#define MtxMustLock(a) /* */
    +#endif
     
     /* ---------------------------------------------------------------------- */
     
    diff -up -r aufs-20070327/fs/aufs/file.c aufs-20070327-new/fs/aufs/file.c
    --- aufs-20070327/fs/aufs/file.c        2007-03-27 23:41:12.000000000 +0200
    +++ aufs-20070327-new/fs/aufs/file.c    2007-03-28 20:46:58.563987042 +0200
    @@ -702,7 +702,7 @@ static int aufs_commit_write(struct file
     {BUG();return 0;}
     static int aufs_writepage(struct page *page, struct writeback_control *wbc)
     {BUG();return 0;}
    -#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,15)
    +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
     static int aufs_sync_page(struct page *page)
     {BUG(); return 0;}
     #else
    @@ -724,6 +724,6 @@
     static int aufs_set_page_dirty(struct page *page)
     {BUG();return 0;}
    -#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,15)
    +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
     static int aufs_invalidatepage (struct page *page, unsigned long offset)
     {BUG(); return 0;}
     #else
    @@ -810,7 +810,9 @@
     	.invalidatepage	= aufs_invalidatepage,
     	.releasepage	= aufs_releasepage,
     	.direct_IO	= aufs_direct_IO,
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
     	.get_xip_page	= aufs_get_xip_page,
     	//.migratepage	= aufs_migratepage
     #endif
    +#endif
     };
    diff -up -r aufs-20070327/fs/aufs/f_op.c aufs-20070327-new/fs/aufs/f_op.c
    --- aufs-20070327/fs/aufs/f_op.c        2007-03-27 23:41:12.000000000 +0200
    +++ aufs-20070327-new/fs/aufs/f_op.c    2007-03-28 17:48:41.118229760 +0200
    @@ -18,7 +18,10 @@
     
     /* $Id: f_op.c,v 1.21 2007/03/27 12:49:00 sfjro Exp $ */
     
    +#include <linux/version.h>
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
     #include <linux/fsnotify.h>
    +#endif
     #include <linux/pagemap.h>
     #include <linux/poll.h>
     #include <linux/security.h>
    diff -up -r aufs-20070327/fs/aufs/inode.h aufs-20070327-new/fs/aufs/inode.h
    --- aufs-20070327/fs/aufs/inode.h       2007-03-27 23:41:12.000000000 +0200
    +++ aufs-20070327-new/fs/aufs/inode.h   2007-03-28 15:42:06.004684827 +0200
    @@ -22,7 +22,9 @@
     #define __AUFS_INODE_H__
    
     #include <linux/fs.h>
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
     #include <linux/inotify.h>
    +#endif
     #include <linux/version.h>
     #include <linux/aufs_type.h>
     #include "misc.h"
    @@ -60,7 +60,7 @@
     	struct aufs_iinfo iinfo;
     	struct inode vfs_inode;
     };
    
    -#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,15)
    +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
     #define i_lock(i)		down(&(i)->i_sem)
     #define i_unlock(i)		up(&(i)->i_sem)
    diff -up -r aufs-20070327/fs/aufs/misc.c aufs-20070327-new/fs/aufs/misc.c
    --- aufs-20070327/fs/aufs/misc.c        2007-03-27 23:41:12.000000000 +0200
    +++ aufs-20070327-new/fs/aufs/misc.c    2007-03-28 17:43:12.461373007 +0200
    @@ -24,5 +24,15 @@
     #include <asm/uaccess.h>
     #include "aufs.h"
    
    +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
    +void *kzalloc(size_t size, gfp_t flags)
    +{
    +        void *ret = kmalloc(size, flags);
    +        if (ret)
    +                memset(ret, 0, size);
    +        return ret;
    +}
    +#endif
    +
     /*
      * @hidden_dir: must be locked.
    @@ -263,9 +273,14 @@
     	/* the last block may be a hole */
     	if (unlikely(!err && all_zero)) {
     		struct iattr ia = {
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
     			.ia_size	= dst->f_pos,
     			.ia_valid	= ATTR_SIZE | ATTR_FILE,
     			.ia_file	= dst
    +#else
    +			.ia_size	= dst->f_pos,
    +			.ia_valid	= ATTR_SIZE,
    +#endif
     		};
     		struct dentry *h_d = dst->f_dentry;
     		struct inode *h_i = h_d->d_inode;
    diff -up -r aufs-20070327/fs/aufs/whout.c aufs-20070327-new/fs/aufs/whout.c
    --- aufs-20070327/fs/aufs/whout.c       2007-03-27 23:41:12.000000000 +0200
    +++ aufs-20070327-new/fs/aufs/whout.c   2007-03-28 17:37:27.529700059 +0200
    @@ -20,6 +20,7 @@
     
     #include <linux/fs.h>
     #include <linux/kthread.h>
    +#include <linux/kernel.h>
     #include <linux/namei.h>
     #include <linux/random.h>
     #include <linux/security.h>
    diff -up -r aufs-20070327/fs/aufs/xino.c aufs-20070327-new/fs/aufs/xino.c
    --- aufs-20070327/fs/aufs/xino.c        2007-03-27 23:41:13.000000000 +0200
    +++ aufs-20070327-new/fs/aufs/xino.c    2007-03-28 17:49:08.086895101 +0200
    @@ -19,7 +19,10 @@
     /* $Id: xino.c,v 1.22 2007/03/27 12:51:44 sfjro Exp $ */
     
     //#include <linux/fs.h>
    +#include <linux/version.h>
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
     #include <linux/fsnotify.h>
    +#endif
     #include <asm/uaccess.h>
     #include "aufs.h"
     
    diff -up -r aufs-20070327/local.mk aufs-20070327-new/local.mk
    --- aufs-20070327/local.mk      2007-03-27 23:41:11.000000000 +0200
    +++ aufs-20070327-new/local.mk  2007-03-28 15:54:57.778188118 +0200
    @@ -16,5 +16,5 @@
     CONFIG_AUFS_LHASH_PATCH =
     CONFIG_AUFS_KSIZE_PATCH =
    -CONFIG_AUFS_DEBUG = y
    +CONFIG_AUFS_DEBUG =
     CONFIG_AUFS_DEBUG_RWSEM =
     CONFIG_AUFS_COMPAT =
    ============= Next, copy this code and save it as "linuxrc":

    Code:
    SAME GOES HERE, THE LINUXRC SCRIPT SEEMS TO BE TOO BIG TO BE POSTED HERE, THE FORUM DID NOT TAKE IT ALL

  4. #4
    Junior Member registered user
    Join Date
    Jul 2006
    Posts
    14

    PROBLEMS WITH THE FORUM WEBSITE

    WELL, I DON'T THINK I CAN POST EVERYTHING ON THIS FORUM, SINCE BIG CODES ARE NOT ACCEPTED

    I'M SORRY FOLKS, I REALLY WANTED TO START A USEFUL THREAD BUT PROBABLY THIS IS THE WRONG FORUM TO DO IT.


  5. #5
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441
    There are many places on the web that you can find that will let you host files for free. I would think your best bet would be to use one of them and just post a link to a zip of the code that you want to post. You may even be able to find someone that would let you host a full ISO file.

Similar Threads

  1. Are the kernels patched ?
    By cara in forum Customising & Remastering
    Replies: 2
    Last Post: 06-14-2005, 11:13 PM
  2. [Question]Chaging around different versions of kernels(v2.6)
    By wsun013 in forum Customising & Remastering
    Replies: 0
    Last Post: 04-19-2005, 07:20 AM
  3. Config Dateien des Kernels
    By rainerh in forum German Forum
    Replies: 2
    Last Post: 02-20-2005, 10:02 PM
  4. Problems with 2.6.1 kernels and fsck
    By bobalex in forum Hdd Install / Debian / Apt
    Replies: 1
    Last Post: 01-28-2004, 07:48 PM
  5. Experimental Kernels?
    By fearlessrogue in forum Hdd Install / Debian / Apt
    Replies: 0
    Last Post: 06-30-2003, 12:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


VINTAGE DEC Digital RK11-D DISK CONTROL M7255 PDP 11 (B1) picture

VINTAGE DEC Digital RK11-D DISK CONTROL M7255 PDP 11 (B1)

$129.99



DEC DIGITAL Equipment Corp VT220-D2 Vintage CRT Terminal picture

DEC DIGITAL Equipment Corp VT220-D2 Vintage CRT Terminal

$215.00



Digital Equipment Corporation DEC-2000 Vintage Keyboard - NOS  NEW in Plastic picture

Digital Equipment Corporation DEC-2000 Vintage Keyboard - NOS NEW in Plastic

$129.95



DEC  PDP 8/M  PDP 8M / 4 avail / Vintage Digital Equipment Corp /Also DEC PDP 12 picture

DEC PDP 8/M PDP 8M / 4 avail / Vintage Digital Equipment Corp /Also DEC PDP 12

$5775.00



Vintage DEC Digital RX 180 AB Dual 5.25

Vintage DEC Digital RX 180 AB Dual 5.25" Disk Drive

$149.00



Vintage Digital DEC dfo1 Acoustic Coupler modem Anderson Jacobsen Mod# A242 RARE picture

Vintage Digital DEC dfo1 Acoustic Coupler modem Anderson Jacobsen Mod# A242 RARE

$195.95



Vintage DEC/CLEARPOINT INC. -QRAM-2 SAB-1 1MB Q-BUS MEMORY MSV11-QA (B2) picture

Vintage DEC/CLEARPOINT INC. -QRAM-2 SAB-1 1MB Q-BUS MEMORY MSV11-QA (B2)

$129.99



Rare Vintage DEC DIGITAL DFO3  modem with manual   Powers up but UNTESTED picture

Rare Vintage DEC DIGITAL DFO3 modem with manual Powers up but UNTESTED

$69.95



Vintage DEC Digital M8048 5013995C PDP-11 LSI 11 ROM (B3) picture

Vintage DEC Digital M8048 5013995C PDP-11 LSI 11 ROM (B3)

$79.99



Vintage DEC/The Redac mini cabinet front panel Digital Equipment Corp. 19

Vintage DEC/The Redac mini cabinet front panel Digital Equipment Corp. 19"

$269.99