Changeset 327


Ignore:
Timestamp:
Feb 15, 2012, 8:29:29 PM (8 years ago)
Author:
amain
Message:

Add alternate boot script support(kexec and LABEL=)

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.in

    r315 r327  
    779779        default n
    780780
    781 config CMDLINE_BOOL
    782         bool
    783         default y
    784 
    785 #CONFIG_CMDLINE="root=/dev/sda1 init=/sbin/init rootdelay=10 noinitrd console=ttyS0,115200"
    786 # default "root=/dev/sda1 init=/sbin/init rootdelay=15 noinitrd console=ttyS0,115200"
    787 # default "root=/dev/sda1 init=/sbin/init rootdelay=15 noinitrd console=ttyS0,115200 netconsole=6665@10.0.2.1/eth0,6666@10.0.2.2"
    788 config CMDLINE
    789         string "Default kernel command line"
    790         default "root=/dev/sda1 init=/sbin/init rootdelay=15 noinitrd console=ttyS0,115200 netconsole=6665@192.168.1.1/eth0,6666@192.168.1.2/"
    791         help
    792           Override OpenWrt default kernel command line. Tell the kernel to boot from /dev/sda1,
    793           an USB storage device. Rootdelay is specified, to give the USB storage/SCSI driver
    794           to become ready, before the kernel tries to boot from it.
    795 
    796781endmenu
    797782
     
    874859
    875860endmenu
     861
     862
     863menu "DebWrt boot options"
     864
     865choice
     866    prompt "Boot method"
     867        default BOOT_METHOD_SCRIPT
     868        help
     869          Select how DebWrt should boot
     870
     871config BOOT_METHOD_SCRIPT
     872        bool "Use DebWrt boot script"
     873        help
     874          Auto discover root device, optionally kexec to a alternate kernel and boot from this device.
     875          .
     876          Normally DebWrt boots directly from the root= device. With this option enabled, DebWrt boots initially
     877          from /dev/mtdblock2 and runs an alternate boot script (/etc/preinit). This scripts discovers block
     878          devices and will look for a device with a label of DEBWRT_ROOT or fall back to /dev/sda1. And mounts it.
     879          .
     880          Next it will kexec to /boot/vmlinux.elf if it exits on the DEBWRT_ROOT device.
     881          .
     882          After mounting ( or kexec ), a pivot_root to the DEBWRT_ROOT device is done and /sbin/init is executed.
     883
     884config BOOT_METHOD_DEVICE
     885        bool "Directly boot from device /dev/sda1"
     886
     887endchoice
     888
     889config CMDLINE_BOOL
     890        bool
     891        default y
     892        depends BOOT_METHOD_DEVICE
     893
     894#CONFIG_CMDLINE="root=/dev/sda1 init=/sbin/init rootdelay=10 noinitrd console=ttyS0,115200"
     895# default "root=/dev/sda1 init=/sbin/init rootdelay=15 noinitrd console=ttyS0,115200"
     896# default "root=/dev/sda1 init=/sbin/init rootdelay=15 noinitrd console=ttyS0,115200 netconsole=6665@10.0.2.1/eth0,6666@10.0.2.2"
     897# TODO: use patch-kernel script to append only netconsole=6665@192.168.1.1/eth0,6666@192.168.1.2/ to OpenWrt default cmdline"
     898#       for now netconsole can't be set when BOOT_METHOD_SCRIPT
     899config CMDLINE
     900        string "Default kernel command line"
     901        default "root=/dev/sda1 init=/sbin/init rootdelay=15 noinitrd console=ttyS0,115200 netconsole=6665@192.168.1.1/eth0,6666@192.168.1.2/"
     902        depends BOOT_METHOD_DEVICE
     903        help
     904          Override OpenWrt default kernel command line. Tell the kernel to boot from /dev/sda1,
     905          an USB storage device. Rootdelay is specified, to give the USB storage/SCSI driver
     906          to become ready, before the kernel tries to boot from it.
     907
     908source "config/kexec2.in"
     909
     910endmenu
     911
     912
     913
    876914
    877915source "config/debian_release.in"
  • trunk/openwrt/openwrt.mk

    r302 r327  
    4141  openwrt/checkout \
    4242  openwrt/patch \
     43  openwrt/files-copy \
    4344  plugins/apply-openwrt \
    4445  openwrt/merge-config \
     
    9596        touch $@
    9697
     98openwrt/files-copy: openwrt/patch
     99        cd $(FILES_DIR_OPENWRT); find -type f | while read f; do \
     100           mkdir -p $(OPENWRT_BUILD_DIR)/$$(dirname $$f); \
     101           cp -v $$f $(OPENWRT_BUILD_DIR)/$$(dirname $$f) ;\
     102        done
     103        touch $@
     104
    97105$(OPENWRT_BUILD_DIR)/.debwrt.checkout.stamp:
    98106openwrt/checkout: $(OPENWRT_BUILD_DIR)/.debwrt.checkout.stamp
     
    136144        rm -f openwrt/checkout
    137145        rm -f openwrt/patch
     146        rm -f openwrt/copy-files
  • trunk/rules/debwrt.mk

    r300 r327  
    9494PATCHES_DIR_OPENWRT=$(TOPDIR)/openwrt/patches
    9595
     96# OpenWrt files directory
     97FILES_DIR_OPENWRT=$(TOPDIR)/openwrt/files
     98
    9699# OpenWrt Build (checkout) directory
    97100OPENWRT_BUILD_DIR:=$(BUILD_DIR_BASE)/openwrt-$(BOARD)-$(SUB_BOARD)-$(OPENWRT_REVISION)-$(LINUX_VERSION)
Note: See TracChangeset for help on using the changeset viewer.