I have a working kexeced system on a TP-Link TL-WR741ND. After making the usb mod, i've started from this two topics: https://forum.openwrt.org/viewtopic.php?id=23901 https://forum.openwrt.org/viewtopic.php?id=24124 And after some more experimentig, i ended up with a working kexeced system.
- Download the sources. I downloaded a full fresh copy of the build system with this command:
svn checkout svn://svn.openwrt.org/openwrt/branches/backfire
- Change directory to bildroot:
- Update the feeds:
- Install the feeds:
./scripts/feeds install -a
make V=99 defconfig
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-ext2and
Kernel modules → USB Support → * kmod-usb-coreand
Utilities → * kexec tools → Configuration → (mips) Target name for kexec kernel
Exit from menu and save configuration.
if it's not successful, then solve the problem somehow
- I modified the files: "
./build_dir/linux-ar71xx/linux-188.8.131.52/arch/mips/kernel/machine_kexec.c" and "
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:
section i inserted that line:
below the line:
it was the 176th line.
at the includes, i inserted that line:
#include "dev-usb.h"#include "dev-leds-gpio.h"
below the line:
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 LZMAand
Built-in initramfs compression mode –> LZMA
Device Drivers → SCSI device support → M SCSI device supportand
M SCSI disk supportand
* Probe all LUNs on each SCSI device
Device Drivers → USB support → M Support for Host-side USBand
M OHCI HCD support → * USB OHCI support for Atheros AR71xxand
M USB Mass Storage supportand 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
add the line:
right after line
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.
- 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).
- partition a usb flash or disk and format the 1st partition to ext2
- extract the content of
./bin/ar71xx/openwrt-ar71xx-rootfs.tar.gzto the root of the newly created file system
./bin/ar71xx/openwrt-ar71xx-vmlinux-initramfs.elfto the same place
(to be continued)
doc/howto/kexec.txt · Last modified: 2012/02/09 17:48 by mateakos