|
241 | 241 | # Make squashfs generation more reproducible.
|
242 | 242 | export SOURCE_DATE_EPOCH=$(stat -c '%Y' "${BUILD_DIR}/fs-root/usr/lib/os-release")
|
243 | 243 |
|
244 |
| -# Unmount in order to get rid of the overlay |
| 244 | +# Unmount in order to get rid of the overlay, but keep fs-root for |
| 245 | +# now, so we can use selinux file contexts. |
245 | 246 | umount "${BUILD_DIR}/${FLAGS_install_root_basename}"
|
246 |
| -umount "${BUILD_DIR}/fs-root" |
247 | 247 |
|
248 | 248 | if [[ "$FLAGS_generate_pkginfo" = "${FLAGS_TRUE}" ]] ; then
|
249 | 249 | info " Creating pkginfo squashfs '${BUILD_DIR}/${SYSEXTNAME}_pkginfo.raw'"
|
@@ -328,11 +328,16 @@ if [[ -n "${invalid_files}" ]]; then
|
328 | 328 | die "Invalid file ownership: ${invalid_files}"
|
329 | 329 | fi
|
330 | 330 |
|
| 331 | +info "Relabeling sysext contents" |
| 332 | +setfiles -D -E -F -r "${BUILD_DIR}/${FLAGS_install_root_basename}" -v -T 0 "${BUILD_DIR}/fs-root/usr/share/flatcar/etc/selinux/mcs/contexts/files/file_contexts" "${BUILD_DIR}/${FLAGS_install_root_basename}" |
| 333 | +umount "${BUILD_DIR}/fs-root" |
| 334 | + |
| 335 | +info "Creating squashfs image" |
331 | 336 | mksquashfs "${BUILD_DIR}/${FLAGS_install_root_basename}" "${BUILD_DIR}/${SYSEXTNAME}.raw" \
|
332 | 337 | -noappend -xattrs-exclude '^btrfs.' -comp "${FLAGS_compression}" ${FLAGS_mksquashfs_opts}
|
333 | 338 | rm -rf "${BUILD_DIR}"/{fs-root,"${FLAGS_install_root_basename}",workdir}
|
334 | 339 |
|
335 |
| -# Generate reports |
| 340 | +info "Generating reports" |
336 | 341 | mkdir "${BUILD_DIR}/img-rootfs"
|
337 | 342 | mount -rt squashfs -o loop,nodev "${BUILD_DIR}/${SYSEXTNAME}.raw" "${BUILD_DIR}/img-rootfs"
|
338 | 343 | write_contents "${BUILD_DIR}/img-rootfs" "${BUILD_DIR}/${SYSEXTNAME}_contents.txt"
|
|
0 commit comments