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

$145.00



BOSGAME E4 Air Mini PC, AMD Ryzen 5 3500U 8GB DDR4 256GB SATA SSD picture

BOSGAME E4 Air Mini PC, AMD Ryzen 5 3500U 8GB DDR4 256GB SATA SSD

$169.99



Dell R730 AI Home Lab Server 128GB RTX 3060 Ti Dual Xeon 20-Core picture

Dell R730 AI Home Lab Server 128GB RTX 3060 Ti Dual Xeon 20-Core

$999.00



VA Linux 1120 1U Rackmount Server picture

VA Linux 1120 1U Rackmount Server

$100.00



Ubuntu Server 26.04.1 LTS Bootable USB Flash Drive – Latest September 2026 picture

Ubuntu Server 26.04.1 LTS Bootable USB Flash Drive – Latest September 2026

$12.99



Dell SonicWall TZ400 Network Security Appliance Firewall New picture

Dell SonicWall TZ400 Network Security Appliance Firewall New

$295.00



OPNsense Firewall VPN QAT 8-Core Atom C3758 2.20GHz 16GB DDR4 128GB SSD 8xNIC picture

OPNsense Firewall VPN QAT 8-Core Atom C3758 2.20GHz 16GB DDR4 128GB SSD 8xNIC

$175.00



Start9 Server Pure 32GB 4TB Intel i7 Node StartOS — Box + PSU picture

Start9 Server Pure 32GB 4TB Intel i7 Node StartOS — Box + PSU

$649.00



SQL Server 2022 Enterprise 96 Core License & DVD Unlimited CALs with CoA picture

SQL Server 2022 Enterprise 96 Core License & DVD Unlimited CALs with CoA

$284.99



Ubuntu Server 24.04.1 Bootable Install/Recovery DVD - January 2025 Update picture

Ubuntu Server 24.04.1 Bootable Install/Recovery DVD - January 2025 Update

$8.99