OpenWrt – Blame information for rev 3
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 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 | |||
3 | office | 10 | # Just copy the zImage for D-Link DIR-685 |
1 | office | 11 | define Build/dir685-images |
3 | office | 12 | cp $(IMAGE_KERNEL) $(BIN_DIR)/$(IMG_PREFIX)-dir685-zImage |
1 | office | 13 | endef |
14 | |||
15 | # Build D-Link DNS-313 images using the special header tool. |
||
16 | # rootfs.tgz and rd.tgz contains nothing, we only need them |
||
17 | # to satisfy the boot loader on the device. The zImage is |
||
18 | # the only real content. |
||
19 | define Build/dns313-images |
||
3 | office | 20 | if [ -d $(BIN_DIR)/.boot ] ; then rm -rf $(BIN_DIR)/.boot ; fi |
21 | mkdir -p $(BIN_DIR)/.boot |
||
22 | echo "dummy" > $(BIN_DIR)/.boot/dummyfile |
||
23 | dns313-header $(BIN_DIR)/.boot/dummyfile \ |
||
24 | $(BIN_DIR)/.boot/rootfs.tgz |
||
25 | dns313-header $(BIN_DIR)/.boot/dummyfile \ |
||
26 | $(BIN_DIR)/.boot/rd.gz |
||
1 | office | 27 | dns313-header $(IMAGE_KERNEL) \ |
3 | office | 28 | $(BIN_DIR)/.boot/zImage |
29 | rm -f $(BIN_DIR)/.boot/dummyfile |
||
30 | (cd $(BIN_DIR); tar -czf $(IMG_PREFIX)-dns313-bootpart.tar.gz .boot) |
||
31 | if [ -d $(BIN_DIR)/.boot ] ; then rm -rf $(BIN_DIR)/.boot ; fi |
||
1 | office | 32 | endef |
33 | |||
3 | office | 34 | # Create the special NAS4220B image format with the squashfs |
35 | # split across two "partitions" named rd.gz and hddapp.tgz but |
||
36 | # essentially just being used by OpenWRT as one big partition |
||
37 | define Build/nas4220b-images |
||
38 | dd if=$(IMAGE_ROOTFS) of=$(BIN_DIR)/rd.gz bs=6144k conv=sync |
||
39 | dd if=$(IMAGE_ROOTFS) of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1 seek=1 |
||
40 | cp $(IMAGE_KERNEL) $(BIN_DIR)/zImage |
||
41 | cp ./ImageInfo-ib4220 $(BIN_DIR)/ImageInfo |
||
42 | (cd $(BIN_DIR); tar -czf $(IMG_PREFIX)-sysupgrade-ib4220b.tar.gz ImageInfo zImage rd.gz hddapp.tgz) |
||
43 | mv $(BIN_DIR)/rd.gz $(BIN_DIR)/$(IMG_PREFIX)-nas4220b-rd.gz |
||
44 | mv $(BIN_DIR)/hddapp.tgz $(BIN_DIR)/$(IMG_PREFIX)-nas4220b-hddapp.tgz |
||
45 | mv $(BIN_DIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-nas4220b-zImage |
||
46 | rm -f $(BIN_DIR)/ImageInfo |
||
1 | office | 47 | endef |
48 | |||
49 | # WBD-111 and WBD-222: |
||
50 | # work around the bootloader's bug with extra nops |
||
51 | # FIXME: is this really needed now that we no longer append the code |
||
52 | # to change the machine ID number? Needs testing on Wiliboard. |
||
53 | define Build/wbd-nops |
||
54 | mv $@ $@.tmp |
||
55 | echo -en "\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $@ |
||
56 | cat $@.tmp >> $@ |
||
57 | rm -f $@.tmp |
||
58 | endef |
||
59 | |||
60 | # All DTB files are prefixed with "gemini-" |
||
61 | define Device/Default |
||
3 | office | 62 | DEVICE_DTS := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTS_DIR))/*-$(1).dtb))) |
1 | office | 63 | KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) |
64 | KERNEL_NAME := zImage |
||
65 | KERNEL := kernel-bin | append-dtb |
||
3 | office | 66 | FILESYSTEMS := squashfs |
67 | IMAGE_NAME := $$(IMAGE_PREFIX)-$$(1).$$(2) |
||
1 | office | 68 | BLOCKSIZE := 128k |
3 | office | 69 | PAGESIZE := 2048 |
1 | office | 70 | endef |
71 | |||
72 | # A reasonable set of default packages handling the NAS type |
||
73 | # of devices out of the box (former NAS42x0 IcyBox defaults) |
||
74 | GEMINI_NAS_PACKAGES:=kmod-md-mod kmod-md-linear kmod-md-multipath \ |
||
75 | kmod-md-raid0 kmod-md-raid1 kmod-md-raid10 kmod-md-raid456 \ |
||
76 | kmod-fs-btrfs kmod-fs-cifs kmod-fs-nfs \ |
||
77 | kmod-fs-nfsd kmod-fs-ntfs kmod-fs-reiserfs kmod-fs-vfat \ |
||
78 | kmod-nls-utf8 kmod-usb-storage-extras \ |
||
3 | office | 79 | samba36-server mdadm cfdisk fdisk e2fsprogs badblocks |
1 | office | 80 | |
3 | office | 81 | define Device/dlink-dir-685 |
1 | office | 82 | DEVICE_TITLE := D-Link DIR-685 Xtreme N Storage Router |
83 | DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) \ |
||
3 | office | 84 | kmod-switch-rtl8366rb swconfig |
85 | IMAGES += dir685-image |
||
86 | IMAGE/dir685-image := dir685-images |
||
1 | office | 87 | endef |
3 | office | 88 | TARGET_DEVICES += dlink-dir-685 |
1 | office | 89 | |
3 | office | 90 | define Device/dlink-dns-313 |
1 | office | 91 | DEVICE_TITLE := D-Link DNS-313 1-Bay Network Storage Enclosure |
92 | DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) |
||
3 | office | 93 | IMAGES += dns313-image |
94 | IMAGE/dns313-image := dns313-images |
||
1 | office | 95 | endef |
3 | office | 96 | TARGET_DEVICES += dlink-dns-313 |
1 | office | 97 | |
3 | office | 98 | define Device/nas4220b |
99 | DEVICE_TITLE := Raidsonic NAS IB-4220-B |
||
100 | IMAGES += nas4220b-image |
||
101 | IMAGE/nas4220b-image := nas4220b-images |
||
1 | office | 102 | DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) |
103 | endef |
||
3 | office | 104 | TARGET_DEVICES += nas4220b |
1 | office | 105 | |
3 | office | 106 | define Device/rut1xx |
107 | DEVICE_TITLE := Teltonika RUT1xx |
||
108 | DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) |
||
1 | office | 109 | endef |
3 | office | 110 | TARGET_DEVICES += rut1xx |
1 | office | 111 | |
3 | office | 112 | define Device/sq201 |
113 | DEVICE_TITLE := ITian Square One SQ201 |
||
114 | DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) rt61-pci-firmware |
||
1 | office | 115 | endef |
3 | office | 116 | TARGET_DEVICES += sq201 |
1 | office | 117 | |
3 | office | 118 | define Device/wbd111 |
1 | office | 119 | DEVICE_TITLE := Wiliboard WBD-111 |
120 | KERNEL := kernel-bin | append-dtb | wbd-nops |
||
121 | endef |
||
3 | office | 122 | TARGET_DEVICES += wbd111 |
1 | office | 123 | |
3 | office | 124 | define Device/wbd222 |
1 | office | 125 | DEVICE_TITLE := Wiliboard WBD-222 |
126 | KERNEL := kernel-bin | append-dtb | wbd-nops |
||
127 | endef |
||
3 | office | 128 | TARGET_DEVICES += wbd222 |
1 | office | 129 | |
130 | $(eval $(call BuildImage)) |