gemini: drop unnecessary images
[openwrt/staging/wigyori.git] / target / linux / gemini / image / Makefile
1 #
2 # Copyright (C) 2009-2018 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 # Cook a "WRGG" image, this board is apparently one in the D-Link
11 # WRGG family and uses the exact same firmware format as other
12 # D-Link devices.
13 define Build/dir685-images
14 mkwrggimg -i $(IMAGE_KERNEL) \
15 -o $@.new \
16 -d /dev/mtdblock/1 \
17 -s wrgns01_dlwbr_dir685RBWW \
18 -v 'N/A' \
19 -m dir685 \
20 -B 96bb
21
22 mv $@.new $@
23 endef
24
25 # Build D-Link DNS-313 images using the special header tool.
26 # rootfs.tgz and rd.tgz contains nothing, we only need them
27 # to satisfy the boot loader on the device. The zImage is
28 # the only real content.
29 define Build/dns313-images
30 mkdir -p $@.tmp/.boot
31
32 echo "dummy" > $@.tmp/dummyfile
33
34 dns313-header $@.tmp/dummyfile \
35 $@.tmp/.boot/rootfs.tgz
36 dns313-header $@.tmp/dummyfile \
37 $@.tmp/.boot/rd.gz
38 dns313-header $(IMAGE_KERNEL) \
39 $@.tmp/.boot/zImage
40
41 tar --sort=name --owner=0 --group=0 --numeric-owner -czf $@ \
42 -C $@.tmp .boot \
43 $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)")
44
45 rm -rf $@.tmp
46 endef
47
48 # Create the special NAS4220B and Itian Square One SQ201 image
49 # format with the squashfs and overlay inside the "rd.gz" file.
50 # We pad it out to 6144K which is the size of the initramfs partition.
51 #
52 # The "application" partition is just blank. You can put anything
53 # there when using OpenWRT. We just use that to create the
54 # "sysupgrade" firmware image.
55 define Build/nas4220b-sq201-images
56 mkdir -p $@.tmp
57
58 mv $@ $@.tmp/rd.gz
59 dd if=/dev/zero of=$@.tmp/hddapp.tgz bs=6144k count=1
60 cp $(IMAGE_KERNEL) $@.tmp/zImage
61 cp ./ImageInfo-$(1) $@.tmp/ImageInfo
62
63 (cd $@.tmp; tar --sort=name --owner=0 --group=0 --numeric-owner -czf $@ * \
64 $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)"))
65
66 rm -rf $@.tmp
67 endef
68
69 # WBD-111 and WBD-222:
70 # work around the bootloader's bug with extra nops
71 # FIXME: is this really needed now that we no longer append the code
72 # to change the machine ID number? Needs testing on Wiliboard.
73 define Build/wbd-nops
74 mv $@ $@.tmp
75 echo -en "\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $@
76 cat $@.tmp >> $@
77 rm -f $@.tmp
78 endef
79
80 # All DTB files are prefixed with "gemini-"
81 define Device/Default
82 PROFILES := Default
83 DEVICE_DTS := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTS_DIR))/*-$(1).dtb)))
84 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
85 KERNEL_NAME := zImage
86 KERNEL := kernel-bin | append-dtb
87 FILESYSTEMS := squashfs
88 IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
89 BLOCKSIZE := 128k
90 PAGESIZE := 2048
91 endef
92
93 # A reasonable set of default packages handling the NAS type
94 # of devices out of the box (former NAS42x0 IcyBox defaults)
95 GEMINI_NAS_PACKAGES:=kmod-md-mod kmod-md-linear kmod-md-multipath \
96 kmod-md-raid0 kmod-md-raid1 kmod-md-raid10 kmod-md-raid456 \
97 kmod-fs-btrfs kmod-fs-cifs kmod-fs-nfs \
98 kmod-fs-nfsd kmod-fs-ntfs kmod-fs-reiserfs kmod-fs-vfat \
99 kmod-nls-utf8 kmod-usb-storage-extras \
100 samba36-server mdadm cfdisk fdisk e2fsprogs badblocks
101
102 define Device/dlink-dir-685
103 DEVICE_TITLE := D-Link DIR-685 Xtreme N Storage Router
104 DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) \
105 kmod-switch-rtl8366rb swconfig \
106 rt2800-pci
107 IMAGES := factory.bin
108 IMAGE/factory.bin := dir685-images
109 endef
110 TARGET_DEVICES += dlink-dir-685
111
112 define Device/dlink-dns-313
113 DEVICE_TITLE := D-Link DNS-313 1-Bay Network Storage Enclosure
114 DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES)
115 IMAGES := factory.bin
116 IMAGE/factory.bin := dns313-images
117 endef
118 TARGET_DEVICES += dlink-dns-313
119
120 define Device/nas4220b-sq201
121 IMAGES := factory.bin
122 IMAGE/factory.bin := append-rootfs | pad-to 6144k | nas4220b-sq201-images $(1)
123 DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES)
124 endef
125
126 define Device/nas4220b
127 $(Device/nas4220b-sq201)
128 DEVICE_TITLE := Raidsonic NAS IB-4220-B
129 endef
130 TARGET_DEVICES += nas4220b
131
132 define Device/rut1xx
133 DEVICE_TITLE := Teltonika RUT1xx
134 DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES)
135 endef
136 TARGET_DEVICES += rut1xx
137
138 define Device/sq201
139 $(Device/nas4220b-sq201)
140 DEVICE_TITLE := ITian Square One SQ201
141 DEVICE_PACKAGES += rt61-pci usb2-pci
142 endef
143 TARGET_DEVICES += sq201
144
145 define Device/wbd111
146 DEVICE_TITLE := Wiliboard WBD-111
147 KERNEL := kernel-bin | append-dtb | wbd-nops
148 endef
149 TARGET_DEVICES += wbd111
150
151 define Device/wbd222
152 DEVICE_TITLE := Wiliboard WBD-222
153 KERNEL := kernel-bin | append-dtb | wbd-nops
154 endef
155 TARGET_DEVICES += wbd222
156
157 $(eval $(call BuildImage))