diff options
author | Anuj Mittal <anuj.mittal@intel.com> | 2018-07-12 22:08:22 +0800 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2018-07-16 16:53:00 +0800 |
commit | c12c16659203d677618871f660c1499152a555a8 (patch) | |
tree | 60967f8f17da1e5a6cef2908312a25b4c9514a07 | |
parent | 7c469177e833a80443b948af63e40176c7dc6bee (diff) | |
download | meta-intel-c12c16659203d677618871f660c1499152a555a8.tar.gz |
rmc: remove
It's not being maintained anymore and the scripts have not been kept in
sync with upstream for quite some time.
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
67 files changed, 2 insertions, 1635 deletions
@@ -239,10 +239,6 @@ Other software | |||
239 | the Intel power clamp driver. | 239 | the Intel power clamp driver. |
240 | (https://01.org/linux-thermal-daemon/documentation/introduction-thermal-daemon) | 240 | (https://01.org/linux-thermal-daemon/documentation/introduction-thermal-daemon) |
241 | 241 | ||
242 | * RMC - Runtime Machine Configuration, which allows the bootload to determine | ||
243 | board and CPU information in order to set specific kernel command line | ||
244 | information at startup. | ||
245 | |||
246 | The intel-common kernel package architecture | 242 | The intel-common kernel package architecture |
247 | -------------------------------------------- | 243 | -------------------------------------------- |
248 | 244 | ||
diff --git a/classes/rmc-boot.bbclass b/classes/rmc-boot.bbclass deleted file mode 100644 index 37c3e30c..00000000 --- a/classes/rmc-boot.bbclass +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | # rmc-boot bbclass | ||
2 | # Deploy central RMC database file to ESP | ||
3 | |||
4 | IMAGE_INSTALL_append = " rmc" | ||
5 | RMC_BOOTLOADER ?= "systemd-boot" | ||
6 | |||
7 | inherit ${RMC_BOOTLOADER} | ||
8 | |||
9 | do_bootimg[depends] += "${MLPREFIX}rmc-db:do_deploy" | ||
10 | |||
11 | efi_populate_append() { | ||
12 | if [ -f ${DEPLOY_DIR_IMAGE}/rmc.db ]; then | ||
13 | install -m 0400 ${DEPLOY_DIR_IMAGE}/rmc.db ${DEST}/rmc.db | ||
14 | else | ||
15 | rm -f ${DEST}/rmc.db | ||
16 | fi | ||
17 | } | ||
diff --git a/classes/rmc-db.bbclass b/classes/rmc-db.bbclass deleted file mode 100644 index 72594d69..00000000 --- a/classes/rmc-db.bbclass +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | # RMC database bbclass | ||
2 | # provide functions to generate RMC database file on build host (native) | ||
3 | |||
4 | DEPENDS += "rmc-native" | ||
5 | |||
6 | # rmc_generate_db() | ||
7 | # $1: a list of directories. Each directory holds directories for a group of | ||
8 | # boards. | ||
9 | # $2: path_name of rmc generates database file and records | ||
10 | # | ||
11 | # WARNING: content of directory of database file will be removed. | ||
12 | # | ||
13 | # Each board directory shall contain a fingerprint file (*.fp) at least, with | ||
14 | # optional file blob(s) associated to the type of board. If a board directory | ||
15 | # has no file blob, no record is created for that board. | ||
16 | # | ||
17 | # An example of two directories each of which contains two boards for RMC: | ||
18 | # (All file and directory names are for illustration purpose.) | ||
19 | # | ||
20 | # dir_1/ | ||
21 | # board_1/ | ||
22 | # board_1_fingerprint.fp | ||
23 | # file_1.blob | ||
24 | # board_2/ | ||
25 | # board_2.fp | ||
26 | # dir_2/ | ||
27 | # board_3/ | ||
28 | # b3.fp | ||
29 | # file_1.blob | ||
30 | # file_2.conf | ||
31 | # board_4/ | ||
32 | # board_foo.fp | ||
33 | # mylib.config | ||
34 | # | ||
35 | # To generate a RMC database "rmc.db" with data of all (actually 3) of boards in | ||
36 | # a directory "deploy_dir": | ||
37 | # | ||
38 | # rmc_generate_db "dir_1 dir_2" "deploy_dir/rmc.db" | ||
39 | # | ||
40 | # The board_2 will be skipped. No record or any data for it is packed in | ||
41 | # generated database because it only contains a fingerprint file. | ||
42 | # | ||
43 | |||
44 | rmc_generate_db () { | ||
45 | RMC_BOARD_DIRS=$1 | ||
46 | |||
47 | if [ "$#" -ne 2 ]; then | ||
48 | echo "rmc_generate_db(): Wrong number of arguments: $#" | ||
49 | return 1 | ||
50 | fi | ||
51 | |||
52 | RMC_DB_DIR=$(dirname "$2") | ||
53 | RMC_RECORDS="" | ||
54 | |||
55 | rm -rf ${RMC_DB_DIR} | ||
56 | mkdir -p ${RMC_DB_DIR} | ||
57 | |||
58 | # generate rmc database | ||
59 | for topdir in ${RMC_BOARD_DIRS}; do | ||
60 | # For all board dirs in a topdir: | ||
61 | CUR_BOARD_DIRS=$(find ${topdir}/* -type d) | ||
62 | for board_dir in ${CUR_BOARD_DIRS}; do | ||
63 | CUR_FINGERPRINT=$(find ${board_dir}/ -name "*.fp") | ||
64 | |||
65 | # disallow a board directory without any fingerprint file in it. | ||
66 | if [ -z "${CUR_FINGERPRINT}" ]; then | ||
67 | echo "Cannot find RMC fingerprint file in ${board_dir}" | ||
68 | return 1 | ||
69 | fi | ||
70 | |||
71 | CUR_FILES=$(find ${board_dir}/ -type f |grep -v '\.fp$' || true) | ||
72 | |||
73 | # allow a directory only with fingerprint file. Developer may | ||
74 | # check in fingerprint for future use. | ||
75 | if [ -z "${CUR_FILES}" ]; then | ||
76 | continue | ||
77 | fi | ||
78 | |||
79 | for fp in ${CUR_FINGERPRINT}; do | ||
80 | fullname=$(basename ${fp}) | ||
81 | CUR_TAG="${fullname%.*}" | ||
82 | CUR_RECORD=${RMC_DB_DIR}/${CUR_TAG}.rec | ||
83 | rmc -R -f ${fp} -b ${CUR_FILES} -o ${CUR_RECORD} | ||
84 | RMC_RECORDS="${RMC_RECORDS} ${CUR_RECORD}" | ||
85 | done | ||
86 | done | ||
87 | done | ||
88 | |||
89 | if [ ! -z "${RMC_RECORDS}" ]; then | ||
90 | rmc -D ${RMC_RECORDS} -o "$2" | ||
91 | fi | ||
92 | } | ||
diff --git a/conf/include/maintainers.inc b/conf/include/maintainers.inc index b90480ef..4bd45816 100644 --- a/conf/include/maintainers.inc +++ b/conf/include/maintainers.inc | |||
@@ -14,8 +14,6 @@ RECIPE_MAINTAINER_pn-linux-intel = "Anuj Mittal <anuj.mittal@intel.com>" | |||
14 | RECIPE_MAINTAINER_pn-linux-intel-rt = "Anuj Mittal <anuj.mittal@intel.com>" | 14 | RECIPE_MAINTAINER_pn-linux-intel-rt = "Anuj Mittal <anuj.mittal@intel.com>" |
15 | RECIPE_MAINTAINER_pn-lms7 = "Anuj Mittal <anuj.mittal@intel.com>" | 15 | RECIPE_MAINTAINER_pn-lms7 = "Anuj Mittal <anuj.mittal@intel.com>" |
16 | RECIPE_MAINTAINER_pn-lms8 = "Anuj Mittal <anuj.mittal@intel.com>" | 16 | RECIPE_MAINTAINER_pn-lms8 = "Anuj Mittal <anuj.mittal@intel.com>" |
17 | RECIPE_MAINTAINER_pn-rmc = "Anuj Mittal <anuj.mittal@intel.com>" | ||
18 | RECIPE_MAINTAINER_pn-rmc-db = "Anuj Mittal <anuj.mittal@intel.com>" | ||
19 | RECIPE_MAINTAINER_pn-thermald = "Anuj Mittal <anuj.mittal@intel.com>" | 17 | RECIPE_MAINTAINER_pn-thermald = "Anuj Mittal <anuj.mittal@intel.com>" |
20 | RECIPE_MAINTAINER_pn-va-intel = "Anuj Mittal <anuj.mittal@intel.com>" | 18 | RECIPE_MAINTAINER_pn-va-intel = "Anuj Mittal <anuj.mittal@intel.com>" |
21 | RECIPE_MAINTAINER_pn-xf86-video-ast = "Anuj Mittal <anuj.mittal@intel.com>" | 19 | RECIPE_MAINTAINER_pn-xf86-video-ast = "Anuj Mittal <anuj.mittal@intel.com>" |
diff --git a/conf/machine/intel-core2-32.conf b/conf/machine/intel-core2-32.conf index 0e416993..9a83fdff 100644 --- a/conf/machine/intel-core2-32.conf +++ b/conf/machine/intel-core2-32.conf | |||
@@ -34,5 +34,5 @@ SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1 115200;ttyPCH0" | |||
34 | APPEND += "rootwait console=ttyS0,115200 console=ttyPCH0,115200 console=tty0" | 34 | APPEND += "rootwait console=ttyS0,115200 console=ttyPCH0,115200 console=tty0" |
35 | 35 | ||
36 | IMAGE_FSTYPES += "wic" | 36 | IMAGE_FSTYPES += "wic" |
37 | WKS_FILE ?= "${@bb.utils.contains_any("EFI_PROVIDER", "systemd-boot rmc-boot", "systemd-bootdisk-microcode.wks", "grub-bootdisk-microcode.wks", d)}" | 37 | WKS_FILE ?= "${@bb.utils.contains_any("EFI_PROVIDER", "systemd-boot", "systemd-bootdisk-microcode.wks", "grub-bootdisk-microcode.wks", d)}" |
38 | WKS_FILE_DEPENDS_append = " intel-microcode" | 38 | WKS_FILE_DEPENDS_append = " intel-microcode" |
diff --git a/conf/machine/intel-corei7-64.conf b/conf/machine/intel-corei7-64.conf index 4986993b..16006d33 100644 --- a/conf/machine/intel-corei7-64.conf +++ b/conf/machine/intel-corei7-64.conf | |||
@@ -41,5 +41,5 @@ SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1 115200;ttyS2" | |||
41 | APPEND += "rootwait console=ttyS0,115200 console=tty0" | 41 | APPEND += "rootwait console=ttyS0,115200 console=tty0" |
42 | 42 | ||
43 | IMAGE_FSTYPES += "wic" | 43 | IMAGE_FSTYPES += "wic" |
44 | WKS_FILE ?= "${@bb.utils.contains_any("EFI_PROVIDER", "systemd-boot rmc-boot", "systemd-bootdisk-microcode.wks", "grub-bootdisk-microcode.wks", d)}" | 44 | WKS_FILE ?= "${@bb.utils.contains_any("EFI_PROVIDER", "systemd-boot", "systemd-bootdisk-microcode.wks", "grub-bootdisk-microcode.wks", d)}" |
45 | WKS_FILE_DEPENDS_append = " intel-microcode" | 45 | WKS_FILE_DEPENDS_append = " intel-microcode" |
diff --git a/documentation/rmc/README b/documentation/rmc/README deleted file mode 100644 index 2c352f29..00000000 --- a/documentation/rmc/README +++ /dev/null | |||
@@ -1,373 +0,0 @@ | |||
1 | Runtime Machine Configuration (RMC) | ||
2 | -------------------------------------------------------------------------------- | ||
3 | Table of Contents | ||
4 | |||
5 | Introduction | ||
6 | Usage | ||
7 | Enable RMC Feature | ||
8 | Examples | ||
9 | Troubleshooting | ||
10 | When you (don't) need RMC feature | ||
11 | |||
12 | |||
13 | Introduction: | ||
14 | -------------------------------------------------------------------------------- | ||
15 | RMC Project - a light-weight project provide developers a mechanism to keep | ||
16 | their software implementation board-type agnostic, yet still able to customize | ||
17 | software behavior according to the type of a running board at runtime. Recipes | ||
18 | and bbclasses are available for other components to reuse to construct their own | ||
19 | RMC database. | ||
20 | |||
21 | RMC Feature - An end-to-end solution based on RMC project to have a generic | ||
22 | image capable to apply board-type-specific quirks and configurations for a board | ||
23 | at runtime. It consists of a modified bootloader (systemd-boot), an updated EFI | ||
24 | installer, recipes, bbclass and RMC project. | ||
25 | |||
26 | RMC feature supports special customizations cannot be covered by conventional | ||
27 | auto-detection features based on probing a hardware module because they happen | ||
28 | at a board or a product level. For example: | ||
29 | - tty console for kernel log output in kernel cmdline | ||
30 | - default audio route configuration | ||
31 | - network configuration | ||
32 | - UI layout | ||
33 | - requirement to software driven by a mechanical design | ||
34 | - or static configuration bits for a physical bus that doesn't support to | ||
35 | identify devices or their presence at runtime | ||
36 | |||
37 | An image with the feature has ability to configure supported boards with data | ||
38 | associated only to a type of board to get full functionality of the target at | ||
39 | runtime, yet still with a single image. | ||
40 | |||
41 | Effect after installation is identical to what a conventional image specially | ||
42 | customized for a type of board (depending on the way to deploy image). | ||
43 | |||
44 | Main functions of RMC Feature: | ||
45 | |||
46 | Show board-specific boot entries in boot menu and boot system with configuration | ||
47 | (boot title, boot options, etc) in a selected boot entry. | ||
48 | |||
49 | Support a "global" kernel boot command line fragment which is effective for all | ||
50 | boot entries. | ||
51 | |||
52 | Deploy file blobs and create directories specific to the type of running board. | ||
53 | |||
54 | Beside from this document, you can also find several built-in examples in | ||
55 | common/recipes-bsp/rmc/boards/. Refer to "Examples" section. | ||
56 | |||
57 | You can also add new board types in your layer via a simple variable. | ||
58 | |||
59 | |||
60 | |||
61 | Usage | ||
62 | -------------------------------------------------------------------------------- | ||
63 | Developers are suggested to organize all board-specific files in their own layer | ||
64 | following this example, so that RMC recipes can pick up them correctly in build. | ||
65 | |||
66 | - my_top_dir/ Top directory of your board (Note 0) | ||
67 | |- rmc-db.bbappend bbappend file to rmc-db recipe at a lower level | ||
68 | |- rmc/ | ||
69 | |- target_board_1/ subdirectory of a board. | ||
70 | | |- board1.fp fingerprint file must be provided (NOTE 1) | ||
71 | | |- BOOTENTRY.CONFIG optional config file for boot entries. (NOTE 2) | ||
72 | | |- INSTALLER.CONFIG optional config file for installer. (NOTE 3) | ||
73 | | |- POSTINSTALL.sh optional script hook for installer (NOTE 4) | ||
74 | | |- board_file_1 A file blob specific to the type of board | ||
75 | | |- board_file_2 An another file specific to the type of board | ||
76 | | |- ...more files | ||
77 | |- target_board_2/ subdirectory of another board. | ||
78 | |- board_2_v2.fp fingerprint file for board 2. | ||
79 | |- BOOTENTRY.CONFIG | ||
80 | |- INSTALLER.CONFIG | ||
81 | |- board_file_1 | ||
82 | |- ...more files | ||
83 | |||
84 | Note 0: | ||
85 | Developers are expected to use variable RMC_BOARD_DATA_DIRS to specify data of | ||
86 | boards packed into RMC database file generated in a build. The default value of | ||
87 | the variable in meta-intel specifies a group of boards. They work as examples | ||
88 | and necessary quirks for these boards to function properly. Developers can | ||
89 | override, append to the default boards with data of their own boards in the | ||
90 | database file, or even disable the generation of the database file. | ||
91 | |||
92 | For example, in your local.conf file: | ||
93 | |||
94 | This line adds your boards along with the default boards into RMC database file, | ||
95 | assuming you have a directory named "rmc" which has a subdirectory for each | ||
96 | board: | ||
97 | |||
98 | RMC_BOARD_DATA_DIRS_append = " /path_of/rmc" | ||
99 | |||
100 | This line directs RMC to pack data of your boards only, without data of the | ||
101 | default boards in meta-intel: | ||
102 | |||
103 | RMC_BOARD_DATA_DIRS = "/path_of/rmc" | ||
104 | |||
105 | And this line disables database generation: | ||
106 | |||
107 | RMC_BOARD_DATA_DIRS = "" | ||
108 | |||
109 | Please also refer to the "Example 1" in this document. | ||
110 | |||
111 | Subdirectory is not supported in a board's directory. | ||
112 | |||
113 | Note 1: | ||
114 | Fingerprint files must be provided and with ".fp" at the end of their names. | ||
115 | Fingerprint can be obtained by running RMC tool on your board. An easy way is to | ||
116 | live-boot USB stick flashed with any image enabled this feature on your board, | ||
117 | then run this command: | ||
118 | |||
119 | # rmc -F -o my_board.fp | ||
120 | |||
121 | Or you will need to build RMC tool for the architecture of your board, 32 or | ||
122 | 64 bit x86, from RMC project. | ||
123 | |||
124 | You can run RMC tool without any argument to get usage and examples. | ||
125 | |||
126 | DO NOT NAME ANY FILE ENDING WITH '.fp' IF IT IS NOT A RMC FINGERPRINT FILE. | ||
127 | |||
128 | If you do need a .fp file deployed onto target, please rename it in source and | ||
129 | specify the real name of file on target in INSTALLER.CONFIG. | ||
130 | |||
131 | Note 2: | ||
132 | At runtime, RMC bootloader tries to fetch this file specific to the board at run | ||
133 | time, then tries to fetch each boot entry file specified in BOOTENTRY.CONFIG and | ||
134 | show them in boot menu options. The format of this file is very simple. Each | ||
135 | line is the name of a boot entry file: | ||
136 | |||
137 | boot.conf | ||
138 | Install.conf | ||
139 | myrmcboot.conf | ||
140 | |||
141 | Name of a boot entry file is defined by developer so it can be anything. But the | ||
142 | name of config file is what RMC bootloader looks up in RMC database, so it must | ||
143 | be named BOOTENTRY.CONFIG. | ||
144 | |||
145 | Bootloader skips loading entry conf files from disk once any entry is loaded | ||
146 | from RMC database. | ||
147 | |||
148 | Note 3: | ||
149 | At runtime, RMC installer tries to fetch INSTALLER.CONFIG file specific to the | ||
150 | board, then tries to fetch each file specified in this config file, and then | ||
151 | deploy the file onto target with its permissions, UID, GID and other attributes | ||
152 | also specified in this config file if file for the board can be retrieved from | ||
153 | RMC database. The format of this file is (# is for comment line) | ||
154 | |||
155 | # name:uid:gid:mode:path_on_target | ||
156 | # to create a directory, add a “/” at the end of path_on_target: | ||
157 | audio_policy:0:0:600:/etc/audio/ | ||
158 | audio_def_policy:0:0:600:/etc/audio/audio_policy | ||
159 | |||
160 | The above example creates /etc/audio directory first, then fetch a file named | ||
161 | “audio_def_policy” from RMC database for the board, then copy it to /etc/audio/ | ||
162 | with a new name “audio_policy”. | ||
163 | |||
164 | If this config file is not provided, No data in RMC database is deployed to the | ||
165 | target. | ||
166 | |||
167 | Some steps defined by developers could not be supported on a filesystem. | ||
168 | Installer simply ignores any errors in RMC deployment stage. | ||
169 | |||
170 | The name of this config file is what installer looks up first, so it must be | ||
171 | INSTALLER.CONFIG. | ||
172 | |||
173 | Note 4: | ||
174 | At the end of RMC deployment during installation, RMC installer queries a script | ||
175 | file POSTINSTALL.sh from RMC database file, and execute it when query is | ||
176 | successful on the running board. This hook provides developers almost ultimate | ||
177 | flexibility to retouch what have been deployed on the target. There are some | ||
178 | steps still can override results from this hook for boot entries and KBOOTPARAM. | ||
179 | |||
180 | |||
181 | |||
182 | Enable RMC Feature | ||
183 | -------------------------------------------------------------------------------- | ||
184 | To enable the RMC feature please add the following variables to your local.conf. | ||
185 | |||
186 | DISTRO_FEATURES_append = " rmc" | ||
187 | EFI_PROVIDER = "rmc-boot" | ||
188 | |||
189 | The default EFI bootloader used with RMC is systemd-boot. To change the default | ||
190 | bootloader please overwrite the RMC_BOOTLOADER variable in your local.conf | ||
191 | |||
192 | Note: | ||
193 | Image could be still bootable if you only have either of two lines, but RMC | ||
194 | feature could not be fully functional, depending on the availability of the | ||
195 | database file, installer and the rmc tool. | ||
196 | |||
197 | Examples | ||
198 | -------------------------------------------------------------------------------- | ||
199 | We checked in configuration data in common/recipes-bsp/rmc/boards/ for several | ||
200 | boards, to help users to understand the RMC feature. These examples are also for | ||
201 | validation. For any example you find not working as what this section depicts, | ||
202 | it should be treated as a bug to be fixed. | ||
203 | |||
204 | To test this feature with examples, enable it and build an image first, then | ||
205 | boot the built image on supported boards. Examples are always built in when the | ||
206 | feature is enabled, except for the EXAMPLE 1. | ||
207 | |||
208 | EXAMPLE 1: Support a new board type: | ||
209 | (1) enable the feature and do a build to get a live-boot image by adding these | ||
210 | lines in conf/local.conf: | ||
211 | DISTRO_FEATURES_append = " rmc" | ||
212 | EFI_PROVIDER = "rmc-boot" | ||
213 | |||
214 | (2) flash the image to a USB stick and boot it on your board | ||
215 | |||
216 | (3) in super user mode, run "rmc -F -o my_board.fp" | ||
217 | |||
218 | (4) create directories in your host "mkdir -p my_top_dir/my_rmc/my_board" | ||
219 | |||
220 | (5) copy my_board.fp from target to my_top_dir/my_rmc/my_board/ on host | ||
221 | |||
222 | (6) create a file my_top_dir/my_rmc/my_board/KBOOTPARAM, put some fake | ||
223 | and harmless options in a single line, say, "loglevel=7" | ||
224 | |||
225 | (7) create a file my_top_dir/rmc-db.bbappend, put this single line in it: | ||
226 | RMC_BOARD_DATA_DIRS_append := " ${THISDIR}/my_rmc" | ||
227 | From parent directory of my_top_dir, the tree should look like: | ||
228 | my_top_dir/ | ||
229 | my_rmc/ | ||
230 | my_board/ | ||
231 | KBOOTPARAM | ||
232 | my_board.fp | ||
233 | rmc-db.bbappend | ||
234 | Later, you can add more board directories in my_rmc directory. | ||
235 | |||
236 | (8) modify build configuration to add my_top_dir into build, for example, put | ||
237 | this line in a bblayers.conf: | ||
238 | BBFILES += "/full/path/of/my_top_dir/rmc-db.bbappend" | ||
239 | |||
240 | (9) build image again then boot it on your board | ||
241 | |||
242 | (10) Once you login to shell, new options should be effective, run this command | ||
243 | "cat /proc/cmdline" to verify the result. | ||
244 | |||
245 | EXAMPLE 2: Board-specific boot entry | ||
246 | MinnowBoard MAX and B3 version: | ||
247 | common/recipes-bsp/rmc/boards/minnowmax | ||
248 | common/recipes-bsp/rmc/boards/minnowmaxB3 | ||
249 | |||
250 | We have found two identities (type of board) exist for the "same" Minnow Max | ||
251 | hardware, so they have to be treated as two different types of hardware. The two | ||
252 | examples show you a boot entry specific to a type of board. Titles shown in boot | ||
253 | menu have different names according to the type of running board, "Minnow Max | ||
254 | boot" or "Minnow Max B3 boot". in /proc/cmdline, "console=ttyS0,115200n8" shall | ||
255 | be there. Kernel prints logs from 6-pin FTDI serial port on Minnow Max(s). This | ||
256 | console setting is in board-specific entries, so you won't see it effective if | ||
257 | you select default "boot" entry to boot the device. | ||
258 | |||
259 | EXAMPLE 3: Board-specific boot entry, global kernel cmdline and installer | ||
260 | NUC Gen 6: | ||
261 | common/recipes-bsp/rmc/boards/nucgen6 | ||
262 | This is a combo example with all supported configuration data for NUC Gen 6 | ||
263 | product. It shows two boot entries in bootloader menu when you boot image on NUC | ||
264 | Gen 6 product, with "NUC Gen6" in entry titles. There shall no any "console=" in | ||
265 | /proc/cmdline when you boot with either of two "NUC Gen6"entries. We designed it | ||
266 | this way because there is no accessible tty port on NUC Gen 6 with housing. The | ||
267 | post-install hook is also provided in this example. | ||
268 | |||
269 | This example also includes a global kernel cmdline fragment KBOOTPARAM. Content | ||
270 | of KBOOTPARAM shall be at the end of /proc/cmdline no matter which boot entry | ||
271 | you selected to boot NUC Gen6. | ||
272 | |||
273 | INSTALLER.CONFIG directs installer to create a directory and deploy a file in it | ||
274 | when install the image on NUC Gen6. | ||
275 | |||
276 | Choose "NUC Gen6 install" boot entry to boot shall start installation. Once | ||
277 | the device reboots after installation, we can verify the configurations. | ||
278 | |||
279 | The boot entry "NUC Gen6 boot" shall be shown in boot menu. | ||
280 | |||
281 | The content of KBOOTPARAM shall be in /proc/cmdline too. | ||
282 | |||
283 | A directory /etc/mylib/ is created and a file "mylib.conf" is there. The content | ||
284 | of that file shall be what we put in mylib.conf in | ||
285 | common/recipes-bsp/rmc/boards/nucgen6 | ||
286 | |||
287 | POSTINSTALL.sh shows how we get rid of an error message caused by no serial | ||
288 | console available on NUC Gen 6, without creating another static board | ||
289 | configuration. | ||
290 | |||
291 | EXAMPLE 4: For validation only | ||
292 | T100 (32bit): | ||
293 | common/recipes-bsp/rmc/boards/T100-32bit | ||
294 | This example is provided for validation on 32 bit X86 architecture. It doesn't | ||
295 | provide any new function not mentioned in above examples. | ||
296 | |||
297 | Troubleshooting | ||
298 | -------------------------------------------------------------------------------- | ||
299 | Issue: Cannot obtain RMC fingerprint for a board | ||
300 | |||
301 | RMC tool requires UEFI BIOS and SMBIOS support in firmware. It doesn't support | ||
302 | other type of firmware, e.g. legacy BIOS. It also requires EFI driver enabled | ||
303 | in Linux kernel. | ||
304 | |||
305 | Issue: Configuration for a board seems not effective at runtime. | ||
306 | |||
307 | Check if board is booted from the storage where the image or installation lives | ||
308 | when you have multiple boot options in BIOS. On some old hardwares it is not | ||
309 | that obvious as you assume. A build image can support boot from both of legacy | ||
310 | and UEFI mode, but RMC only works with UEFI boot so far. | ||
311 | |||
312 | Make sure configuration files (BOOTENTRY.CONFIG, INSTALLER.CONFIG and, | ||
313 | KBOOTPARAM ...) are properly named in the board directory. | ||
314 | |||
315 | Make sure configuration files have correct contents. | ||
316 | |||
317 | Some file attributes could not be supported by targeted file system. Installer | ||
318 | cannot setup file blobs as you wish. It simply move to the next step if a step | ||
319 | fails. | ||
320 | |||
321 | Kernel command line can be customized globally with KBOOTPARAM or just in a boot | ||
322 | entry for the type of board. They have different effective scopes. | ||
323 | |||
324 | If no any board-specific configuration becomes effective on your board but it | ||
325 | works on other boards of same product, you can run rmc tool to obtain | ||
326 | fingerprint file on your board and compare it with fingerprint of a working | ||
327 | board. It is possible they have different firmware versions and unluckily, some | ||
328 | information for fingerprint changes between two versions. You can update BIOS | ||
329 | on every board to the same BIOS version if it is feasible. Otherwise you have | ||
330 | to treat them as two different type of boards. We could extend rmc design to | ||
331 | allow multiple fingerprints in a board directory as a workaround. | ||
332 | |||
333 | Issue: RMC reports error because it cannot find fingerprint when building image. | ||
334 | |||
335 | Make sure you have a fingerprint file. Its name must be ended with '.fp'. You | ||
336 | can put a fingerprint file in a board directory and provide data later. | ||
337 | |||
338 | Issue: Any problems the above troubleshooting cannot help | ||
339 | |||
340 | Please report it to us. Extra information like the type of your board or a dump | ||
341 | file from dmidecode tool is helpful. We will investigate the problem and keep | ||
342 | improving this feature. | ||
343 | |||
344 | |||
345 | |||
346 | |||
347 | When you (don't) need RMC feature | ||
348 | -------------------------------------------------------------------------------- | ||
349 | RMC feature is designed to as generic as possible, in order to support a large | ||
350 | number of types of boards. And it shall be designed not to break things when it | ||
351 | is disabled. These considerations help users to decide if they really need or | ||
352 | enable it. | ||
353 | |||
354 | If you are satisfied with a dedicated build target and image for each board in | ||
355 | your development cycle (source, build, validation, release, etc), you don't need | ||
356 | this feature. | ||
357 | |||
358 | If you have a generic build for multiple type of boards and features supported | ||
359 | by that build meet your needs to functionality on all of boards, you don't need | ||
360 | to have this feature or you can disable it until you need to check in the first | ||
361 | board's data, in order to apply a quirk or customization only for that board. | ||
362 | |||
363 | If you want this feature but have concerns to see more and more boards' finger- | ||
364 | prints and data in a generic project, you can have another layer to hold all of | ||
365 | board-specific data to split them from a generic layer at source level. Another | ||
366 | suggestion is always seeking chances not to clone or copy a common configuration | ||
367 | to each board's directory. | ||
368 | |||
369 | |||
370 | |||
371 | Thanks | ||
372 | |||
373 | Jianxun Zhang <jianxun.zhang@linux.intel.com> | ||
diff --git a/recipes-bsp/rmc/boards/MinnowboardTurbot/KBOOTPARAM b/recipes-bsp/rmc/boards/MinnowboardTurbot/KBOOTPARAM deleted file mode 100644 index 476b1fbe..00000000 --- a/recipes-bsp/rmc/boards/MinnowboardTurbot/KBOOTPARAM +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | console=ttyS0,115200 | ||
diff --git a/recipes-bsp/rmc/boards/MinnowboardTurbot/minnowboardturbot.fp b/recipes-bsp/rmc/boards/MinnowboardTurbot/minnowboardturbot.fp deleted file mode 100644 index 9aa145f3..00000000 --- a/recipes-bsp/rmc/boards/MinnowboardTurbot/minnowboardturbot.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/NUC5i5RYB/BOOTENTRY.CONFIG b/recipes-bsp/rmc/boards/NUC5i5RYB/BOOTENTRY.CONFIG deleted file mode 100644 index b2fabe82..00000000 --- a/recipes-bsp/rmc/boards/NUC5i5RYB/BOOTENTRY.CONFIG +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | boot.conf | ||
2 | install.conf | ||
diff --git a/recipes-bsp/rmc/boards/NUC5i5RYB/INSTALLER.CONFIG b/recipes-bsp/rmc/boards/NUC5i5RYB/INSTALLER.CONFIG deleted file mode 100644 index ca5f04b9..00000000 --- a/recipes-bsp/rmc/boards/NUC5i5RYB/INSTALLER.CONFIG +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | efi_entry_dir:root:disk:770:/boot/loader/entries/ | ||
2 | boot.conf:root:disk:770:/boot/loader/entries/rmcboot.conf | ||
diff --git a/recipes-bsp/rmc/boards/NUC5i5RYB/POSTINSTALL.sh b/recipes-bsp/rmc/boards/NUC5i5RYB/POSTINSTALL.sh deleted file mode 100644 index 6694261b..00000000 --- a/recipes-bsp/rmc/boards/NUC5i5RYB/POSTINSTALL.sh +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | # There is no tty device on this board. | ||
2 | sed -i '/start_getty.\+ttyS.*/d' /tgt_root/etc/inittab | ||
diff --git a/recipes-bsp/rmc/boards/NUC5i5RYB/boot.conf b/recipes-bsp/rmc/boards/NUC5i5RYB/boot.conf deleted file mode 100644 index b29fa45e..00000000 --- a/recipes-bsp/rmc/boards/NUC5i5RYB/boot.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title NUC5i5RYB boot | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=boot rootwait | ||
diff --git a/recipes-bsp/rmc/boards/NUC5i5RYB/install.conf b/recipes-bsp/rmc/boards/NUC5i5RYB/install.conf deleted file mode 100644 index 0dca3cae..00000000 --- a/recipes-bsp/rmc/boards/NUC5i5RYB/install.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title NUC5i5RYB install | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=install-efi rootwait | ||
diff --git a/recipes-bsp/rmc/boards/NUC5i5RYB/nuc5i5.fp b/recipes-bsp/rmc/boards/NUC5i5RYB/nuc5i5.fp deleted file mode 100644 index 57374779..00000000 --- a/recipes-bsp/rmc/boards/NUC5i5RYB/nuc5i5.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/T100-32bit/BOOTENTRY.CONFIG b/recipes-bsp/rmc/boards/T100-32bit/BOOTENTRY.CONFIG deleted file mode 100644 index b2fabe82..00000000 --- a/recipes-bsp/rmc/boards/T100-32bit/BOOTENTRY.CONFIG +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | boot.conf | ||
2 | install.conf | ||
diff --git a/recipes-bsp/rmc/boards/T100-32bit/T100-32bit.fp b/recipes-bsp/rmc/boards/T100-32bit/T100-32bit.fp deleted file mode 100644 index 86ecea73..00000000 --- a/recipes-bsp/rmc/boards/T100-32bit/T100-32bit.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/T100-32bit/boot.conf b/recipes-bsp/rmc/boards/T100-32bit/boot.conf deleted file mode 100644 index f1578e0f..00000000 --- a/recipes-bsp/rmc/boards/T100-32bit/boot.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title T100T(32bit) boot | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=boot loglevel=8 | ||
diff --git a/recipes-bsp/rmc/boards/T100-32bit/install.conf b/recipes-bsp/rmc/boards/T100-32bit/install.conf deleted file mode 100644 index 67e7eb18..00000000 --- a/recipes-bsp/rmc/boards/T100-32bit/install.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title T100T(32bit) install | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=install-efi | ||
diff --git a/recipes-bsp/rmc/boards/broxton-m/BOOTENTRY.CONFIG b/recipes-bsp/rmc/boards/broxton-m/BOOTENTRY.CONFIG deleted file mode 100644 index b2fabe82..00000000 --- a/recipes-bsp/rmc/boards/broxton-m/BOOTENTRY.CONFIG +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | boot.conf | ||
2 | install.conf | ||
diff --git a/recipes-bsp/rmc/boards/broxton-m/INSTALLER.CONFIG b/recipes-bsp/rmc/boards/broxton-m/INSTALLER.CONFIG deleted file mode 100644 index ecd20609..00000000 --- a/recipes-bsp/rmc/boards/broxton-m/INSTALLER.CONFIG +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | # Keep rmc Joule boot.conf instead of meta-intel default | ||
2 | efi_entry_dir:root:disk:770:/boot/loader/entries/ | ||
3 | boot.conf:root:disk:770:/boot/loader/entries/boot.conf | ||
diff --git a/recipes-bsp/rmc/boards/broxton-m/KBOOTPARAM b/recipes-bsp/rmc/boards/broxton-m/KBOOTPARAM deleted file mode 100644 index 08be5dfb..00000000 --- a/recipes-bsp/rmc/boards/broxton-m/KBOOTPARAM +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | video=efifb maxcpus=4 reboot=efi kmemleak=off console=tty0 console=ttyS2,115200 | ||
diff --git a/recipes-bsp/rmc/boards/broxton-m/POSTINSTALL.sh b/recipes-bsp/rmc/boards/broxton-m/POSTINSTALL.sh deleted file mode 100644 index 30bbd28e..00000000 --- a/recipes-bsp/rmc/boards/broxton-m/POSTINSTALL.sh +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | # Joule uses only S2 for serial, so remove S0 | ||
2 | sed -i '/start_getty.\+ttyS0/d' /tgt_root/etc/inittab | ||
diff --git a/recipes-bsp/rmc/boards/broxton-m/bm-1F1.fp b/recipes-bsp/rmc/boards/broxton-m/bm-1F1.fp deleted file mode 100755 index 1a150280..00000000 --- a/recipes-bsp/rmc/boards/broxton-m/bm-1F1.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/broxton-m/bm.fp b/recipes-bsp/rmc/boards/broxton-m/bm.fp deleted file mode 100755 index 135a7a5d..00000000 --- a/recipes-bsp/rmc/boards/broxton-m/bm.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/broxton-m/boot.conf b/recipes-bsp/rmc/boards/broxton-m/boot.conf deleted file mode 100644 index caa00c50..00000000 --- a/recipes-bsp/rmc/boards/broxton-m/boot.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title Joule / Broxton-m | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=boot | ||
diff --git a/recipes-bsp/rmc/boards/broxton-m/install.conf b/recipes-bsp/rmc/boards/broxton-m/install.conf deleted file mode 100644 index 9cdd86b7..00000000 --- a/recipes-bsp/rmc/boards/broxton-m/install.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title Joule / Broxton-m Install | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=install-efi rootwait | ||
diff --git a/recipes-bsp/rmc/boards/broxton-m/joule-1F1.fp b/recipes-bsp/rmc/boards/broxton-m/joule-1F1.fp deleted file mode 100644 index d757614f..00000000 --- a/recipes-bsp/rmc/boards/broxton-m/joule-1F1.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/minnowmax/BOOTENTRY.CONFIG b/recipes-bsp/rmc/boards/minnowmax/BOOTENTRY.CONFIG deleted file mode 100644 index b2fabe82..00000000 --- a/recipes-bsp/rmc/boards/minnowmax/BOOTENTRY.CONFIG +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | boot.conf | ||
2 | install.conf | ||
diff --git a/recipes-bsp/rmc/boards/minnowmax/boot.conf b/recipes-bsp/rmc/boards/minnowmax/boot.conf deleted file mode 100644 index 6e789cd8..00000000 --- a/recipes-bsp/rmc/boards/minnowmax/boot.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title Minnow Max boot | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=boot console=ttyS0,115200n8 | ||
diff --git a/recipes-bsp/rmc/boards/minnowmax/install.conf b/recipes-bsp/rmc/boards/minnowmax/install.conf deleted file mode 100644 index 1a493aec..00000000 --- a/recipes-bsp/rmc/boards/minnowmax/install.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title Minnow Max install | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=install-efi console=ttyS0,115200n8 | ||
diff --git a/recipes-bsp/rmc/boards/minnowmax/minnowmax.fp b/recipes-bsp/rmc/boards/minnowmax/minnowmax.fp deleted file mode 100644 index 3c5a286f..00000000 --- a/recipes-bsp/rmc/boards/minnowmax/minnowmax.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/minnowmaxB3/BOOTENTRY.CONFIG b/recipes-bsp/rmc/boards/minnowmaxB3/BOOTENTRY.CONFIG deleted file mode 100644 index b2fabe82..00000000 --- a/recipes-bsp/rmc/boards/minnowmaxB3/BOOTENTRY.CONFIG +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | boot.conf | ||
2 | install.conf | ||
diff --git a/recipes-bsp/rmc/boards/minnowmaxB3/boot.conf b/recipes-bsp/rmc/boards/minnowmaxB3/boot.conf deleted file mode 100644 index 577e5d6a..00000000 --- a/recipes-bsp/rmc/boards/minnowmaxB3/boot.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title Minnow Max B3 boot | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=boot console=ttyS0,115200n8 | ||
diff --git a/recipes-bsp/rmc/boards/minnowmaxB3/install.conf b/recipes-bsp/rmc/boards/minnowmaxB3/install.conf deleted file mode 100644 index cf500d6c..00000000 --- a/recipes-bsp/rmc/boards/minnowmaxB3/install.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title Minnow Max B3 install | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=install-efi console=ttyS0,115200n8 | ||
diff --git a/recipes-bsp/rmc/boards/minnowmaxB3/minnowmaxB3.fp b/recipes-bsp/rmc/boards/minnowmaxB3/minnowmaxB3.fp deleted file mode 100644 index ad3f0d6d..00000000 --- a/recipes-bsp/rmc/boards/minnowmaxB3/minnowmaxB3.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/mohonpeak/BOOTENTRY.CONFIG b/recipes-bsp/rmc/boards/mohonpeak/BOOTENTRY.CONFIG deleted file mode 100644 index b2fabe82..00000000 --- a/recipes-bsp/rmc/boards/mohonpeak/BOOTENTRY.CONFIG +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | boot.conf | ||
2 | install.conf | ||
diff --git a/recipes-bsp/rmc/boards/mohonpeak/INSTALLER.CONFIG b/recipes-bsp/rmc/boards/mohonpeak/INSTALLER.CONFIG deleted file mode 100644 index 8c5a7678..00000000 --- a/recipes-bsp/rmc/boards/mohonpeak/INSTALLER.CONFIG +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | # Keep rmc Mohonpeak boot.conf instead of meta-intel default | ||
2 | efi_entry_dir:root:disk:770:/boot/loader/entries/ | ||
3 | boot.conf:root:disk:770:/boot/loader/entries/boot.conf | ||
diff --git a/recipes-bsp/rmc/boards/mohonpeak/KBOOTPARAM b/recipes-bsp/rmc/boards/mohonpeak/KBOOTPARAM deleted file mode 100644 index 169056ee..00000000 --- a/recipes-bsp/rmc/boards/mohonpeak/KBOOTPARAM +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | console=ttyS1,115200 console=tty1 | ||
diff --git a/recipes-bsp/rmc/boards/mohonpeak/POSTINSTALL.sh b/recipes-bsp/rmc/boards/mohonpeak/POSTINSTALL.sh deleted file mode 100644 index 5f440c38..00000000 --- a/recipes-bsp/rmc/boards/mohonpeak/POSTINSTALL.sh +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | # Mohonpeak uses only S1 for serial, so remove S0 and S2 | ||
2 | sed -i '/start_getty.\+ttyS0/d' /tgt_root/etc/inittab | ||
3 | sed -i '/start_getty.\+ttyS2/d' /tgt_root/etc/inittab | ||
diff --git a/recipes-bsp/rmc/boards/mohonpeak/boot.conf b/recipes-bsp/rmc/boards/mohonpeak/boot.conf deleted file mode 100644 index 5b7a0f63..00000000 --- a/recipes-bsp/rmc/boards/mohonpeak/boot.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title Mohon Peak boot | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=boot | ||
diff --git a/recipes-bsp/rmc/boards/mohonpeak/install.conf b/recipes-bsp/rmc/boards/mohonpeak/install.conf deleted file mode 100644 index dde3497d..00000000 --- a/recipes-bsp/rmc/boards/mohonpeak/install.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title Mohon Peak Install | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=install-efi rootwait | ||
diff --git a/recipes-bsp/rmc/boards/mohonpeak/mohonpeak.fp b/recipes-bsp/rmc/boards/mohonpeak/mohonpeak.fp deleted file mode 100644 index bc4bdae4..00000000 --- a/recipes-bsp/rmc/boards/mohonpeak/mohonpeak.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/nucgen6/BOOTENTRY.CONFIG b/recipes-bsp/rmc/boards/nucgen6/BOOTENTRY.CONFIG deleted file mode 100644 index b2fabe82..00000000 --- a/recipes-bsp/rmc/boards/nucgen6/BOOTENTRY.CONFIG +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | boot.conf | ||
2 | install.conf | ||
diff --git a/recipes-bsp/rmc/boards/nucgen6/INSTALLER.CONFIG b/recipes-bsp/rmc/boards/nucgen6/INSTALLER.CONFIG deleted file mode 100644 index 7d5378b2..00000000 --- a/recipes-bsp/rmc/boards/nucgen6/INSTALLER.CONFIG +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | # This file specifies which file or dir RMC will install onto target. | ||
2 | # Note the absolute path is referred from mount points in installation. | ||
3 | efi_entry_dir:root:disk:770:/boot/loader/entries/ | ||
4 | boot.conf:root:disk:770:/boot/loader/entries/rmcboot.conf | ||
5 | mylibdir:root:root:770:/tgt_root/etc/mylib/ | ||
6 | mylib.conf:root:root:660:/tgt_root/etc/mylib/mylib.conf | ||
diff --git a/recipes-bsp/rmc/boards/nucgen6/KBOOTPARAM b/recipes-bsp/rmc/boards/nucgen6/KBOOTPARAM deleted file mode 100644 index 27943b49..00000000 --- a/recipes-bsp/rmc/boards/nucgen6/KBOOTPARAM +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | i915.preliminary_hw_support=1 | ||
diff --git a/recipes-bsp/rmc/boards/nucgen6/POSTINSTALL.sh b/recipes-bsp/rmc/boards/nucgen6/POSTINSTALL.sh deleted file mode 100644 index bec3be42..00000000 --- a/recipes-bsp/rmc/boards/nucgen6/POSTINSTALL.sh +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | # NUC Gen 6 specific retouch after RMC deployment | ||
2 | |||
3 | # The generated inittab from OE build causes error messages: | ||
4 | # "auth.err getty[615]: tcgetattr: Input/output error" | ||
5 | # in /var/log/messages because NUC Gen 6 doesn't have any | ||
6 | # serial tty. We delete line(s) here on target. | ||
7 | sed -i '/start_getty.\+ttyS.*/d' /tgt_root/etc/inittab | ||
diff --git a/recipes-bsp/rmc/boards/nucgen6/boot.conf b/recipes-bsp/rmc/boards/nucgen6/boot.conf deleted file mode 100644 index e6ecb029..00000000 --- a/recipes-bsp/rmc/boards/nucgen6/boot.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title NUC Gen6 boot | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=boot | ||
diff --git a/recipes-bsp/rmc/boards/nucgen6/install.conf b/recipes-bsp/rmc/boards/nucgen6/install.conf deleted file mode 100644 index 916bb04b..00000000 --- a/recipes-bsp/rmc/boards/nucgen6/install.conf +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | title NUC Gen6 install | ||
2 | linux /vmlinuz | ||
3 | initrd /initrd | ||
4 | options LABEL=install-efi | ||
diff --git a/recipes-bsp/rmc/boards/nucgen6/mylib.conf b/recipes-bsp/rmc/boards/nucgen6/mylib.conf deleted file mode 100644 index fd8357c2..00000000 --- a/recipes-bsp/rmc/boards/nucgen6/mylib.conf +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | # This is a demo conf file read by an imagined program or library | ||
2 | # which reads this file at runtime to customize its behavior. | ||
3 | # rmc will deploy it to the location specified in INSTALLER.CONFIG. | ||
4 | |||
5 | lib.info = "V1.0 for rmc demo" | ||
6 | lib.board = "NUC gen 6" | ||
7 | prog.ui.layout = "minimal" | ||
diff --git a/recipes-bsp/rmc/boards/nucgen6/nuc6.fp b/recipes-bsp/rmc/boards/nucgen6/nuc6.fp deleted file mode 100644 index 834f800b..00000000 --- a/recipes-bsp/rmc/boards/nucgen6/nuc6.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/qemu-2.6/KBOOTPARAM b/recipes-bsp/rmc/boards/qemu-2.6/KBOOTPARAM deleted file mode 100644 index 476b1fbe..00000000 --- a/recipes-bsp/rmc/boards/qemu-2.6/KBOOTPARAM +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | console=ttyS0,115200 | ||
diff --git a/recipes-bsp/rmc/boards/qemu-2.6/qemu-2.6.fp b/recipes-bsp/rmc/boards/qemu-2.6/qemu-2.6.fp deleted file mode 100644 index e4c41657..00000000 --- a/recipes-bsp/rmc/boards/qemu-2.6/qemu-2.6.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/boards/qemu-2.8/KBOOTPARAM b/recipes-bsp/rmc/boards/qemu-2.8/KBOOTPARAM deleted file mode 100644 index 476b1fbe..00000000 --- a/recipes-bsp/rmc/boards/qemu-2.8/KBOOTPARAM +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | console=ttyS0,115200 | ||
diff --git a/recipes-bsp/rmc/boards/qemu-2.8/qemu-2.8.fp b/recipes-bsp/rmc/boards/qemu-2.8/qemu-2.8.fp deleted file mode 100644 index 7f28f37c..00000000 --- a/recipes-bsp/rmc/boards/qemu-2.8/qemu-2.8.fp +++ /dev/null | |||
Binary files differ | |||
diff --git a/recipes-bsp/rmc/rmc-db.bb b/recipes-bsp/rmc/rmc-db.bb deleted file mode 100644 index 7ec824a8..00000000 --- a/recipes-bsp/rmc/rmc-db.bb +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | SUMMARY = "Central RMC Database" | ||
2 | DESCRIPTION = "Generate a centralized RMC database for RMC feature. \ | ||
3 | Fingerprints and data for all boards supported are specified by variable \ | ||
4 | RMC_BOARD_DATA_DIRS which is a list of top directories that contains \ | ||
5 | subdirectories for boards. Developers can add their top directories by appending \ | ||
6 | them to this variable in a rmc-db.bbappend.Refer to rmc-db bbclass for more \ | ||
7 | information." | ||
8 | |||
9 | LICENSE = "MIT" | ||
10 | |||
11 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
12 | |||
13 | S = "${WORKDIR}" | ||
14 | |||
15 | inherit rmc-db | ||
16 | |||
17 | RMC_BOARD_DATA_DIRS ?= "${THISDIR}/boards/" | ||
18 | RMC_DB_DIR = "${WORKDIR}/db" | ||
19 | |||
20 | FILES_${PN} = "/boot/rmc.db" | ||
21 | |||
22 | # Let sstate be aware of change in any added board directories | ||
23 | do_generate_rmc_db[file-checksums] = "${@get_rmc_top_dirs_list(d)}" | ||
24 | |||
25 | # derived from get_lic_checksum_file_list(d) in base.bbclass in OE | ||
26 | def get_rmc_top_dirs_list(d): | ||
27 | dirlist = [] | ||
28 | dirs = d.getVar("RMC_BOARD_DATA_DIRS", True) or '' | ||
29 | topdirs = dirs.split() | ||
30 | for each in topdirs: | ||
31 | dirlist.append(each + ":" + str(os.path.exists(each))) | ||
32 | return " ".join(dirlist) | ||
33 | |||
34 | do_generate_rmc_db () { | ||
35 | rmc_generate_db "${RMC_BOARD_DATA_DIRS}" "${RMC_DB_DIR}"/rmc.db | ||
36 | } | ||
37 | |||
38 | addtask generate_rmc_db after do_compile | ||
39 | |||
40 | inherit deploy | ||
41 | |||
42 | do_deploy () { | ||
43 | if [ -f ${RMC_DB_DIR}/rmc.db ]; then | ||
44 | install -m 0400 ${RMC_DB_DIR}/rmc.db ${DEPLOYDIR} | ||
45 | else | ||
46 | rm -f ${DEPLOYDIR}/rmc.db | ||
47 | echo "Warning: no RMC central database found, skip deployment." | ||
48 | fi | ||
49 | } | ||
50 | |||
51 | do_install () { | ||
52 | install -d ${D}/boot | ||
53 | if [ -f ${RMC_DB_DIR}/rmc.db ]; then | ||
54 | install -m 0400 ${RMC_DB_DIR}/rmc.db ${D}/boot/ | ||
55 | else | ||
56 | rm -f ${D}/rmc.db | ||
57 | echo "Warning: no RMC central database found, skip installation." | ||
58 | fi | ||
59 | } | ||
60 | do_install[depends] += "${PN}:do_generate_rmc_db" | ||
61 | |||
62 | addtask deploy after do_generate_rmc_db | ||
diff --git a/recipes-bsp/rmc/rmc-efi.bb b/recipes-bsp/rmc/rmc-efi.bb deleted file mode 100644 index 2a1c9a98..00000000 --- a/recipes-bsp/rmc/rmc-efi.bb +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | SUMMARY = "RMC (Runtime Machine Configuration) EFI library" | ||
2 | |||
3 | DESCRIPTION = "The RMC EFI library adds RMC support to existing EFI bootloaders" | ||
4 | |||
5 | LICENSE = "MIT" | ||
6 | |||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=ade413c694d3aaefc9554b24a8814ee8" | ||
8 | |||
9 | SRC_URI = "git://git.yoctoproject.org/rmc" | ||
10 | |||
11 | SRCREV = "027ac76f642dcab1a9f237a00f03a3a714bd04b9" | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | |||
15 | COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*" | ||
16 | |||
17 | TARGET_CFLAGS +="-Wl,--hash-style=both" | ||
18 | |||
19 | EXTRA_OEMAKE = "RMC_INSTALL_PREFIX=${D}/${prefix} \ | ||
20 | RMC_INSTALL_LIB_PATH=${D}${libdir} \ | ||
21 | RMC_INSTALL_HEADER_PATH=${D}${includedir}/rmc" | ||
22 | |||
23 | SECURITY_CFLAGS_remove_class-target = "-fstack-protector-strong" | ||
24 | SECURITY_CFLAGS_append_class-target = " -fno-stack-protector" | ||
25 | |||
26 | python () { | ||
27 | ccargs = d.getVar('TUNE_CCARGS').split() | ||
28 | if '-mx32' in ccargs: | ||
29 | ccargs.remove('-mx32') | ||
30 | ccargs.append('-m64') | ||
31 | d.setVar('TUNE_CCARGS', ' '.join(ccargs)) | ||
32 | } | ||
33 | |||
34 | do_compile() { | ||
35 | oe_runmake -f Makefile.efi | ||
36 | } | ||
37 | |||
38 | do_install() { | ||
39 | oe_runmake -f Makefile.efi install | ||
40 | } | ||
diff --git a/recipes-bsp/rmc/rmc.bb b/recipes-bsp/rmc/rmc.bb deleted file mode 100644 index 8797644b..00000000 --- a/recipes-bsp/rmc/rmc.bb +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | SUMMARY = "RMC (Runtime Machine Configuration)" | ||
2 | |||
3 | DESCRIPTION = "RMC project provides a tool and libraries to identify types \ | ||
4 | of hardware boards and access any file-based data specific to the board's \ | ||
5 | type at runtime in a centralized way. Software (clients) can have a generic \ | ||
6 | logic to query board-specific data from RMC without knowing the type of board. \ | ||
7 | This make it possible to have a generic software work running on boards which \ | ||
8 | require any quirks or customizations at a board or product level. \ | ||
9 | " | ||
10 | |||
11 | LICENSE = "MIT" | ||
12 | |||
13 | LIC_FILES_CHKSUM = "file://COPYING;md5=ade413c694d3aaefc9554b24a8814ee8" | ||
14 | |||
15 | SRC_URI = "git://git.yoctoproject.org/rmc" | ||
16 | |||
17 | SRCREV = "027ac76f642dcab1a9f237a00f03a3a714bd04b9" | ||
18 | |||
19 | S = "${WORKDIR}/git" | ||
20 | |||
21 | COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*" | ||
22 | |||
23 | TARGET_CFLAGS +="-Wl,--hash-style=both" | ||
24 | |||
25 | EXTRA_OEMAKE = "RMC_INSTALL_PREFIX=${D}/${prefix} \ | ||
26 | RMC_INSTALL_BIN_PATH=${D}${bindir} \ | ||
27 | RMC_INSTALL_LIB_PATH=${D}${libdir} \ | ||
28 | RMC_INSTALL_HEADER_PATH=${D}${includedir}/rmc" | ||
29 | |||
30 | SECURITY_CFLAGS_remove_class-target = "-fstack-protector-strong" | ||
31 | SECURITY_CFLAGS_append_class-target = " -fno-stack-protector" | ||
32 | |||
33 | do_compile_class-target() { | ||
34 | oe_runmake | ||
35 | } | ||
36 | |||
37 | do_install() { | ||
38 | oe_runmake install | ||
39 | } | ||
40 | |||
41 | do_install_class-native() { | ||
42 | install -d ${D}${STAGING_BINDIR_NATIVE} | ||
43 | install -m 0755 ${S}/src/rmc ${D}${STAGING_BINDIR_NATIVE} | ||
44 | } | ||
45 | |||
46 | BBCLASSEXTEND = "native" | ||
diff --git a/recipes-bsp/systemd-boot/systemd-boot/0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch b/recipes-bsp/systemd-boot/systemd-boot/0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch deleted file mode 100644 index 6d7b144d..00000000 --- a/recipes-bsp/systemd-boot/systemd-boot/0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | From beb095f41d458b7d684c0cd6cac1749e2fc3f29b Mon Sep 17 00:00:00 2001 | ||
2 | From: California Sullivan <california.l.sullivan@intel.com> | ||
3 | Date: Wed, 21 Mar 2018 13:01:26 -0700 | ||
4 | Subject: [PATCH 1/5] partially revert "sd-boot: stub: Obtain PE section | ||
5 | offsets from RAM, not disk (#6250)" | ||
6 | |||
7 | Only revert the section for finding the root_dir, as RMC needs this to | ||
8 | find its database file. | ||
9 | |||
10 | Upstream-Status: Inappropriate [upstream doesn't need the root_dir]. | ||
11 | |||
12 | Signed-off-by: California Sullivan <california.l.sullivan@intel.com> | ||
13 | --- | ||
14 | src/boot/efi/stub.c | 9 +++++++++ | ||
15 | 1 file changed, 9 insertions(+) | ||
16 | |||
17 | diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c | ||
18 | index ff45cebd4..540ca5985 100644 | ||
19 | --- a/src/boot/efi/stub.c | ||
20 | +++ b/src/boot/efi/stub.c | ||
21 | @@ -30,6 +30,8 @@ static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE; | ||
22 | |||
23 | EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | ||
24 | EFI_LOADED_IMAGE *loaded_image; | ||
25 | + EFI_FILE *root_dir; | ||
26 | + CHAR16 *loaded_image_path; | ||
27 | CHAR8 *b; | ||
28 | UINTN size; | ||
29 | BOOLEAN secure = FALSE; | ||
30 | @@ -58,6 +60,13 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | ||
31 | return err; | ||
32 | } | ||
33 | |||
34 | + root_dir = LibOpenRoot(loaded_image->DeviceHandle); | ||
35 | + if (!root_dir) { | ||
36 | + Print(L"Unable to open root directory: %r ", err); | ||
37 | + uefi_call_wrapper(BS->Stall, 1, 3 * 1000 * 1000); | ||
38 | + return EFI_LOAD_ERROR; | ||
39 | + } | ||
40 | + | ||
41 | if (efivar_get_raw(&global_guid, L"SecureBoot", &b, &size) == EFI_SUCCESS) { | ||
42 | if (*b > 0) | ||
43 | secure = TRUE; | ||
44 | -- | ||
45 | 2.14.3 | ||
46 | |||
diff --git a/recipes-bsp/systemd-boot/systemd-boot/0002-sd-boot-fix-RMC-compatibility-with-systemd-boot-and-.patch b/recipes-bsp/systemd-boot/systemd-boot/0002-sd-boot-fix-RMC-compatibility-with-systemd-boot-and-.patch deleted file mode 100644 index a3e496f5..00000000 --- a/recipes-bsp/systemd-boot/systemd-boot/0002-sd-boot-fix-RMC-compatibility-with-systemd-boot-and-.patch +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | From af977853ab722194c4754e6693f430f50a42190f Mon Sep 17 00:00:00 2001 | ||
2 | From: California Sullivan <california.l.sullivan@intel.com> | ||
3 | Date: Tue, 20 Mar 2018 10:08:14 -0700 | ||
4 | Subject: [PATCH 2/5] sd-boot: fix RMC compatibility with systemd-boot and | ||
5 | meson | ||
6 | |||
7 | With autotools swapped out for meson a number of things need to be | ||
8 | changed. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: California Sullivan <california.l.sullivan@intel.com> | ||
13 | --- | ||
14 | meson_options.txt | 2 ++ | ||
15 | src/boot/efi/meson.build | 4 +++- | ||
16 | 2 files changed, 5 insertions(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/meson_options.txt b/meson_options.txt | ||
19 | index 39822d6cd..d8a480401 100644 | ||
20 | --- a/meson_options.txt | ||
21 | +++ b/meson_options.txt | ||
22 | @@ -279,6 +279,8 @@ option('efi-ldsdir', type : 'string', | ||
23 | description : 'path to the EFI lds directory') | ||
24 | option('efi-includedir', type : 'string', value : '/usr/include/efi', | ||
25 | description : 'path to the EFI header directory') | ||
26 | +option('rmc-includedir', type : 'string', value : '/usr/include/rmc', | ||
27 | + description : 'path to the RMC header directory') | ||
28 | option('tpm-pcrindex', type : 'string', value : '8', | ||
29 | description : 'TPM PCR register number to use') | ||
30 | |||
31 | diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build | ||
32 | index 9f9ec4911..266ff928f 100644 | ||
33 | --- a/src/boot/efi/meson.build | ||
34 | +++ b/src/boot/efi/meson.build | ||
35 | @@ -83,6 +83,7 @@ if have_gnu_efi | ||
36 | efi_conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME) | ||
37 | efi_conf.set10('ENABLE_TPM', get_option('tpm')) | ||
38 | efi_conf.set('SD_TPM_PCR', get_option('tpm-pcrindex')) | ||
39 | + efi_conf.set('RMC_EFI', 'true') | ||
40 | |||
41 | efi_config_h = configure_file( | ||
42 | output : 'efi_config.h', | ||
43 | @@ -121,6 +122,7 @@ if have_gnu_efi | ||
44 | '-Wsign-compare', | ||
45 | '-Wno-missing-field-initializers', | ||
46 | '-isystem', efi_incdir, | ||
47 | + '-isystem', get_option('rmc-includedir'), | ||
48 | '-isystem', join_paths(efi_incdir, gnu_efi_arch), | ||
49 | '-include', efi_config_h] | ||
50 | if efi_arch == 'x86_64' | ||
51 | @@ -191,7 +193,7 @@ if have_gnu_efi | ||
52 | output : tuple[0], | ||
53 | command : efi_ld.split() + ['-o', '@OUTPUT@'] + | ||
54 | efi_ldflags + tuple[2] + | ||
55 | - ['-lefi', '-lgnuefi', libgcc_file_name]) | ||
56 | + ['-lefi', '-lgnuefi', '-lrmcefi', libgcc_file_name]) | ||
57 | |||
58 | test('no-undefined-symbols-' + tuple[0], | ||
59 | no_undefined_symbols, | ||
60 | -- | ||
61 | 2.14.3 | ||
62 | |||
diff --git a/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch b/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch deleted file mode 100644 index cef934ce..00000000 --- a/recipes-bsp/systemd-boot/systemd-boot/0003-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch +++ /dev/null | |||
@@ -1,252 +0,0 @@ | |||
1 | From b780c67c780bae2f834d73017044680fabca4268 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jianxun Zhang <jianxun.zhang@linux.intel.com> | ||
3 | Date: Wed, 1 Jun 2016 16:32:22 -0700 | ||
4 | Subject: [PATCH 3/5] sd-boot: Load board-specific boot entries from RMC | ||
5 | database | ||
6 | |||
7 | RMC provides a centralized database file on ESP. The DB contains | ||
8 | fingerprints and any file blobs associated to physical boards. | ||
9 | Callers can fetch board-specific data with fingerprint info | ||
10 | collected from board at runtime if there is any record matched | ||
11 | board's fingerprint. | ||
12 | |||
13 | To let bootloader know which file blob in RMC should be queried, | ||
14 | a special config file BOOTENTRY.CONFIG is defined as: | ||
15 | |||
16 | boot.conf | ||
17 | install.conf | ||
18 | |||
19 | Bootloader calls RMC APIs and other functions to perform these | ||
20 | tasks before it shows boot menu to user: | ||
21 | |||
22 | (1) Load RMC database file from ESP | ||
23 | (2) Collect fingerprint data from board | ||
24 | (3) Query BOOTENTRY.CONFIG from RMC DB with fingerprint | ||
25 | (4) Parse BOOTENTRY.CONFIG to know names of boot entry files | ||
26 | (5) Query boot entry files one by one from RMC DB, and add | ||
27 | them into sd-boot config data. | ||
28 | |||
29 | The final effect is that bootloader will show board-specific | ||
30 | boot entries in boot menu to user. User then can choose one | ||
31 | of them to boot system with the selected configuration. | ||
32 | |||
33 | If any of these steps fails, bootloader simply skips loading | ||
34 | RMC configs or any entry file not successfully fetched from | ||
35 | RMC DB. Once any entry is loaded successfully from RMC DB, | ||
36 | bootloader skips loading any boot entries from ESP. | ||
37 | |||
38 | Upstream-Status: Pending | ||
39 | |||
40 | Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com> | ||
41 | Signed-off-by: California Sullivan <california.l.sullivan@intel.com> | ||
42 | --- | ||
43 | src/boot/efi/boot.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++- | ||
44 | 1 file changed, 146 insertions(+), 2 deletions(-) | ||
45 | |||
46 | diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c | ||
47 | index b9c7c8394..93cfaf193 100644 | ||
48 | --- a/src/boot/efi/boot.c | ||
49 | +++ b/src/boot/efi/boot.c | ||
50 | @@ -16,6 +16,7 @@ | ||
51 | |||
52 | #include <efi.h> | ||
53 | #include <efilib.h> | ||
54 | +#include <rmc_api.h> | ||
55 | |||
56 | #include "console.h" | ||
57 | #include "disk.h" | ||
58 | @@ -35,6 +36,9 @@ static const char __attribute__((used)) magic[] = "#### LoaderInfo: systemd-boot | ||
59 | |||
60 | static const EFI_GUID global_guid = EFI_GLOBAL_VARIABLE; | ||
61 | |||
62 | +static CHAR8* rmc_db; | ||
63 | +static rmc_fingerprint_t *rmc_fp; | ||
64 | + | ||
65 | enum loader_type { | ||
66 | LOADER_UNDEFINED, | ||
67 | LOADER_EFI, | ||
68 | @@ -1684,6 +1688,136 @@ static VOID config_free(Config *config) { | ||
69 | FreePool(config->entry_oneshot); | ||
70 | } | ||
71 | |||
72 | +/* Derived from line_get_key_value(), we could consolidate two functions later */ | ||
73 | +static CHAR8 *get_line(CHAR8 *content, UINT64 *pos) { | ||
74 | + CHAR8 *line; | ||
75 | + UINT64 linelen; | ||
76 | + | ||
77 | +skip: | ||
78 | + line = content + *pos; | ||
79 | + if (*line == '\0') | ||
80 | + return NULL; | ||
81 | + | ||
82 | + linelen = 0; | ||
83 | + while (line[linelen] && !strchra((CHAR8 *)"\n\r", line[linelen])) | ||
84 | + linelen++; | ||
85 | + | ||
86 | + /* move pos to next line */ | ||
87 | + *pos += linelen; | ||
88 | + if (content[*pos]) | ||
89 | + (*pos)++; | ||
90 | + | ||
91 | + /* empty line */ | ||
92 | + if (linelen == 0) | ||
93 | + goto skip; | ||
94 | + | ||
95 | + /* terminate line */ | ||
96 | + line[linelen] = '\0'; | ||
97 | + | ||
98 | + /* remove leading whitespace */ | ||
99 | + while (strchra((CHAR8 *)" \t", *line)) { | ||
100 | + line++; | ||
101 | + linelen--; | ||
102 | + } | ||
103 | + | ||
104 | + /* remove trailing whitespace */ | ||
105 | + while (linelen > 0 && strchra((CHAR8 *)" \t", line[linelen-1])) | ||
106 | + linelen--; | ||
107 | + line[linelen] = '\0'; | ||
108 | + | ||
109 | + if (*line == '#') | ||
110 | + goto skip; | ||
111 | + | ||
112 | + return line; | ||
113 | +} | ||
114 | + | ||
115 | +/* load rmc database file from ESP and try to get fingerprint. These | ||
116 | + * are essential information indicating we could query rmc data for | ||
117 | + * this board at least | ||
118 | + * return 0 if both database file and fingerprint can be obtained, otherwise | ||
119 | + * non-zero value is returned. | ||
120 | + * | ||
121 | + * Note: db and fp hold valid values only when this function returns 0. | ||
122 | + * Caller is responsible to free allocated memory pointed by *db and *fp when | ||
123 | + * this function returns 0. | ||
124 | + */ | ||
125 | + | ||
126 | +static UINTN rmc_initialize(EFI_FILE *root_dir, EFI_SYSTEM_TABLE *sys_table, CHAR8 **db, rmc_fingerprint_t **fp) { | ||
127 | + UINTN len; | ||
128 | + UINTN ret = 1; | ||
129 | + | ||
130 | + if (!db || !fp) | ||
131 | + return ret; | ||
132 | + | ||
133 | + *db = NULL; | ||
134 | + *fp = NULL; | ||
135 | + | ||
136 | + /* load rmc database */ | ||
137 | + len = file_read(root_dir, L"\\rmc.db", 0, 0, db); | ||
138 | + | ||
139 | + if (len <= 0) | ||
140 | + goto done; | ||
141 | + | ||
142 | + *fp = AllocateZeroPool(sizeof(rmc_fingerprint_t)); | ||
143 | + /* call rmc to get fingerprint. We will use single-action rmc APIs to query multiple files. | ||
144 | + * This should bring a better performance than calling double-action rmc API every time. | ||
145 | + */ | ||
146 | + if (rmc_get_fingerprint(sys_table, *fp)) | ||
147 | + goto done; | ||
148 | + | ||
149 | + ret = 0; | ||
150 | +done: | ||
151 | + if (ret) { | ||
152 | + FreePool(*db); | ||
153 | + FreePool(*fp); | ||
154 | + } | ||
155 | + | ||
156 | + return ret; | ||
157 | +} | ||
158 | + | ||
159 | +/* load RMC entries | ||
160 | + * return TRUE when at least one entry is loaded, otherwise, return FALSE | ||
161 | + */ | ||
162 | +static BOOLEAN config_load_rmc_entries(Config *config, EFI_HANDLE *device, CHAR16 *loaded_image_path, CHAR8 *db, rmc_fingerprint_t *fp) { | ||
163 | + CHAR8 *boot_entry = NULL; | ||
164 | + CHAR8 *boot_config = NULL; | ||
165 | + rmc_file_t rp; | ||
166 | + CHAR8 *line; | ||
167 | + UINT64 pos = 0; | ||
168 | + BOOLEAN ret = FALSE; | ||
169 | + | ||
170 | + if (!db || !fp) | ||
171 | + return ret; | ||
172 | + | ||
173 | + /* query boot entry config file */ | ||
174 | + if (rmc_query_file_by_fp(fp, db, "BOOTENTRY.CONFIG", &rp)) | ||
175 | + return ret; | ||
176 | + | ||
177 | + /* file blob read from rmc db is not necessarily null-terminated, and we | ||
178 | + * should keep mem where rmc db lives from change during parsing | ||
179 | + */ | ||
180 | + boot_config = AllocatePool(rp.blob_len * sizeof(CHAR8) + 1); | ||
181 | + CopyMem(boot_config, rp.blob, rp.blob_len); | ||
182 | + boot_config[rp.blob_len] = '\0'; | ||
183 | + /* parse boot entry config */ | ||
184 | + while ((line = get_line(boot_config, &pos))) { | ||
185 | + if (rmc_query_file_by_fp(fp, db, (char *)line, &rp)) | ||
186 | + continue; | ||
187 | + if (rp.blob_len > 0) { | ||
188 | + boot_entry = AllocatePool(rp.blob_len * sizeof(CHAR8) + 1); | ||
189 | + CopyMem(boot_entry, rp.blob, rp.blob_len); | ||
190 | + boot_entry[rp.blob_len] = '\0'; | ||
191 | + config_entry_add_from_file(config, device, | ||
192 | + stra_to_str(line), boot_entry, | ||
193 | + loaded_image_path); | ||
194 | + /* tell caller success when a RMC entry is loaded */ | ||
195 | + ret = TRUE; | ||
196 | + } | ||
197 | + } | ||
198 | + | ||
199 | + return ret; | ||
200 | +} | ||
201 | + | ||
202 | EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | ||
203 | CHAR16 *s; | ||
204 | CHAR8 *b; | ||
205 | @@ -1696,6 +1830,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | ||
206 | UINT64 init_usec; | ||
207 | BOOLEAN menu = FALSE; | ||
208 | CHAR16 uuid[37]; | ||
209 | + BOOLEAN rmc_entry = FALSE; | ||
210 | |||
211 | InitializeLib(image, sys_table); | ||
212 | init_usec = time_usec(); | ||
213 | @@ -1736,6 +1871,9 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | ||
214 | } | ||
215 | } | ||
216 | |||
217 | + /* Initialize rmc before loading any config */ | ||
218 | + rmc_initialize(root_dir, sys_table, &rmc_db, &rmc_fp); | ||
219 | + | ||
220 | /* the filesystem path to this image, to prevent adding ourselves to the menu */ | ||
221 | loaded_image_path = DevicePathToStr(loaded_image->FilePath); | ||
222 | efivar_set(L"LoaderImageIdentifier", loaded_image_path, FALSE); | ||
223 | @@ -1743,11 +1881,15 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | ||
224 | ZeroMem(&config, sizeof(Config)); | ||
225 | config_load_defaults(&config, root_dir); | ||
226 | |||
227 | + if (rmc_db && rmc_fp) | ||
228 | + rmc_entry = config_load_rmc_entries(&config, loaded_image->DeviceHandle, loaded_image_path, rmc_db, rmc_fp); | ||
229 | + | ||
230 | /* scan /EFI/Linux/ directory */ | ||
231 | config_entry_add_linux(&config, loaded_image, root_dir); | ||
232 | |||
233 | - /* scan /loader/entries/\*.conf files */ | ||
234 | - config_load_entries(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path); | ||
235 | + /* scan /loader/entries/\*.conf files only when no RMC entry is loaded */ | ||
236 | + if (rmc_entry == FALSE) | ||
237 | + config_load_entries(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path); | ||
238 | |||
239 | /* sort entries after version number */ | ||
240 | config_sort_entries(&config); | ||
241 | @@ -1841,6 +1983,8 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | ||
242 | out: | ||
243 | FreePool(loaded_image_path); | ||
244 | config_free(&config); | ||
245 | + FreePool(rmc_db); | ||
246 | + FreePool(rmc_fp); | ||
247 | uefi_call_wrapper(root_dir->Close, 1, root_dir); | ||
248 | uefi_call_wrapper(BS->CloseProtocol, 4, image, &LoadedImageProtocol, image, NULL); | ||
249 | return err; | ||
250 | -- | ||
251 | 2.14.3 | ||
252 | |||
diff --git a/recipes-bsp/systemd-boot/systemd-boot/0004-sd-boot-Support-global-kernel-command-line-fragment.patch b/recipes-bsp/systemd-boot/systemd-boot/0004-sd-boot-Support-global-kernel-command-line-fragment.patch deleted file mode 100644 index b4dd9c42..00000000 --- a/recipes-bsp/systemd-boot/systemd-boot/0004-sd-boot-Support-global-kernel-command-line-fragment.patch +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | From 159c8c54f92fb44d8abd2919fa83ad1cb640fac3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jianxun Zhang <jianxun.zhang@linux.intel.com> | ||
3 | Date: Mon, 20 Jun 2016 13:08:20 -0700 | ||
4 | Subject: [PATCH 4/5] sd-boot: Support global kernel command line fragment | ||
5 | |||
6 | Query file blob KBOOTPARAM from RMC. If it exists, we append | ||
7 | it to the new linux boot entry's cmdline. A boot entry could | ||
8 | be read from a .conf file on ESP, RMC database, or embedded | ||
9 | linux image. content in KBOOTPARAM is effective in all of | ||
10 | these cases. | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com> | ||
15 | Signed-off-by: California Sullivan <california.l.sullivan@intel.com> | ||
16 | --- | ||
17 | src/boot/efi/boot.c | 34 ++++++++++++++++++++++++++++++++++ | ||
18 | 1 file changed, 34 insertions(+) | ||
19 | |||
20 | diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c | ||
21 | index 93cfaf193..2f400db3c 100644 | ||
22 | --- a/src/boot/efi/boot.c | ||
23 | +++ b/src/boot/efi/boot.c | ||
24 | @@ -851,6 +851,40 @@ static VOID config_add_entry(Config *config, ConfigEntry *entry) { | ||
25 | config->entries = ReallocatePool(config->entries, | ||
26 | sizeof(VOID *) * config->entry_count, sizeof(VOID *) * i); | ||
27 | } | ||
28 | + | ||
29 | + /* rmc: a linux entry could be added from .conf file or an embedded linux image | ||
30 | + * we put appending global command line here to cover both of two cases. | ||
31 | + */ | ||
32 | + if (entry->type == LOADER_LINUX && rmc_db && rmc_fp) { | ||
33 | + rmc_file_t rmc_kp; | ||
34 | + | ||
35 | + if (!rmc_query_file_by_fp(rmc_fp, rmc_db, "KBOOTPARAM", &rmc_kp)) { | ||
36 | + CHAR8 *cmdline; | ||
37 | + CHAR16 *s; | ||
38 | + CHAR16 *t; | ||
39 | + CHAR16 *p; | ||
40 | + | ||
41 | + cmdline = AllocatePool(rmc_kp.blob_len * sizeof(CHAR8) + 1); | ||
42 | + CopyMem(cmdline, rmc_kp.blob, rmc_kp.blob_len); | ||
43 | + cmdline[rmc_kp.blob_len] = '\0'; | ||
44 | + p = stra_to_str(cmdline); | ||
45 | + t = p; | ||
46 | + | ||
47 | + while (*t) { | ||
48 | + if (*t == '\n') | ||
49 | + *t = '\0'; | ||
50 | + t++; | ||
51 | + } | ||
52 | + | ||
53 | + s = PoolPrint(L"%s %s", entry->options, p); | ||
54 | + FreePool(entry->options); | ||
55 | + FreePool(p); | ||
56 | + FreePool(cmdline); | ||
57 | + | ||
58 | + entry->options = s; | ||
59 | + } | ||
60 | + } | ||
61 | + | ||
62 | config->entries[config->entry_count++] = entry; | ||
63 | } | ||
64 | |||
65 | -- | ||
66 | 2.14.3 | ||
67 | |||
diff --git a/recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch b/recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch deleted file mode 100644 index 60e93ca8..00000000 --- a/recipes-bsp/systemd-boot/systemd-boot/0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | From 405a77233dde990fa7815d1546dc5a6b5a608479 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mikko Ylinen <mikko.ylinen@intel.com> | ||
3 | Date: Fri, 27 Jan 2017 13:31:45 +0200 | ||
4 | Subject: [PATCH 5/5] sd-boot: support global kernel command line in EFI stub | ||
5 | |||
6 | This change integrates rmc into EFI stub and supports a | ||
7 | global fragment (RMC KBOOTPARAM) that is appended to the | ||
8 | cmdline at boot. | ||
9 | |||
10 | The fragment is board-specific and read from the database. | ||
11 | |||
12 | Implements [YOCTO #10924]. | ||
13 | |||
14 | Upstream-status: Pending | ||
15 | |||
16 | Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com> | ||
17 | Signed-off-by: California Sullivan <california.l.sullivan@intel.com> | ||
18 | --- | ||
19 | src/boot/efi/stub.c | 33 +++++++++++++++++++++++++++++++++ | ||
20 | 1 file changed, 33 insertions(+) | ||
21 | |||
22 | diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c | ||
23 | index 540ca5985..11047477b 100644 | ||
24 | --- a/src/boot/efi/stub.c | ||
25 | +++ b/src/boot/efi/stub.c | ||
26 | @@ -14,6 +14,7 @@ | ||
27 | |||
28 | #include <efi.h> | ||
29 | #include <efilib.h> | ||
30 | +#include <rmc_api.h> | ||
31 | |||
32 | #include "disk.h" | ||
33 | #include "graphics.h" | ||
34 | @@ -49,6 +50,9 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | ||
35 | UINTN cmdline_len; | ||
36 | CHAR16 uuid[37]; | ||
37 | EFI_STATUS err; | ||
38 | + INTN len; | ||
39 | + CHAR8 *rmc_db = NULL; | ||
40 | + rmc_file_t rmc_file; | ||
41 | |||
42 | InitializeLib(image, sys_table); | ||
43 | |||
44 | @@ -109,6 +113,35 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { | ||
45 | #endif | ||
46 | } | ||
47 | |||
48 | + len = file_read(root_dir, L"\\rmc.db", 0, 0, &rmc_db); | ||
49 | + if (len <= 0) | ||
50 | + rmc_db = NULL; | ||
51 | + | ||
52 | + /* If the board has a fragment in rmc database, append it to the cmdline */ | ||
53 | + if (rmc_db && !rmc_gimme_file(sys_table, rmc_db, "KBOOTPARAM", &rmc_file)) { | ||
54 | + CHAR8 *line; | ||
55 | + UINTN i = 0; | ||
56 | + UINTN j; | ||
57 | + | ||
58 | + line = AllocatePool(rmc_file.blob_len + cmdline_len + 2); | ||
59 | + | ||
60 | + while (i < cmdline_len && cmdline[i] != '\0') { | ||
61 | + line[i] = cmdline[i]; | ||
62 | + i++; | ||
63 | + } | ||
64 | + | ||
65 | + line[i++] = ' '; | ||
66 | + | ||
67 | + for (j=0; j < rmc_file.blob_len; j++) | ||
68 | + line[i+j] = rmc_file.blob[j]; | ||
69 | + line[i+j] = '\0'; | ||
70 | + | ||
71 | + cmdline = line; | ||
72 | + cmdline_len = i + j; | ||
73 | + | ||
74 | + FreePool(rmc_db); | ||
75 | + } | ||
76 | + | ||
77 | /* export the device path this image is started from */ | ||
78 | if (disk_get_part_uuid(loaded_image->DeviceHandle, uuid) == EFI_SUCCESS) | ||
79 | efivar_set(L"LoaderDevicePartUUID", uuid, FALSE); | ||
80 | -- | ||
81 | 2.14.3 | ||
82 | |||
diff --git a/recipes-bsp/systemd-boot/systemd-boot/rmc-boot.inc b/recipes-bsp/systemd-boot/systemd-boot/rmc-boot.inc deleted file mode 100644 index bbe3aea2..00000000 --- a/recipes-bsp/systemd-boot/systemd-boot/rmc-boot.inc +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | # This patchset contains hooks that allows systemd-boot to use RMC capablilities. | ||
2 | python __anonymous () { | ||
3 | import re | ||
4 | target = d.getVar('TARGET_ARCH') | ||
5 | prefix = "" if d.getVar('EFI_PROVIDER') == "rmc-boot" else "systemd-" | ||
6 | if target == "x86_64": | ||
7 | systemdimage = prefix + "bootx64.efi" | ||
8 | else: | ||
9 | systemdimage = prefix + "bootia32.efi" | ||
10 | d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage) | ||
11 | prefix = "systemd-" if prefix == "" else "" | ||
12 | d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix) | ||
13 | } | ||
14 | |||
15 | DEPENDS_append_intel-x86-common = " rmc rmc-efi" | ||
16 | RDEPENDS_${PN}_append_intel-x86-common = " rmc-db" | ||
17 | |||
18 | EXTRA_OEMESON_append_intel-x86-common = ' \ | ||
19 | -Drmc-includedir="${STAGING_INCDIR}/rmc" \ | ||
20 | ' | ||
21 | |||
22 | SRC_URI_append_intel-x86-common = " \ | ||
23 | file://0001-partially-revert-sd-boot-stub-Obtain-PE-section-offs.patch \ | ||
24 | file://0002-sd-boot-fix-RMC-compatibility-with-systemd-boot-and-.patch \ | ||
25 | file://0003-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch \ | ||
26 | file://0004-sd-boot-Support-global-kernel-command-line-fragment.patch \ | ||
27 | file://0005-sd-boot-support-global-kernel-command-line-in-EFI-st.patch \ | ||
28 | " | ||
29 | |||
30 | RPROVIDES_${PN} += "rmc-boot" | ||
diff --git a/recipes-bsp/systemd-boot/systemd-boot_%.bbappend b/recipes-bsp/systemd-boot/systemd-boot_%.bbappend index 46dd8a44..d46ef410 100644 --- a/recipes-bsp/systemd-boot/systemd-boot_%.bbappend +++ b/recipes-bsp/systemd-boot/systemd-boot_%.bbappend | |||
@@ -13,6 +13,3 @@ do_compile_append_intel-x86-common() { | |||
13 | do_deploy_append_intel-x86-common() { | 13 | do_deploy_append_intel-x86-common() { |
14 | install ${B}/src/boot/efi/linux*.efi.stub ${DEPLOYDIR} | 14 | install ${B}/src/boot/efi/linux*.efi.stub ${DEPLOYDIR} |
15 | } | 15 | } |
16 | |||
17 | # includes rmc-boot.inc if rmc-boot is the EFI_PROVIDER | ||
18 | include systemd-boot/${EFI_PROVIDER}.inc | ||
diff --git a/recipes-core/initrdscripts/files/intel-x86-common/init-install-efi.sh b/recipes-core/initrdscripts/files/intel-x86-common/init-install-efi.sh deleted file mode 100644 index a7a2ad4c..00000000 --- a/recipes-core/initrdscripts/files/intel-x86-common/init-install-efi.sh +++ /dev/null | |||
@@ -1,342 +0,0 @@ | |||
1 | #!/bin/sh -e | ||
2 | # | ||
3 | # Copyright (c) 2016, Intel Corporation. | ||
4 | # All rights reserved. | ||
5 | # | ||
6 | # install.sh [device_name] [rootfs_name] | ||
7 | # | ||
8 | # This file is a copy of file with same name in OE: | ||
9 | # meta/recipes-core/initrdscripts/files/. We modify | ||
10 | # it for RMC feature to deploy file blobs from RMC | ||
11 | # database file to target. | ||
12 | |||
13 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
14 | |||
15 | # We need 20 Mb for the boot partition | ||
16 | boot_size=20 | ||
17 | |||
18 | # 5% for swap | ||
19 | swap_ratio=5 | ||
20 | |||
21 | # Get a list of hard drives | ||
22 | hdnamelist="" | ||
23 | live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'` | ||
24 | live_dev_name=${live_dev_name#\/dev/} | ||
25 | # Only strip the digit identifier if the device is not an mmc | ||
26 | case $live_dev_name in | ||
27 | mmcblk*) | ||
28 | ;; | ||
29 | nvme*) | ||
30 | ;; | ||
31 | *) | ||
32 | live_dev_name=${live_dev_name%%[0-9]*} | ||
33 | ;; | ||
34 | esac | ||
35 | |||
36 | echo "Searching for hard drives ..." | ||
37 | |||
38 | for device in `ls /sys/block/`; do | ||
39 | case $device in | ||
40 | loop*) | ||
41 | # skip loop device | ||
42 | ;; | ||
43 | sr*) | ||
44 | # skip CDROM device | ||
45 | ;; | ||
46 | ram*) | ||
47 | # skip ram device | ||
48 | ;; | ||
49 | *) | ||
50 | # skip the device LiveOS is on | ||
51 | # Add valid hard drive name to the list | ||
52 | case $device in | ||
53 | $live_dev_name*) | ||
54 | # skip the device we are running from | ||
55 | ;; | ||
56 | *) | ||
57 | hdnamelist="$hdnamelist $device" | ||
58 | ;; | ||
59 | esac | ||
60 | ;; | ||
61 | esac | ||
62 | done | ||
63 | |||
64 | if [ -z "${hdnamelist}" ]; then | ||
65 | echo "You need another device (besides the live device /dev/${live_dev_name}) to install the image. Installation aborted." | ||
66 | exit 1 | ||
67 | fi | ||
68 | |||
69 | TARGET_DEVICE_NAME="" | ||
70 | for hdname in $hdnamelist; do | ||
71 | # Display found hard drives and their basic info | ||
72 | echo "-------------------------------" | ||
73 | echo /dev/$hdname | ||
74 | if [ -r /sys/block/$hdname/device/vendor ]; then | ||
75 | echo -n "VENDOR=" | ||
76 | cat /sys/block/$hdname/device/vendor | ||
77 | fi | ||
78 | if [ -r /sys/block/$hdname/device/model ]; then | ||
79 | echo -n "MODEL=" | ||
80 | cat /sys/block/$hdname/device/model | ||
81 | fi | ||
82 | if [ -r /sys/block/$hdname/device/uevent ]; then | ||
83 | echo -n "UEVENT=" | ||
84 | cat /sys/block/$hdname/device/uevent | ||
85 | fi | ||
86 | echo | ||
87 | done | ||
88 | |||
89 | # Get user choice | ||
90 | while true; do | ||
91 | echo "Please select an install target or press n to exit ($hdnamelist ): " | ||
92 | read answer | ||
93 | if [ "$answer" = "n" ]; then | ||
94 | echo "Installation manually aborted." | ||
95 | exit 1 | ||
96 | fi | ||
97 | for hdname in $hdnamelist; do | ||
98 | if [ "$answer" = "$hdname" ]; then | ||
99 | TARGET_DEVICE_NAME=$answer | ||
100 | break | ||
101 | fi | ||
102 | done | ||
103 | if [ -n "$TARGET_DEVICE_NAME" ]; then | ||
104 | break | ||
105 | fi | ||
106 | done | ||
107 | |||
108 | if [ -n "$TARGET_DEVICE_NAME" ]; then | ||
109 | echo "Installing image on /dev/$TARGET_DEVICE_NAME ..." | ||
110 | else | ||
111 | echo "No hard drive selected. Installation aborted." | ||
112 | exit 1 | ||
113 | fi | ||
114 | |||
115 | device=/dev/$TARGET_DEVICE_NAME | ||
116 | |||
117 | # | ||
118 | # The udev automounter can cause pain here, kill it | ||
119 | # | ||
120 | rm -f /etc/udev/rules.d/automount.rules | ||
121 | rm -f /etc/udev/scripts/mount* | ||
122 | |||
123 | # | ||
124 | # Unmount anything the automounter had mounted | ||
125 | # | ||
126 | umount ${device}* 2> /dev/null || /bin/true | ||
127 | |||
128 | mkdir -p /tmp | ||
129 | |||
130 | # Create /etc/mtab if not present | ||
131 | if [ ! -e /etc/mtab ]; then | ||
132 | cat /proc/mounts > /etc/mtab | ||
133 | fi | ||
134 | |||
135 | disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//") | ||
136 | |||
137 | swap_size=$((disk_size*swap_ratio/100)) | ||
138 | rootfs_size=$((disk_size-boot_size-swap_size)) | ||
139 | |||
140 | rootfs_start=$((boot_size)) | ||
141 | rootfs_end=$((rootfs_start+rootfs_size)) | ||
142 | swap_start=$((rootfs_end)) | ||
143 | |||
144 | # MMC devices are special in a couple of ways | ||
145 | # 1) they use a partition prefix character 'p' | ||
146 | # 2) they are detected asynchronously (need rootwait) | ||
147 | rootwait="" | ||
148 | part_prefix="" | ||
149 | if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \ | ||
150 | [ ! "${device#/dev/nvme}" = "${device}" ]; then | ||
151 | part_prefix="p" | ||
152 | rootwait="rootwait" | ||
153 | fi | ||
154 | bootfs=${device}${part_prefix}1 | ||
155 | rootfs=${device}${part_prefix}2 | ||
156 | swap=${device}${part_prefix}3 | ||
157 | |||
158 | echo "*****************" | ||
159 | echo "Boot partition size: $boot_size MB ($bootfs)" | ||
160 | echo "Rootfs partition size: $rootfs_size MB ($rootfs)" | ||
161 | echo "Swap partition size: $swap_size MB ($swap)" | ||
162 | echo "*****************" | ||
163 | echo "Deleting partition table on ${device} ..." | ||
164 | dd if=/dev/zero of=${device} bs=512 count=35 | ||
165 | |||
166 | echo "Creating new partition table on ${device} ..." | ||
167 | parted ${device} mklabel gpt | ||
168 | |||
169 | echo "Creating boot partition on $bootfs" | ||
170 | parted ${device} mkpart boot fat32 0% $boot_size | ||
171 | parted ${device} set 1 boot on | ||
172 | |||
173 | echo "Creating rootfs partition on $rootfs" | ||
174 | parted ${device} mkpart root ext3 $rootfs_start $rootfs_end | ||
175 | |||
176 | echo "Creating swap partition on $swap" | ||
177 | parted ${device} mkpart swap linux-swap $swap_start 100% | ||
178 | |||
179 | parted ${device} print | ||
180 | |||
181 | echo "Formatting $bootfs to vfat..." | ||
182 | mkfs.vfat $bootfs | ||
183 | |||
184 | echo "Formatting $rootfs to ext3..." | ||
185 | mkfs.ext3 $rootfs | ||
186 | |||
187 | echo "Formatting swap partition...($swap)" | ||
188 | mkswap $swap | ||
189 | |||
190 | mkdir /tgt_root | ||
191 | mkdir /src_root | ||
192 | mkdir -p /boot | ||
193 | |||
194 | # Handling of the target root partition | ||
195 | mount $rootfs /tgt_root | ||
196 | mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root | ||
197 | echo "Copying rootfs files..." | ||
198 | cp -a /src_root/* /tgt_root | ||
199 | if [ -d /tgt_root/etc/ ] ; then | ||
200 | boot_uuid=$(blkid -o value -s UUID ${bootfs}) | ||
201 | swap_part_uuid=$(blkid -o value -s PARTUUID ${swap}) | ||
202 | echo "/dev/disk/by-partuuid/$swap_part_uuid swap swap defaults 0 0" >> /tgt_root/etc/fstab | ||
203 | echo "UUID=$boot_uuid /boot vfat defaults 1 2" >> /tgt_root/etc/fstab | ||
204 | # We dont want udev to mount our root device while we're booting... | ||
205 | if [ -d /tgt_root/etc/udev/ ] ; then | ||
206 | echo "${device}" >> /tgt_root/etc/udev/mount.blacklist | ||
207 | fi | ||
208 | fi | ||
209 | |||
210 | # Handling of the target boot partition | ||
211 | mount $bootfs /boot | ||
212 | echo "Preparing boot partition..." | ||
213 | |||
214 | EFIDIR="/boot/EFI/BOOT" | ||
215 | mkdir -p $EFIDIR | ||
216 | # Copy the efi loader | ||
217 | cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR | ||
218 | |||
219 | # RMC deployment | ||
220 | RMC_CMD=/src_root/usr/bin/rmc | ||
221 | RMC_DB=/run/media/$1/rmc.db | ||
222 | |||
223 | # We don't want to quit when a step failed. For example, | ||
224 | # a file system could not support some operations. | ||
225 | set +e | ||
226 | |||
227 | if [ -f "${RMC_DB}" ] && [ -f "${RMC_CMD}" ]; then | ||
228 | echo "Found RMC database and tool, start RMC deployment" | ||
229 | # query INSTALLER.CONFIG from RMC DB | ||
230 | if ${RMC_CMD} -B INSTALLER.CONFIG -d "${RMC_DB}" -o /tmp/installer.config; then | ||
231 | while IFS=':' read -r NAME TGT_UID TGT_GID TGT_MODE TGT_PATH; do | ||
232 | # skip comment | ||
233 | # The regexp in grep works with busybox grep which doesn't | ||
234 | # seem to have a -P to recognize '\t'. But this expression could not | ||
235 | # work with gnu grep... | ||
236 | if echo "$NAME"|grep -q $'^[ \t]*#'; then | ||
237 | continue | ||
238 | fi | ||
239 | # check if we should create a directory (last char in target path is '/') | ||
240 | # or deploy a file | ||
241 | LAST_CHAR=$(echo "${TGT_PATH:$((${#TGT_PATH}-1)):1}") | ||
242 | |||
243 | # Do not bail out for failures but user should get stderr message | ||
244 | if [ ${LAST_CHAR} = "/" ]; then | ||
245 | # name field is skipped for directory | ||
246 | echo "DIR: ${TGT_UID}:${TGT_GID}:${TGT_MODE} => ${TGT_PATH}" | ||
247 | mkdir -p "$TGT_PATH" | ||
248 | chown "${TGT_UID}:${TGT_GID}" "$TGT_PATH" | ||
249 | chmod "${TGT_MODE}" "$TGT_PATH" | ||
250 | else | ||
251 | ${RMC_CMD} -B "${NAME}" -d "${RMC_DB}" -o "${TGT_PATH}" | ||
252 | echo "FILE: ${NAME}:${TGT_UID}:${TGT_GID}:${TGT_MODE} => ${TGT_PATH}" | ||
253 | chown "${TGT_UID}:${TGT_GID}" "$TGT_PATH" | ||
254 | chmod "${TGT_MODE}" "$TGT_PATH" | ||
255 | fi | ||
256 | done < /tmp/installer.config | ||
257 | rm -rf /tmp/installer.config | ||
258 | |||
259 | # remove rmc from target since we don't think it is a valid | ||
260 | # case to run rmc after installation. | ||
261 | rm -rf /tgt_root/usr/bin/rmc | ||
262 | echo "RMC deployment finished" | ||
263 | else | ||
264 | echo "INSTALLER.CONFIG is not found, skip RMC deployment" | ||
265 | fi | ||
266 | |||
267 | # Final retouching by calling post-install hook | ||
268 | if ${RMC_CMD} -B POSTINSTALL.sh -d "${RMC_DB}" -o /tmp/POSTINSTALL.sh; then | ||
269 | echo "Found POSTINSTALL.sh execute it..." | ||
270 | chmod 500 /tmp/POSTINSTALL.sh | ||
271 | /tmp/POSTINSTALL.sh | ||
272 | rm -rf /tmp/POSTINSTALL.sh | ||
273 | fi | ||
274 | fi | ||
275 | set -e | ||
276 | |||
277 | if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then | ||
278 | root_part_uuid=$(blkid -o value -s PARTUUID ${rootfs}) | ||
279 | GRUBCFG="$EFIDIR/grub.cfg" | ||
280 | cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG | ||
281 | # Update grub config for the installed image | ||
282 | # Delete the install entry | ||
283 | sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG | ||
284 | # Delete the initrd lines | ||
285 | sed -i "/initrd /d" $GRUBCFG | ||
286 | # Delete any LABEL= strings | ||
287 | sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG | ||
288 | # Delete any root= strings | ||
289 | sed -i "s/ root=[^ ]*/ /g" $GRUBCFG | ||
290 | # Add the root= and other standard boot options | ||
291 | sed -i "s@linux /vmlinuz *@linux /vmlinuz root=PARTUUID=$root_part_uuid rw $rootwait quiet @" $GRUBCFG | ||
292 | fi | ||
293 | |||
294 | if [ -d /run/media/$1/loader ]; then | ||
295 | rootuuid=$(blkid -o value -s PARTUUID ${rootfs}) | ||
296 | GUMMIBOOT_CFGS="/boot/loader/entries/*.conf" | ||
297 | if [ -d /boot/loader ]; then | ||
298 | # Don't override loader.conf RMC already deployed | ||
299 | if [ ! -f /boot/loader/loader.conf ]; then | ||
300 | cp /run/media/$1/loader/loader.conf /boot/loader/ | ||
301 | fi | ||
302 | # only copy built OE entries when RMC entries don't exist. | ||
303 | if [ ! -d /boot/loader/entries ] || [ ! ls /boot/loader/entries/*.conf &>/dev/null ]; then | ||
304 | cp -dr /run/media/$1/loader/entries /boot/loader | ||
305 | fi | ||
306 | else | ||
307 | # copy config files for gummiboot | ||
308 | cp -dr /run/media/$1/loader /boot | ||
309 | # delete the install entry | ||
310 | rm -f /boot/loader/entries/install.conf | ||
311 | fi | ||
312 | # delete the initrd lines | ||
313 | sed -i "/initrd /d" $GUMMIBOOT_CFGS | ||
314 | # delete any LABEL= strings | ||
315 | sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS | ||
316 | # delete any root= strings | ||
317 | sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS | ||
318 | # add the root= and other standard boot options | ||
319 | sed -i "s@options *@options root=PARTUUID=$rootuuid rw $rootwait quiet @" $GUMMIBOOT_CFGS | ||
320 | # if RMC feature presents, append global kernel command line fragment when it exists. | ||
321 | if [ -f "${RMC_DB}" ] && [ -f "${RMC_CMD}" ]; then | ||
322 | if ${RMC_CMD} -B KBOOTPARAM -d "${RMC_DB}" -o /tmp/kbootparam; then | ||
323 | sed -i "/^[ \t]*options/ s/$/ $(cat /tmp/kbootparam)/" $GUMMIBOOT_CFGS | ||
324 | rm /tmp/kbootparam | ||
325 | fi | ||
326 | fi | ||
327 | fi | ||
328 | |||
329 | cp /run/media/$1/vmlinuz /boot | ||
330 | |||
331 | umount /src_root | ||
332 | umount /tgt_root | ||
333 | umount /boot | ||
334 | |||
335 | sync | ||
336 | |||
337 | echo "Remove your installation media, and press ENTER" | ||
338 | |||
339 | read enter | ||
340 | |||
341 | echo "Rebooting..." | ||
342 | reboot -f | ||
diff --git a/recipes-core/initrdscripts/initramfs-live-install-efi_%.bbappend b/recipes-core/initrdscripts/initramfs-live-install-efi_%.bbappend deleted file mode 100644 index 0b3a1d3d..00000000 --- a/recipes-core/initrdscripts/initramfs-live-install-efi_%.bbappend +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/files:" | ||
2 | PACKAGE_ARCH_intel-x86-common = "${INTEL_COMMON_PACKAGE_ARCH}" | ||