-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfwup-gamma.conf
98 lines (86 loc) · 2.5 KB
/
fwup-gamma.conf
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# NK Labs
# Firmware configuration file for image build
# Image layout
# +------------------------+
# | MBR |
# +------------------------+
# | Boot partition (FAT16) |
# | uImage |
# | u-boot.img |
# | MLO |
# | uEnv.txt |
# +------------------------+
# | Rootfs (EXT2/3) |
# +------------------------+
# | Unused |
# +------------------------+
# | Unused |
# +------------------------+
# Firmware metadata
meta-product = "NK Labs Gamma board FW"
meta-description = "This image boots to Linux."
meta-version = "0.1"
meta-platform = "NK Labs Gamma"
meta-architecture = "arm"
meta-author = "Yvan Pearson"
# The boot partition
# 32 x 1024 byte x 1024 (32 MiB) / 512 = 65,536 sectors
define(BOOT_OFFSET, 1)
define(BOOT_COUNT, 65356)
# The rootfs partition
# 2 x 1024 byte x 1024 byte x 1024 (2 GiB) / 512 = 4,194,304 sectors
define(ROOTFS_OFFSET, 70000)
define(ROOTFS_COUNT, 4194304)
define(ROOTFS, "rootfs.ext2")
file-resource uImage {
host-path = "uImage"
}
file-resource MLO {
host-path = "MLO"
}
file-resource u-boot.img {
host-path = "u-boot.img"
}
#file-resource uEnv.txt {
# host-path = "${PROJECT_ROOT}/board/bbb/uEnv.txt"
#}
file-resource rootfs.ext2 {
host-path = ${ROOTFS}
}
mbr mbr-a {
partition 0 {
block-offset = ${BOOT_OFFSET}
block-count = ${BOOT_COUNT}
type = 0xE # DOS 16-bit FAT, LBA-mapped
boot = true
}
partition 1 {
block-offset = ${ROOTFS_OFFSET}
block-count = ${ROOTFS_COUNT}
type = 0x83 # Linux native partition
}
}
# This firmware task writes everything to the destination media
task buildimage {
# Only match if not mounted
require-unmounted-destination = true
# Everything that gets written can be verified on the fly.
# This speeds things up, since we don't care about detecting
# errors before data gets written.
verify-on-the-fly = true
on-init {
mbr_write(mbr-a)
fat_mkfs(${BOOT_OFFSET}, ${BOOT_COUNT})
fat_setlabel(${BOOT_OFFSET}, "boot")
}
on-resource uImage { fat_write(${BOOT_OFFSET}, "uImage") }
on-resource MLO { fat_write(${BOOT_OFFSET}, "MLO") }
on-resource u-boot.img { fat_write(${BOOT_OFFSET}, "u-boot.img") }
#on-resource uEnv.txt { fat_write(${BOOT_OFFSET}, "uEnv.txt") }
on-resource rootfs.ext2 {
# write to the first rootfs partition
raw_write(${ROOTFS_OFFSET})
}
on-finish {
}
}