oops... forgot to make x86-2.6 ext2 images use preinit as well :)
[openwrt.git] / target / linux / x86-2.6 / image / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 export PATH=$(TARGET_PATH):/sbin
11 BOOTOPTS=$(strip $(subst ",, $(CONFIG_X86_GRUB_BOOTOPTS)))
12 ROOTPART=$(strip $(subst ",, $(CONFIG_X86_GRUB_ROOTPART)))
13 #"))")) # fix vim's broken syntax highlighting
14
15
16 ifeq ($(CONFIG_X86_GRUB_IMAGES),y)
17 define Build/Compile
18 $(MAKE) -C grub compile
19 endef
20
21 define Build/Clean
22 $(MAKE) -C grub clean
23 endef
24
25 define Image/cmdline/squashfs
26 block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=squashfs init=/etc/preinit
27 endef
28
29 define Image/cmdline/jffs2-64k
30 block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=jffs2 init=/etc/preinit
31 endef
32
33 define Image/cmdline/jffs2-128k
34 block2mtd.block2mtd=$(ROOTPART),131072,rootfs root=/dev/mtdblock0 rootfstype=jffs2 init=/etc/preinit
35 endef
36
37 define Image/cmdline/ext2
38 root=$(ROOTPART) rootfstype=ext2 init=/etc/preinit
39 endef
40
41 define Image/Build/grub
42 # left here because the image builder doesnt need these
43 $(INSTALL_DIR) $(KDIR)/root.grub/boot/grub
44 $(CP) \
45 $(KDIR)/*stage* \
46 $(KDIR)/root.grub/boot/grub/
47 $(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
48 sed \
49 -e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1))) $(BOOTOPTS)#g' \
50 -e 's#@BAUDRATE@#$(CONFIG_X86_GRUB_BAUDRATE)#g' \
51 ./grub/menu.lst > $(KDIR)/root.grub/boot/grub/menu.lst
52 PADDING="$(CONFIG_X86_GRUB_IMAGES_PAD)" 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)
53 $(call Image/Build/grub/$(1))
54 endef
55 endif
56
57 ifeq ($(CONFIG_X86_GRUB_IMAGES),y)
58 define Image/Prepare/grub
59 # for the image builder
60 $(CP) \
61 $(STAGING_DIR)/usr/lib/grub/i386-pc/stage1 \
62 $(STAGING_DIR)/usr/lib/grub/i386-pc/stage2 \
63 $(STAGING_DIR)/usr/lib/grub/i386-pc/e2fs_stage1_5 \
64 $(KDIR)/
65 $(CP) $(STAGING_DIR)/usr/sbin/grub $(STAGING_DIR)/bin
66 endef
67 endif
68
69 define Image/Prepare
70 $(CP) $(LINUX_DIR)/arch/i386/boot/bzImage $(KDIR)/bzImage
71 $(call Image/Prepare/grub)
72 endef
73
74 define Image/Build/squashfs
75 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
76 endef
77
78 define Image/BuildKernel
79 $(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz
80 endef
81
82 define Image/Build
83 $(call Image/Build/$(1))
84 $(call Image/Build/grub,$(1))
85 $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).fs
86 $(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz
87 endef
88
89 $(eval $(call BuildImage))
This page took 0.043908 seconds and 5 git commands to generate.