How To rebuild kernel 2.6.36.3 into b14 document

Home Page Forums Network Management ZeroShell How To rebuild kernel 2.6.36.3 into b14 document

This topic contains 20 replies, has 0 voices, and was last updated by  rda 6 years, 9 months ago.

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #42860

    rda
    Member

    You can download document
    http://hotfile.com/dl/104834283/6e56e4c/zeroshell-develop.pdf.html

    Contentos

    1.Packages List
    2. Zeroshell VirtualBox
    3. Install ZerosShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img
    4. Install samba
    5. Development environments
    6. Kernel Patch & Build Kernel
    7. Compile Packages&install Packages
    8. Build Kernel 2.6.36.3 initrd.gz
    9. Copy zeroshell cdrom.iso(hdb2,or,sdb2) files
    10. Add iptables reject with-tcp-rst &Enable P2P function
    11. Update Zeroshell-b14 Kernel &cdrom
    12. Update ld.so.cache
    13. Build new ZerosShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB.img

    #51580

    SpeedD408
    Member

    rda,

    First thank you very much. I’m sure this wasn’t easy.

    Corrections

    Step 2 –

    Ok not really a correction, but you need tell people to change the IP address on your virtual ZeroShell config to match the segment of the PC you are running VirtualBOX on and set the default gateway or none of the wget commands are going to work.

    Step 3 –

    1) mkdir command is incomplete needs /DB/ or the rest of the instructions don’t work.

    root@zeroshell root>fdisk /dev/hdb
    root@zeroshell root>mke2fs –j /dev/hdb1
    root@zeroshell root>mkdir hdb
    root@zeroshell root>mount /dev/hdb1 hdb
    root@zeroshell root>cd /DB/hdb

    This needs to be:

    root@zeroshell root>fdisk /dev/hdb
    root@zeroshell root>mke2fs –j /dev/hdb1
    root@zeroshell root>mkdir /DB/hdb
    root@zeroshell root>mount /dev/hdb1 hdb
    root@zeroshell root>cd /DB/hdb

    Step 4 –

    1) After you have rebooted to the CompactFlash image /DB/hdb no longer exists so you have to create it again.
    2) there is an error on the tar line
    3) cd opt/.. line is missing ../ and can be consolidated
    4) what are we changing in smb.conf via vi???
    5) cd ….tars has wrong slash
    6) rc.d/init.d/ line needs correction

    So far this should be:

    root@zeroshell root> mkdir /DB/hdb
    root@zeroshell root> mount /dev/hdb1 /DB/hdb
    root@zeroshell root> cd /DB/hdb (you have an extra space here)
    root@zeroshell hdb> wget http://www.orquideadesign.com/SMB12_beta1.tar.bz2
    root@zeroshell hdb> cd /Database
    root@zeroshell Database> tar xvjf /DB/hdb/SMB12_beta1.tar.bz2
    root@zeroshell Database> cd SMB12/
    root@zeroshell SMB12> ./install.sh
    root@zeroshell Database> cd ../opt/1.0/beta12/packages/etc
    root@zeroshell etc> vi smb.conf
    root@zeroshell etc> cd ../../tars
    root@zeroshell tars> tar zxvf SMB12-files.tar.gz
    root@zeroshell tars> cd etc
    root@zeroshell etc> cd rc.d/init.d/
    root@zeroshell init.d> export LD_LIBRARY_PATH=”/Database/opt/1.0/beta12/packages/lib:$LD_L IBRARY_PATH”
    root@zeroshell init.d> ./samba start
    root@zeroshell init.d> cd /DB
    root@zeroshell DB> chmod a+w hdb

    Thanks,
    John.

    #51581

    SpeedD408
    Member

    Step 5 works fine up to here:

    root@zeroshell DB> cd hdb
    root@zeroshell hdb> wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.3.tar.bz2
    root@zeroshell hdb> cd /cdrom/
    root@zeroshell cdrom> tar zcvf /DB/hdb/usr.tgz usr/
    root@zeroshell cdrom> cd /DB/hdb
    root@zeroshell hdb> bzip2 -d *.bz2
    root@zeroshell hdb> tar xvf glibc-2.8-includes-zs.tar
    root@zeroshell hdb> tar xvf gcc-include.tar
    root@zeroshell hdb> tar xvf gcc-4.3.2-zs-i386.tar
    root@zeroshell hdb> tar xvf binutils-2.17-i386.tar

    I get a file not found errors for all of these tar commands. Were these supposed to be downloaded from some place?

    Let me know how to proceed and I will.

    Thanks,
    John.

    #51582

    rda
    Member

    Thank you for SpeedD408

    I will modify ny document

    document page 2
    You can download all files
    http://hotfile.com/dl/103438726/6469b42/packages.tar.html

    #51583

    imported_fulvio
    Participant

    Thanks a lot for your splendid work. Can I publish the document on the documentation page? The layer 7 filters work correctly? Where did you find the patch?

    Regards
    Fulvio

    #51584

    rda
    Member

    Thank you for fulvio
    You can publish the document on the documentation page
    I modify my doc
    Please download
    http://hotfile.com/dl/104834283/6e56e4c/zeroshell-develop.pdf.html

    layer 7 filters work correctly

    I forget where

    You can download all file
    http://hotfile.com/dl/103438726/6469b42/packages.tar.html
    Can you add iptables reject with-tcp-rst &Enable P2P function ,ipset
    ipset is nice tools ,It can create ip or port groups
    I will add fwsnort
    http://www.cipherdyne.org/fwsnort/
    It is ips use iptables string function
    It use snort rules
    Can you release new gcc version
    Thank You
    I update kernel for b14
    download
    http://hotfile.com/dl/103891469/75b32f1/ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB-2_6_36_3.img.gz.html

    #51585

    Vizzini
    Member

    Thank you very much for your hard work, rda. Now my EeePC is working at full 100 Mbit speeds running ZS.

    Cheers. Hopefully a newer kernel version can become official in the not too distant future, I always feel better about downloading software from the official sources. But in the meantime, I’m pleased to be able to use this.

    * Whoops. Looks like beta14 does not have a dansguardian patch yet. I’ll go back to my old ways of operating until that comes out. Doh. Or attempt to do this process for beta13. Anyway, nice work guys.

    #51586

    jimmyz
    Member

    Piece of cake. 😯

    I am trying to learn how to customize this thing a little. I’m sure this will help, might take awhile for me to digest. I am at step 5.

    Thanks for the hard work and for turning me on to VirtualBox.

    #51587

    hlm
    Member

    rda that is just outstanding work. A true masterpiece! Congratulations and thank you for putting this together.

    I’ve noticed that step 5 is missing the untar of static-lib.tar.bz2. Without the files in that archive, the kernel compilation fails on Step 6 at the ‘make menuconfig’ command. I did not capture the exact error message but it complains about a missing libc_nonshared.a file. Untaring the static-lib file along with the other ones in step 5 fixes that problem.

    Now, I’m stuck in step 7. Iptables won’t compile with the following error message:

    root@zeroshell iptables-1.4.10> gcc -v
    Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs
    Configured with: ../gcc-3.3.1/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++
    Thread model: posix
    gcc version 3.3.1
    root@zeroshell iptables-1.4.10> make
    make all-recursive
    make[1]: Entering directory `/DB/hdb/iptables-1.4.10'
    Making all in extensions
    make[2]: Entering directory `/DB/hdb/iptables-1.4.10/extensions'
    make[2]: Leaving directory `/DB/hdb/iptables-1.4.10/extensions'
    Making all in include
    make[2]: Entering directory `/DB/hdb/iptables-1.4.10/include'
    make[2]: Nothing to be done for `all'.
    make[2]: Leaving directory `/DB/hdb/iptables-1.4.10/include'
    make[2]: Entering directory `/DB/hdb/iptables-1.4.10'
    /bin/sh ./libtool --tag=CC --mode=link gcc -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes -Winline -pipe -DXTABLES_LIBDIR="/usr/local/libexec/xtables" -DXTABLES_INTERNAL -I./include -I./include -I /lib/modules/2.6.36.3/build/include -DIPTABLES_MULTI -g -O2 -rdynamic -o iptables-multi iptables_multi-iptables-multi.o iptables_multi-iptables-save.o iptables_multi-iptables-restore.o iptables_multi-iptables-xml.o iptables_multi-iptables-standalone.o iptables_multi-iptables.o iptables_multi-xshared.o libiptc/libip4tc.la extensions/libext4.a libxtables.la -lm
    libtool: link: gcc -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes -Winline -pipe -DXTABLES_LIBDIR="/usr/local/libexec/xtables" -DXTABLES_INTERNAL -I./include -I./include -I /lib/modules/2.6.36.3/build/include -DIPTABLES_MULTI -g -O2 -rdynamic -o .libs/iptables-multi iptables_multi-iptables-multi.o iptables_multi-iptables-save.o iptables_multi-iptables-restore.o iptables_multi-iptables-xml.o iptables_multi-iptables-standalone.o iptables_multi-iptables.o iptables_multi-xshared.o libiptc/.libs/libip4tc.so extensions/libext4.a ./.libs/libxtables.so -lm
    ./.libs/libxtables.so: undefined reference to `_dl_open'
    ./.libs/libxtables.so: undefined reference to `_dl_catch_error'
    collect2: ld returned 1 exit status
    make[2]: *** [iptables-multi] Error 1
    make[2]: Leaving directory `/DB/hdb/iptables-1.4.10'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/DB/hdb/iptables-1.4.10'
    make: *** [all] Error 2

    I’ve seen this error in the past and even though I don’t exactly remember what I did to get past it, I remember it had something to do with libdl.so (googling also shows some indications libdl may be the cause)… So, I tried changing symlinks and files around /usr/lib and /lib for libdl.so (as shown in the end of Step 5) and running ldconfig to recreate the library cache, all without success. Does anyone have any hints or clues for what could be wrong and what can be done to fix it?

    Thanks in advance,
    Helio

    #51588

    hlm
    Member

    Luckily, I was able to figure a way out of the iptables compilation error on Step 7.

    The error I was getting indeed was related to libdl.so. To fix it, I removed the /lib/libdl-2.3.2.so file, ran ldconfig, went back to the kernel source tree, ran `make; make modules_install` (I did not clean the kernel tree, running a simple make was enough, as a matter of fact it might not even be necessary), finally, went back to the iptables source tree cleaned it, ran ./configure and compiled it again.

    Now, when I look back, I’m pretty sure I may have messed up on the step to fix links to /lib/libdl.so, as shown towards the end of Step 6. The gotcha is that if you find yourself with libdl.so linking errors in iptables compilation, not only you need to fix the library links, but also go into the kernel tree and do a quick make and make modules_install, only then you can get back to the iptables compilation.

    With iptables out of the way, I was able to move foward into xtables compilation. In xtables-addons compilation I faced the following error:


    root@zeroshell extensions> make
    Xtables-addons 1.32 - Linux 2.6.36.3
    if [ -n "/lib/modules/2.6.36.3/build" ]; then make -C /lib/modules/2.6.36.3/build M=/DB/hdb/xtables-addons-1.32/extensions modules; fi;
    make[1]: Entering directory `/DB/hdb/usr/src/linux-2.6.36.3'
    Building modules, stage 2.
    MODPOST 37 modules
    make[1]: Leaving directory `/DB/hdb/usr/src/linux-2.6.36.3'
    make -f ../Makefile.iptrules all;
    make[1]: Entering directory `/DB/hdb/xtables-addons-1.32/extensions'
    CC libxt_CHAOS.oo
    In file included from /usr/local/include/xtables.h:16,
    from libxt_CHAOS.c:16:
    ../include/linux/netfilter.h:53: error: parse error before "__be32"
    ../include/linux/netfilter.h:57: error: parse error before '}' token
    make[1]: *** [libxt_CHAOS.oo] Error 1
    make[1]: Leaving directory `/DB/hdb/xtables-addons-1.32/extensions'
    make: *** [user-all-local] Error 2

    I was able to find that, for whatever reason, the “__be32” type definition is not available at /usr/include/linux/types.h. I don’t know why is that, but when looking at the types.h file at the 2.6.36.3 source tree, the “__be32” type definition is there. So I edited /DB/hdb/xtables-addons-1.32/extensions/Makefile and appended a -I option to the libxtables_CFLAGS variable around line 163. Here is how it should look like once edited:


    libxtables_CFLAGS = -I/usr/local/include -I/lib/modules/2.6.36.3/build/include

    That forces the compilation to use the types.h that came with the new kernel instead of the other one, already available at /usr/include/. Note that this workaround makes gcc complain about the usage of kernel headers to compile a user space binary. These warnings seem to be harmless, and, when I looked over the reference the warning points to at kernelnewbies.org (http://kernelnewbies.org/KernelHeaders), it does not seem all that alarming.

    Onto Step 11, when creating the cdrom.iso file with mkisofs, it bails out complaining about duplicated indexes for the rr_moved directory, that was an easy fix, and all I had to do is to remove the /DB/hdb/sz-roots/rr_moved directory before running mkisofs (that directory seems to be created automatically by mkisofs, that is why it can’t be there in the first place). This rr_moved directory got copied from the original /cdrom directory in the beginning of Step 9.

    Well, after going through these, all other steps rolled out just fine with a few tweaks here and there, like cd’ing into the correct directory and such.

    Now I’m running a neat version of ZeroShell with 2.6.36.3 kernel and as a byproduct I have my own development environment to adventure myself in customizing ZeroShell even more. Note that for anyone trying out rda’s instructions, please follow then through as they are documented, only if you run into the same issues described above you should try to work around or fix them, with luck you won’t even run into any of them.

    Thanks rda for creating this outstanding material and thanks Fulvio for creating ZeroShell!

    Regards,
    -Helio

    #51589

    Ciao,

    with the new version of iptables (1.4.10) a rule of captive portal print an error
    “The “nat” table is not intended for filtering, the use of DROP is therefore inhibited.”

    Insiede /root/kerbynet.cgi/scripts/cp_start

    if ! [ -f /var/register/system/cp/NOLIMIT ] ; then
    HASHLIMIT=” -mhashlimit –hashlimit-name CP_Redirect –hashlimit-mode srcip,dstport –hashlimit 10/minute –hashlimit-burst 15″
    iptables -t nat -A CapPortHTTP -p tcp –syn $HASHLIMIT -j $CAPTUREHTTP
    iptables -t nat -A CapPortHTTPS -p tcp –syn $HASHLIMIT -j $CAPTUREHTTPS
    iptables -t nat -A CapPortHTTP -p tcp –syn -j DROP
    iptables -t nat -A CapPortHTTPS -p tcp –syn -j DROP
    fi

    #51590

    micampo
    Member

    excellent work

    1. I can do it in vmware?
    2. I can use that image and recompiled for testing?
    3. now try to download the doc file but it came out error, reassemble please or send it to my email

    thanks

    #51591

    knura
    Member

    @rda wrote:

    … snip …

    I update kernel for b14 download
    http://hotfile.com/dl/103891469/75b32f1/ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB-2_6_36_3.img.gz.html

    Thanks for the great work.

    FWIW, the above image can also be used for ALIX boards, with minor modifications to the grub.conf and menu.lst files for “serial” console.

    I need the newer kernel to try out an Wi-Fi card that works with kernel 2.6.32 and later.

    I took the easy way out and simply copied the grub.conf and menu.lst files from the ALIX .img file into the above. The .img files are compatible with Linux KVM (qemu).

    Here are the steps:

    1. Startup Linux KVM with a Rescue CD, I used SystemRescueCD. (Include the .img file as a hard disk in the KVM).
    2. mkdir /mnt/sda1.
    3. Mount /dev/sda1 on /mnt/sda1 (the /boot partition)
    4. scp the grub.conf and menu.lst files (obtained from the stock 1.0b14 ALIX image) into /mnt/sda1/grub/ directory.
    5. Shutdown the Linux KVM
    6. dd the update .img file to a CF
    7. Install the CF on the ALIX board and boot

    — Arun Khan

    #51592

    jjonez
    Member

    @rda wrote:

    I update kernel for b14
    download
    http://hotfile.com/dl/103891469/75b32f1/ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB-2_6_36_3.img.gz.html

    Thanks rda, Fulvio et al. Unfortunately the madwifi included in the link here is an old one, compiled against 2.6.25.20.
    If I wanted to compile a madwifi package, couldn’t I skip some of these steps by using the above package with the kernel source and development toolchain to compile madwifi?

    Or should I start from scratch?

    The reason I’m looking for an updated madwifi is because I have 3 alix boards all with the, apparently dreaded, Wistron CM9 Atheros wifi card. The APs lock up randomly and I’m hoping to fix this situation without resorting to anything too drastic.

    #51593

    jjonez
    Member

    @jjonez wrote:

    @rda wrote:

    I update kernel for b14
    download
    http://hotfile.com/dl/103891469/75b32f1/ZeroShell-1.0.beta14-CompactFlash-IDE-USB-SATA-1GB-2_6_36_3.img.gz.html

    Thanks rda, Fulvio et al. Unfortunately the madwifi included in the link here is an old one, compiled against 2.6.25.20.
    If I wanted to compile a madwifi package, couldn’t I skip some of these steps by using the above package with the kernel source and development toolchain to compile madwifi?

    Or should I start from scratch?

    The reason I’m looking for an updated madwifi is because I have 3 alix boards all with the, apparently dreaded, Wistron CM9 Atheros wifi card. The APs lock up randomly and I’m hoping to fix this situation without resorting to anything too drastic.

    The answer is yes. 😉 I started with the 2.6.32 above added the dev packages but still had to compile a kernel for the madwifi modules to load.

    Also thank you Renato Morano, you’re the man! This was helpfull:

    http://www.renatomorano.net/?p=1154

    NB: If you are upgrading, be aware that your atheros wireless card will be named ath0 instead of ETH01. After messing around with the wireless manager it’s back to ETH01 so good luck.

    I have not tested this extensively…..so far so good. Will post an update either way.

    If anyone has any pointers on how I could customize the kernel for ALIX boards I would be super grateful. I just used the one in /proc/config.gz did ‘make oldconfig’ and ‘make menuconfig’ with no further customizations.

    ZeroShell-1.0.beta14-madwifi-CompactFlash-alix-1GB-2_6_36_3.img
    download
    http://www.megaupload.com/?d=6L9WI6NC

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic.