summaryrefslogtreecommitdiff
path: root/meta-lmp-support/recipes-core/images/console-image-lmp.bb
blob: 5d6019ff9618b2dfc921de9222a01daa5355da04 (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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
SUMMARY = "Linux microPlatform image running Pelion Edge"

require recipes-samples/images/lmp-image-common.inc

require recipes-samples/images/lmp-feature-docker.inc
require recipes-samples/images/lmp-feature-wifi.inc
require recipes-samples/images/lmp-feature-sbin-path-helper.inc

IMAGE_FEATURES[validitems] += "tools-debug tools-sdk"
IMAGE_FEATURES += "package-management ssh-server-openssh"
#IMAGE_LINGUAS = "en-us

IMAGE_OVERHEAD_FACTOR = "2"

DEPENDS += "deviceos-users"

CORE_IMAGE_BASE_INSTALL += " \
    kernel-modules \
    networkmanager-nmtui \
    git \
    vim \
    rng-tools \
    haveged \
    packagegroup-core-full-cmdline-utils \
    packagegroup-core-full-cmdline-extended \
    packagegroup-core-full-cmdline-multiuser \
"

CORE_OS = " \
openssh \
packagegroup-core-boot \
packagegroup-core-full-cmdline \
"

#mbed-edge-core is currently dependant on deviceos-users "developer"
PELION_BASE_REQUIRED = " \
deviceos-users \
virtual/mbed-edge-core \
identity-tool \
path-set \
pelion-version \
"
PELION_BASE_OPTIONAL = " \
mbed-fcce \
"

PELION_SYSTEMS_MANAGEMENT = "\
edge-proxy \
maestro \
devicedb \
info-tool \
relay-term \
fluentbit \
"

PELION_PROTOCOL_TRANSLATION = " \
mbed-edge-examples \
"

PELION_CONTAINER_ORCHESTRATION = " \
kubelet \
edge-proxy \
"

PELION_TESTING = " \
git \
panic \
"

PARSEC_SERVICE = " \
parsec-service-tpm \
"

PARSEC_TOOL = " \
parsec-tool \
"

SOFTWARE_TPM = " \
swtpm-service \
tpm2-tools \
"

IMAGE_INSTALL += " \
${CORE_OS} \
${PELION_BASE_REQUIRED} \
${PELION_BASE_OPTIONAL} \
${PELION_PROTOCOL_TRANSLATION} \
${PELION_SYSTEMS_MANAGEMENT} \
${PELION_CONTAINER_ORCHESTRATION} \
${PELION_TESTING} \
${MACHINE_EXTRA_RRECOMMENDS} \
${PARSEC_SERVICE} \
${PARSEC_TOOL} \
${SOFTWARE_TPM} \
"

# Create a parsec user and then set permissions on the parsec components to control access.
# Create the parsec user.
inherit extrausers
EXTRA_USERS_PARAMS += "\
    useradd parsec;\
"

# modify the ownership of the folders and files that only the parsec user needs access to.

ROOTFS_POSTPROCESS_COMMAND_append = " \
  setup_parsec_files; \
"
setup_parsec_files() {
    chown -R parsec:parsec ${IMAGE_ROOTFS}/etc/parsec
    chown -R parsec:parsec ${IMAGE_ROOTFS}/usr/libexec/parsec
    chown parsec:parsec ${IMAGE_ROOTFS}/usr/bin/swtpm.sh
}
set_local_timezone() {
    ln -sf /usr/share/zoneinfo/EST5EDT ${IMAGE_ROOTFS}/etc/localtime
}

disable_bootlogd() {
    echo BOOTLOGD_ENABLE=no > ${IMAGE_ROOTFS}/etc/default/bootlogd
}

ROOTFS_POSTPROCESS_COMMAND += " \
    set_local_timezone ; \
    disable_bootlogd ; \
"

export IMAGE_BASENAME = "console-image-lmp"