Full training initramfs - Jumpin'Jack Flash initramfs Kernel

  • +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    How to enable gutemine's Jumpin'Jack Flash initramfs Kernel in your image
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


    First you need the initramfs*.tar.gz File which contains this README.TXT


    Second you need an up-to-date OE 2.0 environment of the experimental branch for you Dreambox,
    and an image for the wanted Dreambox has to be allready built so that all needed
    packages are already present and working.


    Unpack the initramfs*.tar.gz with tar -xvzf initramfs.*.tar.gz to get this README.TXT
    and the initramfs init binary.


    First you have to check the kernel config by looking
    into the defconfig file of the kernel:


    Got to this directory and adapt the defconfig file (replace dmXXXX with your boxtype and instead of
    opendreambox use the full path to you OE 2.0 opendreambox directory)


    cd opendreambox/meta-bsp/dmXXXX/recipes/linux/linux-dreambox-3.2


    In your defconfig there should be already this:


    CONFIG_BLK_DEV_LOOP=y


    change from =2 to =8 the following line below:


    CONFIG_BLK_DEV_LOOP_MIN_COUNT=8


    finally this should be be added:


    CONFIG_BLK_DEV_INITRD=y
    CONFIG_INITRAMFS_SOURCE=""


    This are all the needed changes for your kernel config !!!


    Next you have to adapt all the gen_initramfs_list.sh


    Go to the following directory:


    cd opendreambox/tmp/work/dmXXXX-oe-linux


    Then use the below find command to get a list off all 3 locations of this script:


    find . -name gen_initramfs_list.sh
    ./linux-dreambox/linux-dreambox-3.2-r7.11-bsp1/sysroot-destdir/kernel/scripts/gen_initramfs_list.sh
    ./linux-dreambox/linux-dreambox-3.2-r7.11-bsp1/image/kernel/scripts/gen_initramfs_list.sh
    ./linux-dreambox/linux-dreambox-3.2-r7.11-bsp1/linux-3.2/scripts/gen_initramfs_list.sh


    The first time it is recommended to change all 3 of them.


    Change the following routine in this script:


    list_default_initramfs() {
    # echo usr/kinit/kinit
    :
    }


    default_initramfs() {
    cat <<-EOF >> ${output}
    # This is a very simple, default initramfs


    dir /dev 0755 0 0
    nod /dev/console 0600 0 0 c 5 1
    dir /root 0700 0 0
    # file /kinit usr/kinit/kinit 0755 0 0
    # slink /init kinit 0755 0 0
    EOF
    }


    You simply remove the # from 3 lines in the shellscript so that the initramfs gets included during the kernel build:


    list_default_initramfs() {
    echo usr/kinit/kinit
    :
    }


    default_initramfs() {
    cat <<-EOF >> ${output}
    # This is a very simple, default initramfs


    dir /dev 0755 0 0
    nod /dev/console 0600 0 0 c 5 1
    dir /root 0700 0 0
    file /kinit usr/kinit/kinit 0755 0 0
    slink /init kinit 0755 0 0
    EOF
    }



    Then you change directory to the following path of your OE:


    cd opendreambox/tmp/work/dmXXXX-oe-linux/linux-dreambox/linux-dreambox-3.2-r7.11-bsp1/linux-3.2/usr


    There you have to do the following task:


    mkdir kinit
    cd kinit
    cp /your_path_with_the_extracted_init/kinit kinit
    chmod 755 kinit


    This is the staging area for the initramfs. Jumpin'Jack Flash doesn't need
    any more (device) files there.


    Alternatively you could use the initramfs.patch file for doing all these above changes to the
    script and the kinit directory.


    Then you are already finished with your preparation, move one directory up
    and remove the vmlinux kernel file to make sure that it is re-compiled and
    then start the re-compile:


    cd ..
    rm vmlinux
    rm vmlinux.o


    Then make sure that all steps are re-run by deleting the stamps for the linux-dreambox-3.2* tasks.
    This is needed only the first time:


    cd opendreambox/tmp/stamps/dmXXXX-oe-linux
    rm linux-dreambox-3.2*


    Then simply re-run the build tasks for the linux kernel:


    cd opendreambox
    source bitbake.env


    cd build/dmXXXX


    Then you re-build to check if everything still works and you didn't do any mistake during the
    above changes:


    bitbake linux-dreambox-3.2


    If the above still works, it should be sufficient to just re-run the compile step if you replace for example
    the init binary with a newer one:


    bitbake -f -c compile linux-dreambox-3.2


    Please check in another terminal windows if after the do_unpack phase the gen*.sh script at
    opendreambox/tmp/work/dmXXXX-oe-linux/linux-dreambox/linux-dreambox-3.2-r7.11-bsp1/linux-3.2/scripts
    till has the 3 # removed, if not then remove them quickly that it will be patched
    when the compilation phase runs of the above bitbake. This happens only if you did
    the removing of the stamps files as described above, because then the sources
    will be re-copied and if you did the changes manually instead of using the
    initramfs.patch file they will get lost.


    You were successfull when an initramfs_data.cpio file with about 64k shows up in the
    opendreambox/tmp/work/dmXXXX-oe-linux/linux-dreambox/linux-dreambox-3.2-r7.11-bsp1/linux-3.2/usr directory.


    You can check this by typing:


    ls -alh opendreambox/tmp/work/dmXXXX-oe-linux/linux-dreambox/linux-dreambox-3.2-r7.11-bsp1/linux-3.2/usr


    If the bitbake -f -c compile linux-dreambox-3.2 runs trough without errors you have build successfully a linux
    kernel for your dreambox with the Jumpin 'Jack Flash initramfs kernel.


    You can check this by typing:


    cd opendreambox/tmp/work/dmXXXX-oe-linux/linux-dreambox/linux-dreambox-3.2-r7.11-bsp1/linux-3.2


    ls -al vmlinux


    For verification you may check if this vmlinux kernel contains the initramfs code:


    strings vmlinux | grep initra


    This should give the following output:


    init/initramfs.c
    <6>Trying to unpack rootfs image as initramfs...
    <6>rootfs image is not initramfs (%s); looks like an initrd
    Jumpin'Jack Flash initramfs by gutemine
    initramfs.cpio


    You can now compress this vmlinux file with gzip vmlinux to get a
    vmlinux.gz that you can directly put in the /boot directoy of your dreambox.


    Don't forget a mount -o remount,rw /boot so that the directory is writeable.


    OR you can now build an entire image with make image which
    would produce an nfi imagefile already containing the enhanced kernel.


    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Have fun building Kernels and Images with Jumpin'Jack Flash initramfs
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!