| Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision |
| doc:howto:kexec [2011/11/14 19:15] – mateakos | docs:guide-user:advanced:kexec [2018/10/13 16:56] – Fixed Formatting jw0914 |
|---|
| | ====== Configuring kexec ====== |
| |
| | I have a working kexeced system on a TP-Link TL-WR741ND. |
| | After making the USB mod, and additional experimenting, I ended up with a working kexeced system. |
| | |
| | ===== Prepare USB Bootable System ===== |
| | |
| | - **Download sources:** <code bash>svn checkout svn://svn.openwrt.org/openwrt/branches/backfire</code> |
| | - **Change directory to bildroot, then update & install feeds:** <code bash>cd backfire && ./scripts/feeds update && ./scripts/feeds install -a</code> |
| | - **Create defconfig and enter MenuConfig:** <code bash>make V=s defconfig && make menuconfig</code> |
| | - **Select the following:** |
| | - ''Target System'' <wrap em><wrap em>-></wrap></wrap> ''Atheros AR71xx/AR7240/AR913x'' |
| | - ''Target Profile'' <wrap em>-></wrap> ''TP-LINK TL-WR741ND v1'' |
| | - ''Target Images'' <wrap em>-></wrap> ''ramdisk'' <wrap em>-></wrap> ''Compression'' <wrap em>-></wrap> ''lzma'' |
| | - ''Target Images'' <wrap em>-></wrap> ''tar.gz''\\ \\ |
| | - ''Kernel modules'' <wrap em>-></wrap> ''Filesystems'' <wrap em>-></wrap> |
| | - ''kmod-fs-ext2'' |
| | - ''kmod-fs-ext3''\\ \\ |
| | - ''Kernel modules'' <wrap em>-></wrap> ''USB Support'' <wrap em>-></wrap> ''kmod-usb-core'' |
| | - ''kmod-usb-ohci'' |
| | - ''kmod-usb-storage''\\ \\ |
| | - ''Utilities'' <wrap em>-></wrap> ''kexec tools'' <wrap em>-></wrap> ''Configuration'' <wrap em>-></wrap> ''(mips) Target name for kexec kernel''\\ \\ |
| | - **Exit from menu and save configuration**\\ \\ |
| | - <code bash>make V=s</code> |
| | - **Modify:** |
| | - **''./build_dir/linux-ar71xx/linux-2.6.32.27/arch/mips/kernel/machine_kexec.c''** |
| | - **Change Line 55 to:** ''kexec_start_address = (unsigned long) phys_to_virt(image<wrap em>-></wrap>start);''\\ \\ |
| | - **''./build_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/linux-2.6.32.27/arch/mips/kernel/machine_kexec.c''** |
| | - **Change Line 55 to:** ''kexec_start_address = (unsigned long) phys_to_virt(image<wrap em>-></wrap>start);''\\ \\ |
| | - **For USB support:** |
| | - **''./target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig''** |
| | - **Add new line 176 //(under ''config AR71XX_MACH_TL_WR741ND'')//:** ''select AR71XX_DEV_USB''\\ \\ |
| | - **''./target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c''** |
| | - **Add Line 22 //(under ''includes'')//:** ''#include "dev-usb.h"'' |
| | - **Add line 102 //(under ''static void __init tl_wr741nd_setup(void)'')//:** ''ar71xx_add_device_usb();''\\ \\ |
| | - <code bash>make kernel_menuconfig</code> |
| | - **Select the following:** |
| | - ''Kernel type'' <wrap em>-></wrap> ''Kexec system call''\\ \\ |
| | - ''General setup'' <wrap em>-></wrap> ''Support initial ramdisks compressed using LZMA'' |
| | - ''Built-in initramfs compression mode'' <wrap em>-></wrap> ''LZMA''\\ \\ |
| | - ''Device Drivers'' <wrap em>-></wrap> ''SCSI device support'' <wrap em>-></wrap> ''M SCSI device support'' |
| | - ''M SCSI disk support'' |
| | - ''Probe all LUNs on each SCSI device''\\ \\ |
| | - ''Device Drivers'' <wrap em>-></wrap> ''USB support'' <wrap em>-></wrap> ''M Support for Host-side USB'' |
| | - ''M OHCI HCD support'' <wrap em>-></wrap> ''USB OHCI support for Atheros AR71xx'' |
| | - ''M USB Mass Storage support'' |
| | - ''USB announce new devices''\\ \\ |
| | - ''Kernel hacking'' <wrap em>-></wrap> ''Default kernel command string'' <wrap em>-></wrap> ''rootfstype=ext2 noinitrd console=ttyS0,115200 board=TL-WR741ND''\\ \\ |
| | - **Modify: ''./package/base-files/files/etc/preinit''** |
| | - **Below ''. /etc/diag.sh'', add line:** ''rootfs=/dev/sda1''\\ \\ |
| | - **Optionally you can modify: ''./target/linux/generic-2.6/base-files/init''** |
| | - **Change line 50 to:** ''mount $rootfs /mnt -o noatime'' |
| | * //Blocks wear out faster if written to every time a file is accessed//\\ \\ |
| | - <code bash>make clean && make V=s</code> |
| | - **Repeat Step 5** |
| | * //Clean operation creates issues, however it's necessary for the USB patch to work//\\ \\ |
| | - <code bash>make V=s</code> |
| | - Partition external storage and format 1st partition as ext2\\ \\ |
| | - Extract the content of **''./bin/ar71xx/openwrt-ar71xx-rootfs.tar.gz''** to the root of the newly created file system |
| | - Also copy over **''./bin/ar71xx/openwrt-ar71xx-vmlinux-initramfs.elf''** |
| | //(to be continued)// |