User Tools

Site Tools

This wiki is read only and for archival purposes only. >>>>>>>>>> Please use the new OpenWrt wiki at <<<<<<<<<<

A short success story with kexec.

I have a working kexeced system on a TP-Link TL-WR741ND. After making the usb mod, i've started from this two topics: And after some more experimentig, i ended up with a working kexeced system.

Preparation of the usb bootable system - step by step

  1. Download the sources. I downloaded a full fresh copy of the build system with this command: svn checkout - Change directory to bildroot: cd backfire - Update the feeds: ./scripts/feeds update - Install the feeds: ./scripts/feeds install -a - make V=99 defconfig - Execute make menuconfig. In my case i selected the followings:
    Target System → Atheros AR71xx/AR7240/AR913x
    Target Profile → TP-LINK TL-WR741ND v1
    Target Images → * ramdisk → Compression → lzma
    Target Images → * tar.gz
    Kernel modules → Filesystems → * kmod-fs-ext2 and * kmod-fs-ext3
    Kernel modules → USB Support → * kmod-usb-core and * kmod-usb-ohci and * kmod-usb-storage
    Utilities → * kexec tools → Configuration → (mips) Target name for kexec kernel
    Exit from menu and save configuration. -
    make V=99
    if it's not successful, then solve the problem somehow - I modified the files: "
    ./build_dir/linux-ar71xx/linux-" and "./build_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-"
    In the 55th line i changed from:
    kexec_start_address = image→start;
    kexec_start_address = (unsigned long) phys_to_virt(image→start);
    in both files. - For the USB support, i modified two files:
    at the
    config AR71XX_MACH_TL_WR741ND
    section i inserted that line:
    select AR71XX_DEV_USB
    below the line:
    select AR71XX_DEV_LEDS_GPIO
    it was the 176th line.
    and in
    at the includes, i inserted that line:
    #include "dev-usb.h"
    below the line: #include "dev-leds-gpio.h"
    it was the 22nd line.
    And in the
    static void __init tl_wr741nd_setup(void)
    function i inserted:
    below the line:
    u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
    it was the 102nd line
    (the line numbers are the insertion points) - Run "
    make kernel_menuconfig" and select:
    Kernel type → * Kexec system call
    General setup → * Support initial ramdisks compressed using LZMA and Built-in initramfs compression mode –> LZMA
    Device Drivers → SCSI device support → M SCSI device support and M SCSI disk support and * Probe all LUNs on each SCSI device
    Device Drivers → USB support → M Support for Host-side USB and M OHCI HCD support → * USB OHCI support for Atheros AR71xx and M USB Mass Storage support and optionally if you want to see messages in dmesg output, when connecting or disconnecting usb devices: * USB announce new devices
    Kernel hacking → Default kernel command string → rootfstype=ext2 noinitrd console=ttyS0,115200 board=TL-WR741ND - Modify ./package/base-files/files/etc/preinit
    add the line:
    right after line
    . /etc/
    Optionally you can modify
    Line 50 from:
    mount $rootfs /mnt
    mount $rootfs /mnt -o noatime
    to make sure, that the access time of the read files is not stored on the USB drive. It may be important if you consider to use Flash based storage, because blocks wear out earlier if we write every time, when a file is accessed. -
    make clean - make V=99 - Repeat step 8, because the clean made some trouble, but the clean is necessary for the USB patch to work (at least it doesn't work for me without clean). - make V=99 - partition a usb flash or disk and format the 1st partition to ext2 - extract the content of ./bin/ar71xx/openwrt-ar71xx-rootfs.tar.gz to the root of the newly created file system - copy ./bin/ar71xx/openwrt-ar71xx-vmlinux-initramfs.elf'' to the same place
    (to be continued)
doc/howto/kexec.txt · Last modified: 2012/02/09 17:48 by mateakos