forked from stoupa-cz/meta-odroid
-
Notifications
You must be signed in to change notification settings - Fork 40
/
image_types_odroid.bbclass
89 lines (72 loc) · 2.76 KB
/
image_types_odroid.bbclass
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
inherit image_types
#
# Create an image that can by written onto a SD card using dd for use
# with Odroid BSP family
#
# -------------------------------------
# | Binary | Block offset| part type |
# | name | SD | eMMC |(eMMC only)|
# -------------------------------------
# | Bl1 | 1 | 0 | 1 (boot) |
# | Bl2 | 31 | 30 | 1 (boot) |
# | U-boot | 63 | 62 | 1 (boot) |
# | Tzsw | 2111 | 2110 | 1 (boot) |
# | Uboot Env | 2625 | 2560 | 0 (user) |
# -------------------------------------
#
do_rootfs[depends] += " virtual/bootloader:do_packagedata"
generic_odroid_xu_wic_cmd() {
dd if=${DEPLOY_DIR_IMAGE}/bl1.bin.hardkernel of=$out.wic conv=notrunc bs=512 seek=1
dd if=${DEPLOY_DIR_IMAGE}/bl2.bin.hardkernel of=$out.wic conv=notrunc bs=512 seek=31
dd if=${DEPLOY_DIR_IMAGE}/u-boot-dtb.bin of=$out.wic conv=notrunc bs=512 seek=63
dd if=${DEPLOY_DIR_IMAGE}/tzsw.bin.hardkernel of=$out.wic conv=notrunc bs=512 seek=2111
dd if=/dev/zero of=$out.wic conv=notrunc count=32 bs=512 seek="2625"
}
IMAGE_CMD:wic:append:odroid-xu3() {
generic_odroid_xu_wic_cmd
}
IMAGE_CMD:wic:append:odroid-xu4() {
generic_odroid_xu_wic_cmd
}
IMAGE_CMD:wic:append:odroid-xu3-lite() {
generic_odroid_xu_wic_cmd
}
IMAGE_CMD:wic:append:odroid-hc1() {
generic_odroid_xu_wic_cmd
}
IMAGE_CMD:wic:append:odroid-c1() {
dd if=${DEPLOY_DIR_IMAGE}/bl1.bin.hardkernel of=$out.wic conv=notrunc bs=1 count=442
dd if=${DEPLOY_DIR_IMAGE}/bl1.bin.hardkernel of=$out.wic conv=notrunc bs=512 skip=1 seek=1
dd if=${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX} of=$out.wic conv=notrunc bs=512 seek=64
}
# Write U-Boot before wic generates compressed rootfs for odroid-c2 machine
IMAGE_CMD:wic:append:odroid-c2() {
dd if=${DEPLOY_DIR_IMAGE}/bl1.bin.hardkernel of=$out.wic conv=notrunc bs=1 count=442
dd if=${DEPLOY_DIR_IMAGE}/bl1.bin.hardkernel of=$out.wic conv=notrunc bs=512 skip=1 seek=1
dd if=${DEPLOY_DIR_IMAGE}/u-boot-dtb.bin of=$out.wic conv=notrunc bs=512 seek=97
}
generic_odroid_n2_wic_cmd() {
dd if=${DEPLOY_DIR_IMAGE}/${UBOOT_BINARY} of=$out.wic conv=fsync,notrunc bs=512 skip=1 seek=1
dd if=${DEPLOY_DIR_IMAGE}/${UBOOT_BINARY} of=$out.wic conv=fsync,notrunc bs=1 count=444
}
generic_odroid_c4_wic_cmd() {
dd if=${DEPLOY_DIR_IMAGE}/u-boot.bin of=$out.wic conv=fsync,notrunc bs=512 seek=1
}
IMAGE_CMD:wic:append:odroid-n2-hardkernel() {
generic_odroid_c4_wic_cmd
}
IMAGE_CMD:wic:append:odroid-n2() {
generic_odroid_n2_wic_cmd
}
IMAGE_CMD:wic:append:odroid-n2l() {
generic_odroid_n2_wic_cmd
}
IMAGE_CMD:wic:append:odroid-c4-hardkernel() {
generic_odroid_c4_wic_cmd
}
IMAGE_CMD:wic:append:odroid-c4() {
generic_odroid_n2_wic_cmd
}
IMAGE_CMD:wic:append:odroid-hc4() {
generic_odroid_n2_wic_cmd
}