summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual/ref-classes.xml
diff options
context:
space:
mode:
authorScott Rifenbark <scott.m.rifenbark@intel.com>2013-12-05 13:35:21 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-11 14:18:06 +0000
commitae9f8623a9f882c1db82a45c6d782dee60f88721 (patch)
treef23749bd390d50da06f2495632be8d4e0852e95a /documentation/ref-manual/ref-classes.xml
parentd22c00e9fcdf765d01764d35b018ad6b0aad1c9b (diff)
downloadpoky-ae9f8623a9f882c1db82a45c6d782dee60f88721.tar.gz
ref-manual: Edits to icecc class and re-order of "I" classes.
(From yocto-docs rev: 643ccc4ac495e0dc88de20012d4843d2a402b507) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/ref-manual/ref-classes.xml')
-rw-r--r--documentation/ref-manual/ref-classes.xml820
1 files changed, 420 insertions, 400 deletions
diff --git a/documentation/ref-manual/ref-classes.xml b/documentation/ref-manual/ref-classes.xml
index da47d51fd6..f36c80d6f3 100644
--- a/documentation/ref-manual/ref-classes.xml
+++ b/documentation/ref-manual/ref-classes.xml
@@ -824,9 +824,8 @@
824 <title><filename>icecc.bbclass</filename></title> 824 <title><filename>icecc.bbclass</filename></title>
825 825
826 <para> 826 <para>
827 The Icecream distributed compile support (<filename>icecc</filename>) 827 The <filename>icecc</filename> class stages directories with symlinks
828 class stages directories with symlinks from 828 from <filename>gcc</filename> and <filename>g++</filename> to
829 <filename>gcc</filename> and <filename>g++</filename> to
830 <filename>icecc</filename>, for both native and cross compilers. 829 <filename>icecc</filename>, for both native and cross compilers.
831 Depending on each configure or compile, the OpenEmbedded build system 830 Depending on each configure or compile, the OpenEmbedded build system
832 adds the directories at the head of the <filename>PATH</filename> list 831 adds the directories at the head of the <filename>PATH</filename> list
@@ -892,26 +891,69 @@
892 </para> 891 </para>
893</section> 892</section>
894 893
895<section id='ref-classes-image-live'> 894<section id='ref-classes-image'>
896 <title><filename>image-live.bbclass</filename></title> 895 <title>Creating Images - <filename>image.bbclass</filename> and <filename>rootfs*.bbclass</filename></title>
897 896
898 <para> 897 <para>
899 The live image (<filename>image-live</filename>) class 898 These classes add support for creating images in several formats.
900 supports building "live" images. 899 First, the root filesystem is created from packages using
901 Normally, you do not use this class directly. 900 one of the <filename>rootfs_*.bbclass</filename>
902 Instead, you add "live" to 901 files (depending on the package format used) and then the image is created.
903 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>. 902 <itemizedlist>
903 <listitem><para>The
904 <filename><link linkend='var-IMAGE_FSTYPES'>IMAGE_FSTYPES</link></filename>
905 variable controls the types of images to generate.
906 </para></listitem>
907 <listitem><para>The
908 <filename><link linkend='var-IMAGE_INSTALL'>IMAGE_INSTALL</link></filename>
909 variable controls the list of packages to install into the
910 image.</para></listitem>
911 </itemizedlist>
904 </para> 912 </para>
905</section> 913</section>
906 914
907<section id='ref-classes-image-vmdk'> 915<section id='ref-classes-image_types'>
908 <title><filename>image-vmdk.bbclass</filename></title> 916 <title><filename>image_types.bbclass</filename></title>
909 917
910 <para> 918 <para>
911 The Virtual Machine Disk image (<filename>image-vmdk</filename>) class 919 The image types (<filename>image_types</filename>) class defines all of
912 supports building VMware VMDK images. 920 the standard image output types that you can enable through the
921 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
922 variable.
923 You can use this class as a reference on how to add support for custom
924 image output types.
925 </para>
926
927 <para>
928 By default, this class is enabled through the
929 <link linkend='var-IMAGE_CLASSES'><filename>IMAGE_CLASSES</filename></link>
930 variable in
931 <link linkend='ref-classes-image'><filename>image.bbclass</filename></link>.
932 If you define your own image types using a custom BitBake class and
933 then use <filename>IMAGE_CLASSES</filename> to enable it, the custom
934 class must either inherit <filename>image_types</filename> or
935 <filename>image_types</filename> must also appear in
936 <filename>IMAGE_CLASSES</filename>.
937 </para>
938</section>
939
940<section id='ref-classes-image_types_uboot'>
941 <title><filename>image_types_uboot.bbclass</filename></title>
942
943 <para>
944 The U-Boot image types (<filename>image_types_uboot</filename>) class
945 defines additional image types specifically for the U-Boot bootloader.
946 </para>
947</section>
948
949<section id='ref-classes-image-live'>
950 <title><filename>image-live.bbclass</filename></title>
951
952 <para>
953 The live image (<filename>image-live</filename>) class
954 supports building "live" images.
913 Normally, you do not use this class directly. 955 Normally, you do not use this class directly.
914 Instead, you add "vmdk" to 956 Instead, you add "live" to
915 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>. 957 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>.
916 </para> 958 </para>
917</section> 959</section>
@@ -979,37 +1021,378 @@
979 </para> 1021 </para>
980</section> 1022</section>
981 1023
982<section id='ref-classes-image_types'> 1024<section id='ref-classes-image-vmdk'>
983 <title><filename>image_types.bbclass</filename></title> 1025 <title><filename>image-vmdk.bbclass</filename></title>
984 1026
985 <para> 1027 <para>
986 The image types (<filename>image_types</filename>) class defines all of 1028 The Virtual Machine Disk image (<filename>image-vmdk</filename>) class
987 the standard image output types that you can enable through the 1029 supports building VMware VMDK images.
988 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link> 1030 Normally, you do not use this class directly.
989 variable. 1031 Instead, you add "vmdk" to
990 You can use this class as a reference on how to add support for custom 1032 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>.
991 image output types.
992 </para> 1033 </para>
1034</section>
1035
1036<section id='ref-classes-insane'>
1037<title><filename>insane.bbclass</filename></title>
993 1038
994 <para> 1039 <para>
995 By default, this class is enabled through the 1040 This class adds a step to the package generation process so that
996 <link linkend='var-IMAGE_CLASSES'><filename>IMAGE_CLASSES</filename></link> 1041 output quality assurance checks are generated by the OpenEmbedded
997 variable in 1042 build system.
998 <link linkend='ref-classes-image'><filename>image.bbclass</filename></link>. 1043 A range of checks are performed that check the build's output
999 If you define your own image types using a custom BitBake class and 1044 for common problems that show up during runtime.
1000 then use <filename>IMAGE_CLASSES</filename> to enable it, the custom 1045 Distribution policy usually dictates whether to include this class.
1001 class must either inherit <filename>image_types</filename> or
1002 <filename>image_types</filename> must also appear in
1003 <filename>IMAGE_CLASSES</filename>.
1004 </para> 1046 </para>
1005</section>
1006 1047
1007<section id='ref-classes-image_types_uboot'> 1048 <para>
1008 <title><filename>image_types_uboot.bbclass</filename></title> 1049 You can configure the sanity checks so that specific test failures
1050 either raise a warning or an error message.
1051 Typically, failures for new tests generate a warning.
1052 Subsequent failures for the same test would then generate an error
1053 message once the metadata is in a known and good condition.
1054 </para>
1009 1055
1010 <para> 1056 <para>
1011 The U-Boot image types (<filename>image_types_uboot</filename>) class 1057 Use the
1012 defines additional image types specifically for the U-Boot bootloader. 1058 <link linkend='var-WARN_QA'><filename>WARN_QA</filename></link> and
1059 <link linkend='var-ERROR_QA'><filename>ERROR_QA</filename></link>
1060 variables to control the behavior of
1061 these checks at the global level (i.e. in your custom distro
1062 configuration).
1063 However, to skip one or more checks in recipes, you should use
1064 <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>.
1065 For example, to skip the check for symbolic link
1066 <filename>.so</filename> files in the main package of a recipe,
1067 add the following to the recipe.
1068 You need to realize that the package name override, in this example
1069 <filename>${PN}</filename>, must be used:
1070 <literallayout class='monospaced'>
1071 INSANE_SKIP_${PN} += "dev-so"
1072 </literallayout>
1073 Please keep in mind that the QA checks exist in order to detect real
1074 or potential problems in the packaged output.
1075 So exercise caution when disabling these checks.
1076 </para>
1077
1078 <para>
1079 The following list shows the tests you can list with the
1080 <filename>WARN_QA</filename> and <filename>ERROR_QA</filename>
1081 variables:
1082 <itemizedlist>
1083 <listitem><para><emphasis><filename>ldflags:</filename></emphasis>
1084 Ensures that the binaries were linked with the
1085 <filename>LDFLAGS</filename> options provided by the build system.
1086 If this test fails, check that the <filename>LDFLAGS</filename> variable
1087 is being passed to the linker command.</para></listitem>
1088 <listitem><para><emphasis><filename>useless-rpaths:</filename></emphasis>
1089 Checks for dynamic library load paths (rpaths) in the binaries that
1090 by default on a standard system are searched by the linker (e.g.
1091 <filename>/lib</filename> and <filename>/usr/lib</filename>).
1092 While these paths will not cause any breakage, they do waste space and
1093 are unnecessary.</para></listitem>
1094 <listitem><para><emphasis><filename>rpaths:</filename></emphasis>
1095 Checks for rpaths in the binaries that contain build system paths such
1096 as <filename>TMPDIR</filename>.
1097 If this test fails, bad <filename>-rpath</filename> options are being
1098 passed to the linker commands and your binaries have potential security
1099 issues.</para></listitem>
1100 <listitem><para><emphasis><filename>dev-so:</filename></emphasis>
1101 Checks that the <filename>.so</filename> symbolic links are in the
1102 <filename>-dev</filename> package and not in any of the other packages.
1103 In general, these symlinks are only useful for development purposes.
1104 Thus, the <filename>-dev</filename> package is the correct location for
1105 them.
1106 Some very rare cases do exist for dynamically loaded modules where
1107 these symlinks are needed instead in the main package.
1108 </para></listitem>
1109 <listitem><para><emphasis><filename>debug-files:</filename></emphasis>
1110 Checks for <filename>.debug</filename> directories in anything but the
1111 <filename>-dbg</filename> package.
1112 The debug files should all be in the <filename>-dbg</filename> package.
1113 Thus, anything packaged elsewhere is incorrect packaging.</para></listitem>
1114 <listitem><para><emphasis><filename>arch:</filename></emphasis>
1115 Checks the Executable and Linkable Format (ELF) type, bit size, and endianness
1116 of any binaries to ensure they match the target architecture.
1117 This test fails if any binaries don't match the type since there would be an
1118 incompatibility.
1119 Sometimes software, like bootloaders, might need to bypass this check.
1120 </para></listitem>
1121 <listitem><para><emphasis><filename>debug-deps:</filename></emphasis>
1122 Checks that <filename>-dbg</filename> packages only depend on other
1123 <filename>-dbg</filename> packages and not on any other types of packages,
1124 which would cause a packaging bug.</para></listitem>
1125 <listitem><para><emphasis><filename>dev-deps:</filename></emphasis>
1126 Checks that <filename>-dev</filename> packages only depend on other
1127 <filename>-dev</filename> packages and not on any other types of packages,
1128 which would be a packaging bug.</para></listitem>
1129 <listitem><para><emphasis><filename>pkgconfig:</filename></emphasis>
1130 Checks <filename>.pc</filename> files for any
1131 <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>/<link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
1132 paths.
1133 Any <filename>.pc</filename> file containing these paths is incorrect
1134 since <filename>pkg-config</filename> itself adds the correct sysroot prefix
1135 when the files are accessed.</para></listitem>
1136 <listitem><para><emphasis><filename>textrel:</filename></emphasis>
1137 Checks for ELF binaries that contain relocations in their
1138 <filename>.text</filename> sections, which can result in a
1139 performance impact at runtime.</para></listitem>
1140 <listitem><para><emphasis><filename>pkgvarcheck:</filename></emphasis>
1141 Checks through the variables
1142 <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
1143 <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
1144 <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
1145 <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>,
1146 <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
1147 <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
1148 <link linkend='var-FILES'><filename>FILES</filename></link>,
1149 <link linkend='var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></link>,
1150 <filename>pkg_preinst</filename>,
1151 <filename>pkg_postinst</filename>,
1152 <filename>pkg_prerm</filename>
1153 and <filename>pkg_postrm</filename>, and reports if there are
1154 variable sets that are not package-specific.
1155 Using these variables without a package suffix is bad practice,
1156 and might unnecessarily complicate dependencies of other packages
1157 within the same recipe or have other unintended consequences.
1158 </para></listitem>
1159 <listitem><para><emphasis><filename>xorg-driver-abi:</filename></emphasis>
1160 Checks that all packages containing Xorg drivers have ABI
1161 dependencies.
1162 The <filename>xserver-xorg</filename> recipe provides driver
1163 ABI names.
1164 All drivers should depend on the ABI versions that they have
1165 been built against.
1166 Driver recipes that include
1167 <filename>xorg-driver-input.inc</filename>
1168 or <filename>xorg-driver-video.inc</filename> will
1169 automatically get these versions.
1170 Consequently, you should only need to explicitly add
1171 dependencies to binary driver recipes.
1172 </para></listitem>
1173 <listitem><para><emphasis><filename>libexec:</filename></emphasis>
1174 Checks if a package contains files in
1175 <filename>/usr/libexec</filename>.
1176 This check is not performed if the
1177 <filename>libexecdir</filename> variable has been set
1178 explicitly to <filename>/usr/libexec</filename>.
1179 </para></listitem>
1180 <listitem><para><emphasis><filename>staticdev:</filename></emphasis>
1181 Checks for static library files (<filename>*.a</filename>) in
1182 non-<filename>staticdev</filename> packages.
1183 </para></listitem>
1184 <listitem><para><emphasis><filename>la:</filename></emphasis>
1185 Checks <filename>.la</filename> files for any <filename>TMPDIR</filename>
1186 paths.
1187 Any <filename>.la</filename> file containing these paths is incorrect since
1188 <filename>libtool</filename> adds the correct sysroot prefix when using the
1189 files automatically itself.</para></listitem>
1190 <listitem><para><emphasis><filename>desktop:</filename></emphasis>
1191 Runs the <filename>desktop-file-validate</filename> program
1192 against any <filename>.desktop</filename> files to validate
1193 their contents against the specification for
1194 <filename>.desktop</filename> files.</para></listitem>
1195 <listitem><para><emphasis><filename>already-stripped:</filename></emphasis>
1196 Checks that produced binaries have not already been
1197 stripped prior to the build system extracting debug symbols.
1198 It is common for upstream software projects to default to
1199 stripping debug symbols for output binaries.
1200 In order for debugging to work on the target using
1201 <filename>-dbg</filename> packages, this stripping must be
1202 disabled.
1203 </para></listitem>
1204 <listitem><para><emphasis><filename>split-strip:</filename></emphasis>
1205 Reports that splitting or stripping debug symbols from binaries
1206 has failed.
1207 </para></listitem>
1208 <listitem><para><emphasis><filename>arch:</filename></emphasis>
1209 Checks to ensure the architecture, bit size, and endianness
1210 of all output binaries matches that of the target.
1211 This test can detect when the wrong compiler or compiler options
1212 have been used.
1213 </para></listitem>
1214 <listitem><para><emphasis><filename>installed-vs-shipped:</filename></emphasis>
1215 Reports when files have been installed within
1216 <filename>do_install</filename> but have not been included in
1217 any package by way of the
1218 <link linkend='var-FILES'><filename>FILES</filename></link>
1219 variable.
1220 Files that do not appear in any package cannot be present in
1221 an image later on in the build process.
1222 Ideally, all installed files should be packaged or not
1223 installed at all.
1224 These files can be deleted at the end of
1225 <filename>do_install</filename> if the files are not
1226 needed in any package.
1227 </para></listitem>
1228 <listitem><para><emphasis><filename>dep-cmp:</filename></emphasis>
1229 Checks for invalid version comparison statements in runtime
1230 dependency relationships between packages (i.e. in
1231 <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
1232 <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
1233 <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
1234 <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
1235 <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
1236 and
1237 <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>
1238 variable values).
1239 Any invalid comparisons might trigger failures or undesirable
1240 behavior when passed to the package manager.
1241 </para></listitem>
1242 <listitem><para><emphasis><filename>files-invalid:</filename></emphasis>
1243 Checks for
1244 <link linkend='var-FILES'><filename>FILES</filename></link>
1245 variable values that contain "//", which is invalid.
1246 </para></listitem>
1247 <listitem><para><emphasis><filename>incompatible-license:</filename></emphasis>
1248 Report when packages are excluded from being created due to
1249 being marked with a license that is in
1250 <link linkend='var-INCOMPATIBLE_LICENSE'><filename>INCOMPATIBLE_LICENSE</filename></link>.
1251 </para></listitem>
1252 <listitem><para><emphasis><filename>compile-host-path:</filename></emphasis>
1253 Checks the <filename>do_compile</filename> log for indications
1254 that paths to locations on the build host were used.
1255 Using such paths might result in host contamination of the
1256 build output.
1257 </para></listitem>
1258 <listitem><para><emphasis><filename>install-host-path:</filename></emphasis>
1259 Checks the <filename>do_install</filename> log for indications
1260 that paths to locations on the build host were used.
1261 Using such paths might result in host contamination of the
1262 build output.
1263 </para></listitem>
1264 <listitem><para><emphasis><filename>libdir:</filename></emphasis>
1265 Checks for libraries being installed into incorrect
1266 (possibly hardcoded) installation paths.
1267 For example, this test will catch recipes that install
1268 <filename>/lib/bar.so</filename> when
1269 <filename>${base_libdir}</filename> is "lib32".
1270 Another example is when recipes install
1271 <filename>/usr/lib64/foo.so</filename> when
1272 <filename>${libdir}</filename> is "/usr/lib".
1273 </para></listitem>
1274 <listitem><para><emphasis><filename>packages-list:</filename></emphasis>
1275 Checks for the same package being listed multiple times through
1276 the <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
1277 variable value.
1278 Installing the package in this manner can cause errors during
1279 packaging.
1280 </para></listitem>
1281 <listitem><para><emphasis><filename>perm-config:</filename></emphasis>
1282 Reports lines in <filename>fs-perms.txt</filename> that have
1283 an invalid format.
1284 </para></listitem>
1285 <listitem><para><emphasis><filename>perm-line:</filename></emphasis>
1286 Reports lines in <filename>fs-perms.txt</filename> that have
1287 an invalid format.
1288 </para></listitem>
1289 <listitem><para><emphasis><filename>perm-link:</filename></emphasis>
1290 Reports lines in <filename>fs-perms.txt</filename> that
1291 specify 'link' where the specified target already exists.
1292 </para></listitem>
1293 <listitem><para><emphasis><filename>pkgname:</filename></emphasis>
1294 Checks that all packages in
1295 <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
1296 have names that do not contain invalid characters (i.e.
1297 characters other than 0-9, a-z, ., +, and -).
1298 </para></listitem>
1299 <listitem><para><emphasis><filename>pn-overrides:</filename></emphasis>
1300 Checks that a recipe does not have a name
1301 (<link linkend='var-PN'><filename>PN</filename></link>) value
1302 that appears in
1303 <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>.
1304 If a recipe is named such that its <filename>PN</filename>
1305 value matches something already in
1306 <filename>OVERRIDES</filename> (e.g. <filename>PN</filename>
1307 happens to be the same as
1308 <link linkend='var-MACHINE'><filename>MACHINE</filename></link>
1309 or
1310 <link linkend='var-DISTRO'><filename>DISTRO</filename></link>),
1311 it can have unexpected consequences.
1312 For example, assignments such as
1313 <filename>FILES_${PN} = "xyz"</filename> effectively turn into
1314 <filename>FILES = "xyz"</filename>.
1315 </para></listitem>
1316 <listitem><para><emphasis><filename>unsafe-references-in-binaries:</filename></emphasis>
1317 Reports when a binary installed in
1318 <filename>${base_libdir}</filename>,
1319 <filename>${base_bindir}</filename>, or
1320 <filename>${base_sbindir}</filename>, depends on another
1321 binary installed under <filename>${exec_prefix}</filename>.
1322 This dependency is a concern if you want the system to remain
1323 basically operable if <filename>/usr</filename> is mounted
1324 separately and is not mounted.
1325 <note>
1326 Defaults for binaries installed in
1327 <filename>${base_libdir}</filename>,
1328 <filename>${base_bindir}</filename>, and
1329 <filename>${base_sbindir}</filename> are
1330 <filename>/lib</filename>, <filename>/bin</filename>, and
1331 <filename>/sbin</filename>, respectively.
1332 The default for a binary installed
1333 under <filename>${exec_prefix}</filename> is
1334 <filename>/usr</filename>.
1335 </note>
1336 </para></listitem>
1337 <listitem><para><emphasis><filename>unsafe-references-in-scripts:</filename></emphasis>
1338 Reports when a script file installed in
1339 <filename>${base_libdir}</filename>,
1340 <filename>${base_bindir}</filename>, or
1341 <filename>${base_sbindir}</filename>, depends on files
1342 installed under <filename>${exec_prefix}</filename>.
1343 This dependency is a concern if you want the system to remain
1344 basically operable if <filename>/usr</filename> is mounted
1345 separately and is not mounted.
1346 <note>
1347 Defaults for binaries installed in
1348 <filename>${base_libdir}</filename>,
1349 <filename>${base_bindir}</filename>, and
1350 <filename>${base_sbindir}</filename> are
1351 <filename>/lib</filename>, <filename>/bin</filename>, and
1352 <filename>/sbin</filename>, respectively.
1353 The default for a binary installed
1354 under <filename>${exec_prefix}</filename> is
1355 <filename>/usr</filename>.
1356 </note>
1357 </para></listitem>
1358 <listitem><para><emphasis><filename>var-undefined:</filename></emphasis>
1359 Reports when variables fundamental to packaging (i.e.
1360 <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>,
1361 <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>,
1362 <link linkend='var-D'><filename>D</filename></link>,
1363 <link linkend='var-PN'><filename>PN</filename></link>, and
1364 <link linkend='var-PKGD'><filename>PKGD</filename></link>) are
1365 undefined during <filename>do_package</filename>.
1366 </para></listitem>
1367 <listitem><para><emphasis><filename>pkgv-undefined:</filename></emphasis>
1368 Checks to see if the <filename>PKGV</filename> variable
1369 is undefined during <filename>do_package</filename>.
1370 </para></listitem>
1371 <listitem><para><emphasis><filename>buildpaths:</filename></emphasis>
1372 Checks for paths to locations on the build host inside the
1373 output files.
1374 Currently, this test triggers too many false positives and
1375 thus is not normally enabled.
1376 </para></listitem>
1377 <listitem><para><emphasis><filename>perms:</filename></emphasis>
1378 Currently, this check is unused but reserved.
1379 </para></listitem>
1380 <listitem><para><emphasis><filename>version-going-backwards:</filename></emphasis>
1381 If Build History is enabled, reports when a package
1382 being written out has a lower version than the previously
1383 written package under the same name.
1384 If you are placing output packages into a feed and
1385 upgrading packages on a target system using that feed, the
1386 version of a package going backwards can result in the target
1387 system not correctly upgrading to the "new" version of the
1388 package.
1389 <note>
1390 If you are not using runtime package management on your
1391 target system, then you do not need to worry about
1392 this situation.
1393 </note>
1394 </para></listitem>
1395 </itemizedlist>
1013 </para> 1396 </para>
1014</section> 1397</section>
1015 1398
@@ -2112,369 +2495,6 @@
2112 </para> 2495 </para>
2113</section> 2496</section>
2114 2497
2115<section id='ref-classes-insane'>
2116<title><filename>insane.bbclass</filename></title>
2117
2118 <para>
2119 This class adds a step to the package generation process so that
2120 output quality assurance checks are generated by the OpenEmbedded
2121 build system.
2122 A range of checks are performed that check the build's output
2123 for common problems that show up during runtime.
2124 Distribution policy usually dictates whether to include this class.
2125 </para>
2126
2127 <para>
2128 You can configure the sanity checks so that specific test failures
2129 either raise a warning or an error message.
2130 Typically, failures for new tests generate a warning.
2131 Subsequent failures for the same test would then generate an error
2132 message once the metadata is in a known and good condition.
2133 </para>
2134
2135 <para>
2136 Use the
2137 <link linkend='var-WARN_QA'><filename>WARN_QA</filename></link> and
2138 <link linkend='var-ERROR_QA'><filename>ERROR_QA</filename></link>
2139 variables to control the behavior of
2140 these checks at the global level (i.e. in your custom distro
2141 configuration).
2142 However, to skip one or more checks in recipes, you should use
2143 <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>.
2144 For example, to skip the check for symbolic link
2145 <filename>.so</filename> files in the main package of a recipe,
2146 add the following to the recipe.
2147 You need to realize that the package name override, in this example
2148 <filename>${PN}</filename>, must be used:
2149 <literallayout class='monospaced'>
2150 INSANE_SKIP_${PN} += "dev-so"
2151 </literallayout>
2152 Please keep in mind that the QA checks exist in order to detect real
2153 or potential problems in the packaged output.
2154 So exercise caution when disabling these checks.
2155 </para>
2156
2157 <para>
2158 The following list shows the tests you can list with the
2159 <filename>WARN_QA</filename> and <filename>ERROR_QA</filename>
2160 variables:
2161 <itemizedlist>
2162 <listitem><para><emphasis><filename>ldflags:</filename></emphasis>
2163 Ensures that the binaries were linked with the
2164 <filename>LDFLAGS</filename> options provided by the build system.
2165 If this test fails, check that the <filename>LDFLAGS</filename> variable
2166 is being passed to the linker command.</para></listitem>
2167 <listitem><para><emphasis><filename>useless-rpaths:</filename></emphasis>
2168 Checks for dynamic library load paths (rpaths) in the binaries that
2169 by default on a standard system are searched by the linker (e.g.
2170 <filename>/lib</filename> and <filename>/usr/lib</filename>).
2171 While these paths will not cause any breakage, they do waste space and
2172 are unnecessary.</para></listitem>
2173 <listitem><para><emphasis><filename>rpaths:</filename></emphasis>
2174 Checks for rpaths in the binaries that contain build system paths such
2175 as <filename>TMPDIR</filename>.
2176 If this test fails, bad <filename>-rpath</filename> options are being
2177 passed to the linker commands and your binaries have potential security
2178 issues.</para></listitem>
2179 <listitem><para><emphasis><filename>dev-so:</filename></emphasis>
2180 Checks that the <filename>.so</filename> symbolic links are in the
2181 <filename>-dev</filename> package and not in any of the other packages.
2182 In general, these symlinks are only useful for development purposes.
2183 Thus, the <filename>-dev</filename> package is the correct location for
2184 them.
2185 Some very rare cases do exist for dynamically loaded modules where
2186 these symlinks are needed instead in the main package.
2187 </para></listitem>
2188 <listitem><para><emphasis><filename>debug-files:</filename></emphasis>
2189 Checks for <filename>.debug</filename> directories in anything but the
2190 <filename>-dbg</filename> package.
2191 The debug files should all be in the <filename>-dbg</filename> package.
2192 Thus, anything packaged elsewhere is incorrect packaging.</para></listitem>
2193 <listitem><para><emphasis><filename>arch:</filename></emphasis>
2194 Checks the Executable and Linkable Format (ELF) type, bit size, and endianness
2195 of any binaries to ensure they match the target architecture.
2196 This test fails if any binaries don't match the type since there would be an
2197 incompatibility.
2198 Sometimes software, like bootloaders, might need to bypass this check.
2199 </para></listitem>
2200 <listitem><para><emphasis><filename>debug-deps:</filename></emphasis>
2201 Checks that <filename>-dbg</filename> packages only depend on other
2202 <filename>-dbg</filename> packages and not on any other types of packages,
2203 which would cause a packaging bug.</para></listitem>
2204 <listitem><para><emphasis><filename>dev-deps:</filename></emphasis>
2205 Checks that <filename>-dev</filename> packages only depend on other
2206 <filename>-dev</filename> packages and not on any other types of packages,
2207 which would be a packaging bug.</para></listitem>
2208 <listitem><para><emphasis><filename>pkgconfig:</filename></emphasis>
2209 Checks <filename>.pc</filename> files for any
2210 <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>/<link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
2211 paths.
2212 Any <filename>.pc</filename> file containing these paths is incorrect
2213 since <filename>pkg-config</filename> itself adds the correct sysroot prefix
2214 when the files are accessed.</para></listitem>
2215 <listitem><para><emphasis><filename>textrel:</filename></emphasis>
2216 Checks for ELF binaries that contain relocations in their
2217 <filename>.text</filename> sections, which can result in a
2218 performance impact at runtime.</para></listitem>
2219 <listitem><para><emphasis><filename>pkgvarcheck:</filename></emphasis>
2220 Checks through the variables
2221 <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
2222 <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
2223 <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
2224 <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>,
2225 <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
2226 <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
2227 <link linkend='var-FILES'><filename>FILES</filename></link>,
2228 <link linkend='var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></link>,
2229 <filename>pkg_preinst</filename>,
2230 <filename>pkg_postinst</filename>,
2231 <filename>pkg_prerm</filename>
2232 and <filename>pkg_postrm</filename>, and reports if there are
2233 variable sets that are not package-specific.
2234 Using these variables without a package suffix is bad practice,
2235 and might unnecessarily complicate dependencies of other packages
2236 within the same recipe or have other unintended consequences.
2237 </para></listitem>
2238 <listitem><para><emphasis><filename>xorg-driver-abi:</filename></emphasis>
2239 Checks that all packages containing Xorg drivers have ABI
2240 dependencies.
2241 The <filename>xserver-xorg</filename> recipe provides driver
2242 ABI names.
2243 All drivers should depend on the ABI versions that they have
2244 been built against.
2245 Driver recipes that include
2246 <filename>xorg-driver-input.inc</filename>
2247 or <filename>xorg-driver-video.inc</filename> will
2248 automatically get these versions.
2249 Consequently, you should only need to explicitly add
2250 dependencies to binary driver recipes.
2251 </para></listitem>
2252 <listitem><para><emphasis><filename>libexec:</filename></emphasis>
2253 Checks if a package contains files in
2254 <filename>/usr/libexec</filename>.
2255 This check is not performed if the
2256 <filename>libexecdir</filename> variable has been set
2257 explicitly to <filename>/usr/libexec</filename>.
2258 </para></listitem>
2259 <listitem><para><emphasis><filename>staticdev:</filename></emphasis>
2260 Checks for static library files (<filename>*.a</filename>) in
2261 non-<filename>staticdev</filename> packages.
2262 </para></listitem>
2263 <listitem><para><emphasis><filename>la:</filename></emphasis>
2264 Checks <filename>.la</filename> files for any <filename>TMPDIR</filename>
2265 paths.
2266 Any <filename>.la</filename> file containing these paths is incorrect since
2267 <filename>libtool</filename> adds the correct sysroot prefix when using the
2268 files automatically itself.</para></listitem>
2269 <listitem><para><emphasis><filename>desktop:</filename></emphasis>
2270 Runs the <filename>desktop-file-validate</filename> program
2271 against any <filename>.desktop</filename> files to validate
2272 their contents against the specification for
2273 <filename>.desktop</filename> files.</para></listitem>
2274 <listitem><para><emphasis><filename>already-stripped:</filename></emphasis>
2275 Checks that produced binaries have not already been
2276 stripped prior to the build system extracting debug symbols.
2277 It is common for upstream software projects to default to
2278 stripping debug symbols for output binaries.
2279 In order for debugging to work on the target using
2280 <filename>-dbg</filename> packages, this stripping must be
2281 disabled.
2282 </para></listitem>
2283 <listitem><para><emphasis><filename>split-strip:</filename></emphasis>
2284 Reports that splitting or stripping debug symbols from binaries
2285 has failed.
2286 </para></listitem>
2287 <listitem><para><emphasis><filename>arch:</filename></emphasis>
2288 Checks to ensure the architecture, bit size, and endianness
2289 of all output binaries matches that of the target.
2290 This test can detect when the wrong compiler or compiler options
2291 have been used.
2292 </para></listitem>
2293 <listitem><para><emphasis><filename>installed-vs-shipped:</filename></emphasis>
2294 Reports when files have been installed within
2295 <filename>do_install</filename> but have not been included in
2296 any package by way of the
2297 <link linkend='var-FILES'><filename>FILES</filename></link>
2298 variable.
2299 Files that do not appear in any package cannot be present in
2300 an image later on in the build process.
2301 Ideally, all installed files should be packaged or not
2302 installed at all.
2303 These files can be deleted at the end of
2304 <filename>do_install</filename> if the files are not
2305 needed in any package.
2306 </para></listitem>
2307 <listitem><para><emphasis><filename>dep-cmp:</filename></emphasis>
2308 Checks for invalid version comparison statements in runtime
2309 dependency relationships between packages (i.e. in
2310 <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
2311 <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
2312 <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
2313 <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
2314 <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
2315 and
2316 <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>
2317 variable values).
2318 Any invalid comparisons might trigger failures or undesirable
2319 behavior when passed to the package manager.
2320 </para></listitem>
2321 <listitem><para><emphasis><filename>files-invalid:</filename></emphasis>
2322 Checks for
2323 <link linkend='var-FILES'><filename>FILES</filename></link>
2324 variable values that contain "//", which is invalid.
2325 </para></listitem>
2326 <listitem><para><emphasis><filename>incompatible-license:</filename></emphasis>
2327 Report when packages are excluded from being created due to
2328 being marked with a license that is in
2329 <link linkend='var-INCOMPATIBLE_LICENSE'><filename>INCOMPATIBLE_LICENSE</filename></link>.
2330 </para></listitem>
2331 <listitem><para><emphasis><filename>compile-host-path:</filename></emphasis>
2332 Checks the <filename>do_compile</filename> log for indications
2333 that paths to locations on the build host were used.
2334 Using such paths might result in host contamination of the
2335 build output.
2336 </para></listitem>
2337 <listitem><para><emphasis><filename>install-host-path:</filename></emphasis>
2338 Checks the <filename>do_install</filename> log for indications
2339 that paths to locations on the build host were used.
2340 Using such paths might result in host contamination of the
2341 build output.
2342 </para></listitem>
2343 <listitem><para><emphasis><filename>libdir:</filename></emphasis>
2344 Checks for libraries being installed into incorrect
2345 (possibly hardcoded) installation paths.
2346 For example, this test will catch recipes that install
2347 <filename>/lib/bar.so</filename> when
2348 <filename>${base_libdir}</filename> is "lib32".
2349 Another example is when recipes install
2350 <filename>/usr/lib64/foo.so</filename> when
2351 <filename>${libdir}</filename> is "/usr/lib".
2352 </para></listitem>
2353 <listitem><para><emphasis><filename>packages-list:</filename></emphasis>
2354 Checks for the same package being listed multiple times through
2355 the <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
2356 variable value.
2357 Installing the package in this manner can cause errors during
2358 packaging.
2359 </para></listitem>
2360 <listitem><para><emphasis><filename>perm-config:</filename></emphasis>
2361 Reports lines in <filename>fs-perms.txt</filename> that have
2362 an invalid format.
2363 </para></listitem>
2364 <listitem><para><emphasis><filename>perm-line:</filename></emphasis>
2365 Reports lines in <filename>fs-perms.txt</filename> that have
2366 an invalid format.
2367 </para></listitem>
2368 <listitem><para><emphasis><filename>perm-link:</filename></emphasis>
2369 Reports lines in <filename>fs-perms.txt</filename> that
2370 specify 'link' where the specified target already exists.
2371 </para></listitem>
2372 <listitem><para><emphasis><filename>pkgname:</filename></emphasis>
2373 Checks that all packages in
2374 <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
2375 have names that do not contain invalid characters (i.e.
2376 characters other than 0-9, a-z, ., +, and -).
2377 </para></listitem>
2378 <listitem><para><emphasis><filename>pn-overrides:</filename></emphasis>
2379 Checks that a recipe does not have a name
2380 (<link linkend='var-PN'><filename>PN</filename></link>) value
2381 that appears in
2382 <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>.
2383 If a recipe is named such that its <filename>PN</filename>
2384 value matches something already in
2385 <filename>OVERRIDES</filename> (e.g. <filename>PN</filename>
2386 happens to be the same as
2387 <link linkend='var-MACHINE'><filename>MACHINE</filename></link>
2388 or
2389 <link linkend='var-DISTRO'><filename>DISTRO</filename></link>),
2390 it can have unexpected consequences.
2391 For example, assignments such as
2392 <filename>FILES_${PN} = "xyz"</filename> effectively turn into
2393 <filename>FILES = "xyz"</filename>.
2394 </para></listitem>
2395 <listitem><para><emphasis><filename>unsafe-references-in-binaries:</filename></emphasis>
2396 Reports when a binary installed in
2397 <filename>${base_libdir}</filename>,
2398 <filename>${base_bindir}</filename>, or
2399 <filename>${base_sbindir}</filename>, depends on another
2400 binary installed under <filename>${exec_prefix}</filename>.
2401 This dependency is a concern if you want the system to remain
2402 basically operable if <filename>/usr</filename> is mounted
2403 separately and is not mounted.
2404 <note>
2405 Defaults for binaries installed in
2406 <filename>${base_libdir}</filename>,
2407 <filename>${base_bindir}</filename>, and
2408 <filename>${base_sbindir}</filename> are
2409 <filename>/lib</filename>, <filename>/bin</filename>, and
2410 <filename>/sbin</filename>, respectively.
2411 The default for a binary installed
2412 under <filename>${exec_prefix}</filename> is
2413 <filename>/usr</filename>.
2414 </note>
2415 </para></listitem>
2416 <listitem><para><emphasis><filename>unsafe-references-in-scripts:</filename></emphasis>
2417 Reports when a script file installed in
2418 <filename>${base_libdir}</filename>,
2419 <filename>${base_bindir}</filename>, or
2420 <filename>${base_sbindir}</filename>, depends on files
2421 installed under <filename>${exec_prefix}</filename>.
2422 This dependency is a concern if you want the system to remain
2423 basically operable if <filename>/usr</filename> is mounted
2424 separately and is not mounted.
2425 <note>
2426 Defaults for binaries installed in
2427 <filename>${base_libdir}</filename>,
2428 <filename>${base_bindir}</filename>, and
2429 <filename>${base_sbindir}</filename> are
2430 <filename>/lib</filename>, <filename>/bin</filename>, and
2431 <filename>/sbin</filename>, respectively.
2432 The default for a binary installed
2433 under <filename>${exec_prefix}</filename> is
2434 <filename>/usr</filename>.
2435 </note>
2436 </para></listitem>
2437 <listitem><para><emphasis><filename>var-undefined:</filename></emphasis>
2438 Reports when variables fundamental to packaging (i.e.
2439 <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>,
2440 <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>,
2441 <link linkend='var-D'><filename>D</filename></link>,
2442 <link linkend='var-PN'><filename>PN</filename></link>, and
2443 <link linkend='var-PKGD'><filename>PKGD</filename></link>) are
2444 undefined during <filename>do_package</filename>.
2445 </para></listitem>
2446 <listitem><para><emphasis><filename>pkgv-undefined:</filename></emphasis>
2447 Checks to see if the <filename>PKGV</filename> variable
2448 is undefined during <filename>do_package</filename>.
2449 </para></listitem>
2450 <listitem><para><emphasis><filename>buildpaths:</filename></emphasis>
2451 Checks for paths to locations on the build host inside the
2452 output files.
2453 Currently, this test triggers too many false positives and
2454 thus is not normally enabled.
2455 </para></listitem>
2456 <listitem><para><emphasis><filename>perms:</filename></emphasis>
2457 Currently, this check is unused but reserved.
2458 </para></listitem>
2459 <listitem><para><emphasis><filename>version-going-backwards:</filename></emphasis>
2460 If Build History is enabled, reports when a package
2461 being written out has a lower version than the previously
2462 written package under the same name.
2463 If you are placing output packages into a feed and
2464 upgrading packages on a target system using that feed, the
2465 version of a package going backwards can result in the target
2466 system not correctly upgrading to the "new" version of the
2467 package.
2468 <note>
2469 If you are not using runtime package management on your
2470 target system, then you do not need to worry about
2471 this situation.
2472 </note>
2473 </para></listitem>
2474 </itemizedlist>
2475 </para>
2476</section>
2477
2478<section id='ref-classes-rm-work'> 2498<section id='ref-classes-rm-work'>
2479 <title>Removing Work Files During the Build - <filename>rm_work.bbclass</filename></title> 2499 <title>Removing Work Files During the Build - <filename>rm_work.bbclass</filename></title>
2480 2500