Results 1 to 3 of 3

Thread: problem building/booting w/custom kernel

  1. #1
    Junior Member
    Join Date
    Mar 2006
    Posts
    2

    problem building/booting w/custom kernel

    Hello all,

    (I thought I already posted this but I don't see it anywhere ---- apologies if this is a dup.)

    I went through several HowTos and read many posts/responses and was eventually successful in creating a custom
    Knoppix with a custom kernel. Now I'm trying to reproduce this success and get the "CANNOT UNITE" error. I think this
    indicates unionfs and kernel incompatibility but I don't know how to fix it. Perhaps the problem is that I'm building unionfs
    outside the chroot environment, but I thought I did this the first time. Also, I'm not sure whether I need cloop.o or just
    cloop.ko will be sufficient.

    I'll post my whole remastering process below. I would appreciate any pointers on how to fix this problem, as well as how
    to streamline the whole process.

    Code:
    # I'm working on my /mnt/sda6 partition which has about 5.5GB,
    # and doing pretty much everything as root
     
    #
    # Boot Knoppix 4.0.2
    # edit /etc/fstab to add ",dev" to the /mnt/sda6 entry
    #
    mount -rw /dev/sda6 /mnt/sda6
    mkdir /mnt/sda6/knx
    mkdir -p /mnt/sda6/knx/master/KNOPPIX
    mkdir -p /mnt/sda6/knx/source/KNOPPIX
    cp -dpR /KNOPPIX/* /mnt/sda6/knx/source/KNOPPIX
    cp -ar /cdrom/boot /mnt/sda6/knx/master/boot
    cp /cdrom/index.html /mnt/sda6/knx/master/
    cd /cdrom && find . -size -10000k -type f -exec cp -p --parents '{}' /mnt/sda6/knx/master/ \;
    cd /mnt/sda6/knx/source/KNOPPIX/usr/src
    # I get errors I don't understand when I install the same
    # kernel that's running, so I install a different kernel
    wget http://www.kernel.org/pub/linux/kern...-2.6.13.tar.gz
    gunzip linux-2.6.13.tar.gz
    tar xf linux-2.6.13.tar
    rm -f linux-2.6.13.tar
    rm -f linux
    ln -s linux-2.6.13 linux
    cp /KNOPPIX/usr/src/linux/.config /mnt/sda6/knx/source/KNOPPIX/usr/src/linux
    chroot /mnt/sda6/knx/source/KNOPPIX
    mount -t proc /proc proc
    # I ignore "warning: can't open /etc/fstab: No such file or directory"
    echo "nameserver a.b.c.d" >> /etc/resolv.conf
    # There's an actual IP addr above
    # Now start making some room...
    rm -rf /usr/games
    rm -rf /usr/share/games
    cd /usr/src
    # Find out what packages are installed, and how big they are:
    dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n
    # Because somebody somewhere said to:
    apt-get update
    # remove some packages to make room:
    apt-get remove --purge -y kernel-image-2.6.12
    # Remove some large packages here with a bunch of apt-get remove's
    #
    # Seems like I might need the following:
    apt-get install uuid-dev
    apt-get install ctags
    apt-get clean
    cd /usr/src/modules
    wget http://debian-knoppix.alioth.debian...._2.02-1.tar.gz
    gunzip cloop_2.02-1.tar.gz
    tar xf cloop_2.02-1.tar
    cd /usr/src/linux/include
    ln -s asm-i386 asm
    cd /usr/src/linux
    # I take all defaults on next step
    make oldconfig
    make
    # Not sure exactly what I'm doing around here
    make-kpkg kernel-image
    dpkg -i ../kernel-image*deb
    make modules
    make modules_install
    cd /usr/src/modules/cloop-2.02
    make KERNEL_DIR=/usr/src/linux
    cd /usr/src/modules
    wget ftp://ftp.fsl.cs.sunysb.edu/pub/unio...-1.0.14.tar.gz
    gunzip unionfs-1.0.14.tar.gz
    tar xf unionfs-1.0.14.tar
    cd /usr/src/modules/unionfs-1.0.14
    make LINUXSRC=/usr/src/linux TOPINC=-I/usr/src/linux/include
    cd /usr/src/linux
    rm -f /boot/vmlinuz
    rm -f /boot/System.map
    ln -s /boot/vmlinuz-2.6.13 /boot/vmlinuz
    ln -s /boot/System.map-2.6.13 /boot/System.map
    umount /proc
    exit
    # No longer in the chroot environment
    cd /mnt/sda6/knx/source/KNOPPIX/usr/src/modules
    cd /mnt/sda6/knx/master/boot/isolinux
    mkdir miniroot-initrd
    mkdir miniroot-initramfs
    gunzip minirt.gz
    mount -o loop minirt miniroot-initrd
    cp -Rp miniroot-initrd/* miniroot-initramfs/
    umount ./miniroot-initrd
    rmdir ./miniroot-initrd
    cd miniroot-initramfs
    touch init
    chmod +x init
    echo '#!/static/ash' >> init
    echo '/linuxrc' >> init
    echo 'exec /etc/init "$@" </dev/console >/dev/console 2>&1' >> init
    cp -f /mnt/sda6/knx/source/KNOPPIX/usr/src/modules/unionfs-1.0.14/unionfs.ko \
       modules
    cp -f /mnt/sda6/knx/source/KNOPPIX/usr/src/modules/cloop-2.02/cloop.ko \
       modules
    cd modules
    strip unionfs.ko
    cd ..
    find . | cpio --quiet -o -H newc | gzip -9 > ../minirt.gz
    cd ..
    rm -rf miniroot-initramfs
    rm -f minirt
    rm -rf /mnt/sda6/knx/source/KNOPPIX/.rr_moved
    sed 's/nomce /nomce noeject noprompt /g' \
        /mnt/sda6/knx/master/boot/isolinux/isolinux.cfg > \
        /mnt/sda6/knx/master/boot/isolinux/isolinux.new
    mv /mnt/sda6/knx/master/boot/isolinux/isolinux.new \
       /mnt/sda6/knx/master/boot/isolinux/isolinux.cfg
    cp /mnt/sda6/knx/source/KNOPPIX/usr/src/linux/arch/i386/boot/bzImage \
       /mnt/sda6/knx/master/boot/isolinux/linux
    cd /mnt/sda6/knx/source/KNOPPIX/usr/src/linux/
    make clean
    mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix.net" \     -hide-rr-moved -cache-inodes -no-bak -pad /mnt/sda6/knx/source/KNOPPIX \
      | /usr/bin/create_compressed_fs - 65536 > /mnt/sda6/knx/master/KNOPPIX/KNOPPIXcd /mnt/sda6/knx/master
    find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin \
       -exec md5sum '{}' \; > KNOPPIX/md5sums
    mkisofs -pad -l -r -J -v -V "KNOPPIX" -no-emul-boot -boot-load-size 4 \
       -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
       -hide-rr-moved -o /mnt/sda6/knx/knoppix.iso /mnt/sda6/knx/master
    qemu -m 128 -cdrom /mnt/sda6/knx/knoppix.iso -boot d -user-net

  2. #2
    Senior Member registered user
    Join Date
    Apr 2004
    Location
    Finland
    Posts
    272

    Re: problem building/booting w/custom kernel

    Quote Originally Posted by Wisler
    I went through several HowTos and read many posts/responses and was eventually successful in creating a custom
    Knoppix with a custom kernel. Now I'm trying to reproduce this success and get the "CANNOT UNITE" error. I think this
    indicates unionfs and kernel incompatibility but I don't know how to fix it. Perhaps the problem is that I'm building unionfs
    outside the chroot environment, but I thought I did this the first time. Also, I'm not sure whether I need cloop.o or just
    cloop.ko will be sufficient.
    New modules in 2.6 kernel are with .ko ending. I think that in Knoppix 4.0,2 modules were renamed to .o which is not the way to do things. Just copy unionfs.ko and cloop.ko files (no need to change even permissions) to /modules inside your minirt.gz. Then make sure linuxrc had cloop.ko and not cloop.o in line 431 (at least in my linuxrc):
    Code:
     $INSMOD -f /modules/cloop.ko file="$1/$KNOPPIX_DIR/$KNOPPIX_NAME"
    The same with unionfs:
    Code:
    $INSMOD /modules/unionfs.ko 2>/dev/null && UNIONFS="yes"
    Be sure you really have copied unionfs.ko and cloop.ko of the right kernel version and copied them in minirt.gz /modules directory. There seems to be some modification in Knoppix 5.0 but I'm not having it, so I can't say anything more. But I think in new Knoppix those modules are in new /cdrom/boot/modules directory.

    If you can't get your unionfs to work, perhaps you would like to use some of my kernel versions (.deb packages) from http://tapsa.terae.net/linux/knoppix/suomiknoppix/
    That new 2.6.16-beyond1 has unionfs module compiled with the kernel - so you need only linux-image and cloop-modules package. Other .deb packages are extra modules and you can use them if you need them.


    -tapsa-

  3. #3
    Junior Member
    Join Date
    Mar 2006
    Posts
    2
    Be sure you really have copied unionfs.ko and cloop.ko of the right kernel version and copied them in minirt.gz /modules directory.
    That was the problem. I thought that I was building unionfs.ko properly, but the fistdev.mk was missing. I added the following and this seems to have done the trick:

    Code:
    echo 'LINUXSRC=/usr/src/linux' >> fistdev.mk
    echo 'TOPINC=-I/usr/src/linux/include' >> fistdev.mk
    echo 'MODDIR=/lib/modules/2.6.13' >> fistdev.mk
    Thanks for the sanity check.

Similar Threads

  1. Building Custom Knoppix/Debian for Server-appliance
    By calacode in forum Customising & Remastering
    Replies: 0
    Last Post: 07-29-2005, 02:27 PM
  2. booting new custom kernel - MORE DETAILED
    By fabioxa in forum Customising & Remastering
    Replies: 0
    Last Post: 07-05-2004, 08:16 PM
  3. Need custom knoppix CD building
    By andrewtayloruk in forum Customising & Remastering
    Replies: 9
    Last Post: 01-29-2004, 07:05 PM
  4. Building custom kernel under KNOPPIX and package it ?
    By garyng in forum General Support
    Replies: 2
    Last Post: 04-21-2003, 09:54 PM
  5. building custom kernel 2.4.20
    By garyng in forum Customising & Remastering
    Replies: 1
    Last Post: 04-11-2003, 03:27 PM

Posting Permissions

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


OPNsense pfSense 8-Core Atom C3758 2.2GHz 8GB DDR4 64GB SSD 8x NIC QAT AES VPN picture

OPNsense pfSense 8-Core Atom C3758 2.2GHz 8GB DDR4 64GB SSD 8x NIC QAT AES VPN

$125.00



pfSense Firewall 16-Core Atom C3958 8GB DDR4 RAM 64GB SSD 8x 1Gbe QAT AES-NI VPN picture

pfSense Firewall 16-Core Atom C3958 8GB DDR4 RAM 64GB SSD 8x 1Gbe QAT AES-NI VPN

$184.99



OPNsense pfSense 16-Core Atom C3958 16GB ECC RAM 512GB SSD 8-Port QAT AES-NI VPN picture

OPNsense pfSense 16-Core Atom C3958 16GB ECC RAM 512GB SSD 8-Port QAT AES-NI VPN

$258.00



Unfi Security Gateway Pro picture

Unfi Security Gateway Pro

$170.00



Fortinet FortiGate 60F FG-60F UTM UTP License Until 2027 Network Security FW VPN picture

Fortinet FortiGate 60F FG-60F UTM UTP License Until 2027 Network Security FW VPN

$219.99



Fortinet FortiGate 80E 12 Ports Firewall Appliance picture

Fortinet FortiGate 80E 12 Ports Firewall Appliance

$20.25



Netgate SG-2100 pfSense Plus 26.07 Firewall VPN Router - Wiped, Fresh Install picture

Netgate SG-2100 pfSense Plus 26.07 Firewall VPN Router - Wiped, Fresh Install

$174.99



Firewalla Gold Plus 2.5GbE Firewall Router – Excellent Condition picture

Firewalla Gold Plus 2.5GbE Firewall Router – Excellent Condition

$435.00



SonicWall TZ280 Firewall 03-SSC-6933 Advanced Edition 3YR NEW SEALED picture

SonicWall TZ280 Firewall 03-SSC-6933 Advanced Edition 3YR NEW SEALED

$999.99



Fortinet FortiGate FG-40F Network Security Firewall NO RACK EARS picture

Fortinet FortiGate FG-40F Network Security Firewall NO RACK EARS

$49.99