2006-06-27 00:35:46 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2006-06-21 03:13:25 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
2006-06-21 02:32:39 +00:00
|
|
|
include $(INCLUDE_DIR)/image.mk
|
2005-07-25 15:40:23 +00:00
|
|
|
|
2006-10-31 22:49:02 +00:00
|
|
|
ROOTPART=$(strip $(subst ",, $(CONFIG_X86_GRUB_ROOTPART)))
|
2006-10-31 22:53:31 +00:00
|
|
|
#")) # fix vim's broken syntax highlighting
|
2006-10-31 22:49:02 +00:00
|
|
|
|
|
|
|
|
2006-10-08 15:48:56 +00:00
|
|
|
ifeq ($(CONFIG_X86_GRUB_IMAGES),y)
|
|
|
|
define Build/Compile
|
|
|
|
$(MAKE) -C grub compile
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Clean
|
|
|
|
$(MAKE) -C grub clean
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/cmdline/jffs2-64k
|
2006-10-31 22:49:02 +00:00
|
|
|
block2mtd.block2mtd=$(ROOTPART),65536 root=/dev/mtdblock0 rootfstype=jffs2
|
2006-10-08 15:48:56 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/cmdline/jffs2-128k
|
2006-10-31 22:49:02 +00:00
|
|
|
block2mtd.block2mtd=$(ROOTPART),131072 root=/dev/mtdblock0 rootfstype=jffs2
|
2006-10-08 15:48:56 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/cmdline/ext2
|
2006-10-31 22:49:02 +00:00
|
|
|
root=$(ROOTPART) rootfstype=ext2 $(CONFIG_X86_GRUB_BOOTOPTS)
|
2006-10-08 15:48:56 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build/grub
|
2006-10-25 23:52:17 +00:00
|
|
|
mkdir -p $(KDIR)/root.grub/boot/grub
|
2006-10-08 15:48:56 +00:00
|
|
|
$(CP) \
|
|
|
|
$(STAGING_DIR)/usr/lib/grub/i386-pc/stage1 \
|
|
|
|
$(STAGING_DIR)/usr/lib/grub/i386-pc/stage2 \
|
|
|
|
$(STAGING_DIR)/usr/lib/grub/i386-pc/e2fs_stage1_5 \
|
|
|
|
$(KDIR)/root.grub/boot/grub/
|
|
|
|
$(CP) $(LINUX_DIR)/arch/i386/boot/bzImage $(KDIR)/root.grub/boot/vmlinuz
|
|
|
|
sed \
|
|
|
|
-e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1)))#g' \
|
|
|
|
-e 's#@BAUDRATE@#$(CONFIG_X86_GRUB_BAUDRATE)#g' \
|
|
|
|
./grub/menu.lst > $(KDIR)/root.grub/boot/grub/menu.lst
|
2006-10-19 03:27:24 +00:00
|
|
|
PATH="$(STAGING_DIR)/usr/sbin:$(STAGING_DIR)/bin:$(PATH)" ./gen_image.sh $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).image $(CONFIG_X86_GRUB_KERNELPART) $(KDIR)/root.grub $(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
|
2006-10-08 15:48:56 +00:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2006-06-04 21:57:59 +00:00
|
|
|
define Image/Build
|
2006-10-08 15:48:56 +00:00
|
|
|
$(call Image/Build/grub,$(1))
|
|
|
|
cp $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).fs
|
2006-08-25 09:28:15 +00:00
|
|
|
cp $(LINUX_DIR)/arch/i386/boot/bzImage $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz
|
2006-06-04 21:57:59 +00:00
|
|
|
endef
|
2005-07-25 15:40:23 +00:00
|
|
|
|
2006-10-08 15:48:56 +00:00
|
|
|
|
2006-06-04 21:57:59 +00:00
|
|
|
$(eval $(call BuildImage))
|