summaryrefslogtreecommitdiffstats
path: root/rules/image-hdimg.make
blob: 82c55d49a855fbc7c753d6237a4cdb17c4210d84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# -*-makefile-*-
#
# Copyright (C) 2014 by Michael Olbrich <m.olbrich@pengutronix.de>
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
IMAGE_PACKAGES-$(PTXCONF_IMAGE_HDIMG) += image-hdimg

#
# Paths and names
#
IMAGE_HDIMG		:= image-hdimg
IMAGE_HDIMG_DIR		:= $(BUILDDIR)/$(IMAGE_HDIMG)
IMAGE_HDIMG_IMAGE	:= $(IMAGEDIR)/hd.img
IMAGE_HDIMG_CONFIG	:= hd.config

# ----------------------------------------------------------------------------
# Image
# ----------------------------------------------------------------------------

ifdef PTXCONF_IMAGE_HDIMG
IMAGE_HDIMG_BOOTLOADER_ENV := \
	BOOTLOADER_IMAGES='' \
	BOOTLOADER_PARTITIONS=''

ifdef PTXCONF_IMAGE_HDIMG_GRUB
IMAGE_HDIMG_BOOTLOADER_ENV = \
	GRUB_STAGE_DIR=$(GRUB_STAGE_DIR) \
	BOOTLOADER_IMAGES='include("grub.config")' \
	BOOTLOADER_PARTITIONS='include("grub_partitions.config")'
endif
ifdef PTXCONF_IMAGE_HDIMG_BAREBOX
IMAGE_HDIMG_BOOTLOADER_ENV := \
	BOOTLOADER_IMAGES='' \
	BOOTLOADER_PARTITIONS='include("barebox_partitions.config")'
endif
ifdef PTXCONF_IMAGE_HDIMG_VFAT
IMAGE_HDIMG_BOOTLOADER_ENV := \
	VFAT_PARTITION_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_BOOT_VFAT_EFI_BAREBOX,0xef,0x0c) \
	BOOTLOADER_IMAGES='' \
	BOOTLOADER_PARTITIONS='include("vfat_partitions.config")'
endif

IMAGE_HDIMG_ENV = \
	$(IMAGE_HDIMG_BOOTLOADER_ENV)

$(IMAGE_HDIMG_IMAGE):
	@$(call targetinfo)
	@$(call image/genimage, IMAGE_HDIMG)
	@$(call finish)
endif

# vim: syntax=make