make console port editable through menuconfig, gzip ext2 images, add suitable defaults for Xen

SVN-Revision: 19612
This commit is contained in:
Jo-Philipp Wich 2010-02-12 19:04:12 +00:00
parent e48f324dc0
commit e0fc8fb6aa
3 changed files with 24 additions and 8 deletions

View File

@ -9,6 +9,13 @@ config X86_GRUB_IMAGES_PAD
bool "Pad GRUB images to filesystem size (for JFFS2)" bool "Pad GRUB images to filesystem size (for JFFS2)"
depends X86_GRUB_IMAGES depends X86_GRUB_IMAGES
config X86_GRUB_CONSOLE
string
prompt "Serial port device"
depends X86_GRUB_IMAGES
default "hvc0" if TARGET_x86_xen_domu
default "ttyS0" if ! TARGET_x86_xen_domu
config X86_GRUB_BAUDRATE config X86_GRUB_BAUDRATE
int "Serial port baud rate" int "Serial port baud rate"
depends X86_GRUB_IMAGES depends X86_GRUB_IMAGES
@ -22,15 +29,17 @@ config X86_GRUB_KERNELPART
config X86_GRUB_ROOTPART config X86_GRUB_ROOTPART
string string
prompt "Root partition on target device" if X86_GRUB_IMAGES prompt "Root partition on target device" if X86_GRUB_IMAGES
default "/dev/sda2" default "/dev/xvda2" if TARGET_x86_xen_domu
default "/dev/sda2" if ! TARGET_x86_xen_domu
help help
The root partition on the final device. If you don't know, The root partition on the final device. If you don't know,
you probably want the default (/dev/hda2). you probably want the default (/dev/sda2).
config X86_GRUB_BOOTOPTS config X86_GRUB_BOOTOPTS
string string
prompt "Extra kernel boot options" if X86_GRUB_IMAGES prompt "Extra kernel boot options" if X86_GRUB_IMAGES
default "" default "xencons=hvc" if TARGET_x86_xen_domu
default "" if ! TARGET_x86_xen_domu
help help
If you don't know, just leave it blank. If you don't know, just leave it blank.

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2006 OpenWrt.org # Copyright (C) 2006-2010 OpenWrt.org
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -20,6 +20,9 @@ ROOTPART=$(strip $(subst ",, $(CONFIG_OLPC_BOOTSCRIPT_ROOTPART)))
endif endif
#"))")) # fix vim's broken syntax highlighting #"))")) # fix vim's broken syntax highlighting
CONSOLE=$(strip $(subst ",, $(CONFIG_X86_GRUB_CONSOLE)))
ifeq ($(CONFIG_X86_GRUB_IMAGES),y) ifeq ($(CONFIG_X86_GRUB_IMAGES),y)
ifneq ($(HOST_OS),Darwin) ifneq ($(HOST_OS),Darwin)
define Image/cmdline/squashfs define Image/cmdline/squashfs
@ -47,6 +50,7 @@ ifneq ($(HOST_OS),Darwin)
$(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz $(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
sed \ sed \
-e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1))) $(BOOTOPTS)#g' \ -e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1))) $(BOOTOPTS)#g' \
-e 's#@CONSOLE@#$(CONSOLE)#g' \
-e 's#@BAUDRATE@#$(CONFIG_X86_GRUB_BAUDRATE)#g' \ -e 's#@BAUDRATE@#$(CONFIG_X86_GRUB_BAUDRATE)#g' \
./menu.lst > $(KDIR)/root.grub/boot/grub/menu.lst ./menu.lst > $(KDIR)/root.grub/boot/grub/menu.lst
PADDING="$(CONFIG_X86_GRUB_IMAGES_PAD)" PATH="$(TARGET_PATH)" ./gen_image_x86.sh $(BIN_DIR)/openwrt-$(BOARD)-$(1).image $(CONFIG_X86_GRUB_KERNELPART) $(KDIR)/root.grub $(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1) PADDING="$(CONFIG_X86_GRUB_IMAGES_PAD)" PATH="$(TARGET_PATH)" ./gen_image_x86.sh $(BIN_DIR)/openwrt-$(BOARD)-$(1).image $(CONFIG_X86_GRUB_KERNELPART) $(KDIR)/root.grub $(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
@ -153,13 +157,16 @@ endef
define Image/Build define Image/Build
$(call Image/Build/$(1)) $(call Image/Build/$(1))
$(call Image/Build/bootscript,$(1)) $(call Image/Build/bootscript,$(1))
ifneq ($(1),iso) ifneq ($(1),iso)
$(call Image/Build/grub,$(1)) $(call Image/Build/grub,$(1))
$(call Image/Build/vdi,$(1)) $(call Image/Build/vdi,$(1))
$(call Image/Build/vmdk,$(1)) $(call Image/Build/vmdk,$(1))
endif endif
$(CP) $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(1).fs $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(1).fs
$(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-$(BOARD)-vmlinuz $(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-$(BOARD)-vmlinuz
ifeq ($(1),ext2)
gzip -f9 $(BIN_DIR)/openwrt-$(BOARD)-$(1).image
endif
endef endef
$(eval $(call BuildImage)) $(eval $(call BuildImage))

View File

@ -6,10 +6,10 @@ timeout 5
title OpenWrt title OpenWrt
root (hd0,0) root (hd0,0)
kernel /boot/vmlinuz @CMDLINE@ noinitrd console=tty0 console=ttyS0,@BAUDRATE@n8 reboot=bios kernel /boot/vmlinuz @CMDLINE@ noinitrd console=tty0 console=@CONSOLE@,@BAUDRATE@n8 reboot=bios
boot boot
title OpenWrt (failsafe) title OpenWrt (failsafe)
root (hd0,0) root (hd0,0)
kernel /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd console=tty0 console=ttyS0,@BAUDRATE@n8 reboot=bios kernel /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd console=tty0 console=@CONSOLE@,@BAUDRATE@n8 reboot=bios
boot boot