2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/image.mk
10 ifeq ($(CONFIG_X86_GRUB_IMAGES
),y
)
12 $(MAKE
) -C grub compile
19 define Image
/cmdline
/jffs2-64k
20 block2mtd.block2mtd
=/dev
/hda2
,65536 root
=/dev
/mtdblock0 rootfstype
=jffs2
23 define Image
/cmdline
/jffs2-128k
24 block2mtd.block2mtd
=/dev
/hda2
,131072 root
=/dev
/mtdblock0 rootfstype
=jffs2
27 define Image
/cmdline
/ext2
28 root
=$(CONFIG_X86_GRUB_ROOTPART
) rootfstype
=ext2
$(CONFIG_X86_GRUB_BOOTOPTS
)
31 define Image
/Build
/grub
32 mkdir
-p
$(KDIR
)/root.grub
/boot
/grub
34 $(STAGING_DIR
)/usr
/lib
/grub
/i386-pc
/stage1 \
35 $(STAGING_DIR
)/usr
/lib
/grub
/i386-pc
/stage2 \
36 $(STAGING_DIR
)/usr
/lib
/grub
/i386-pc
/e2fs_stage1_5 \
37 $(KDIR
)/root.grub
/boot
/grub
/
38 $(CP
) $(LINUX_DIR
)/arch
/i386
/boot
/bzImage
$(KDIR
)/root.grub
/boot
/vmlinuz
40 -e
's#@CMDLINE@#$(strip $(call Image/cmdline/$(1)))#g' \
41 -e
's#@BAUDRATE@#$(CONFIG_X86_GRUB_BAUDRATE)#g' \
42 .
/grub
/menu.lst
> $(KDIR
)/root.grub
/boot
/grub
/menu.lst
43 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)
48 $(call Image
/Build
/grub
,$(1))
49 cp
$(KDIR
)/root.
$(1) $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(1).fs
50 cp
$(LINUX_DIR
)/arch
/i386
/boot
/bzImage
$(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-vmlinuz
54 $(eval
$(call BuildImage
))