2006-06-27 03:35:46 +03: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 06:13:25 +03:00
|
|
|
include $(TOPDIR)/rules.mk
|
2006-06-21 05:32:39 +03:00
|
|
|
include $(INCLUDE_DIR)/image.mk
|
2005-07-25 18:40:23 +03:00
|
|
|
|
2006-10-08 18:48:56 +03: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-27 08:23:00 +03:00
|
|
|
block2mtd.block2mtd=$(CONFIG_X86_GRUB_ROOTPART),65536 root=/dev/mtdblock0 rootfstype=jffs2
|
2006-10-08 18:48:56 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/cmdline/jffs2-128k
|
2006-10-27 08:23:00 +03:00
|
|
|
block2mtd.block2mtd=$(CONFIG_X86_GRUB_ROOTPART),131072 root=/dev/mtdblock0 rootfstype=jffs2
|
2006-10-08 18:48:56 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/cmdline/ext2
|
2006-10-25 01:33:23 +03:00
|
|
|
root=$(CONFIG_X86_GRUB_ROOTPART) rootfstype=ext2 $(CONFIG_X86_GRUB_BOOTOPTS)
|
2006-10-08 18:48:56 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build/grub
|
2006-10-26 02:52:17 +03:00
|
|
|
mkdir -p $(KDIR)/root.grub/boot/grub
|
2006-10-08 18:48:56 +03: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 06:27:24 +03: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 18:48:56 +03:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2006-06-05 00:57:59 +03:00
|
|
|
define Image/Build
|
2006-10-08 18:48:56 +03:00
|
|
|
$(call Image/Build/grub,$(1))
|
|
|
|
cp $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).fs
|
2006-08-25 12:28:15 +03:00
|
|
|
cp $(LINUX_DIR)/arch/i386/boot/bzImage $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz
|
2006-06-05 00:57:59 +03:00
|
|
|
endef
|
2005-07-25 18:40:23 +03:00
|
|
|
|
2006-10-08 18:48:56 +03:00
|
|
|
|
2006-06-05 00:57:59 +03:00
|
|
|
$(eval $(call BuildImage))
|