65 Commits

Author SHA1 Message Date
Mingli Yu 0198c6f482 meta-encrypted-storage: check luks DISTRO_FEATURES
Fix the yocto compliance issue:
  INFO: test_signatures (common.CommonCheckLayer)
  INFO:  ... FAIL

  Stdout:
  Loaded 2790 entries from dependency cache.
  INFO: Traceback (most recent call last):
  File "/build/layers/oe-core/scripts/lib/checklayer/cases/common.py", line 81, in test_signatures
    self.fail('Adding layer %s changed signatures.\n%s' % (self.tc.layer['name'], msg))
AssertionError: Adding layer meta-encrypted-storage changed signatures.
208 signatures changed, initial differences (first hash before, second after):
    cryptsetup:do_package: f0fa7d14534fb27c9caf639036338bbfa270ac29524b30d699f8f8ea0ec8cb02 -> 35d3ffd44373fc052d5bf7c0b1e649b585e49638ddc21109651e9602786aa87b
      bitbake-diffsigs --task cryptsetup do_package --signature f0fa7d14534fb27c9caf639036338bbfa270ac29524b30d699f8f8ea0ec8cb02 35d3ffd44373fc052d5bf7c0b1e649b585e49638ddc21109651e9602786aa87b
      NOTE: Starting bitbake server...
      basehash changed from 69f1e7096d59cdc20c48b2c7591a3d5c5abbdcf4452c2a2dbdd84ed352054477 to e8cb4b995a71a2b37597a4cdd37b91fe2904895db51922664d2ac2ae1702aecc
      Variable RDEPENDS:cryptsetup value changed:
      "     libdevmapper  {+lvm2+} udev lvm2-udevrules"
      Variable RRECOMMENDS:cryptsetup value changed:
      "     kernel-module-aes-generic     kernel-module-dm-crypt     kernel-module-md5     kernel-module-cbc     kernel-module-sha256-generic     kernel-module-xts  {+lvm2-udevrules+}"

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
2022-12-06 09:16:14 +08:00
Mingli Yu 39a46d6b15 meta-secure-core: update the README
Fix the below yocto compliance issue:
  INFO: test_readme (common.CommonCheckLayer)
  INFO:  ... FAIL
  INFO: Traceback (most recent call last):
    File "/build/layers/oe-core/scripts/lib/checklayer/cases/common.py", line 34, in test_readme
      self.assertIn('maintainer', data.lower())
    AssertionError: 'maintainer' not found

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
2022-12-06 09:16:14 +08:00
Yi Zhao 225076287f layer.conf: add langdale to LAYERSERIES_COMPAT
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2022-11-03 09:47:47 +08:00
Kai Kang 1a74be5b36 cryptfs-tpm2: fix ld warnings with binutils 2.39
Add ld option '-z noexecstack' for cryptfs-tpm2 to fix link warnings:

  ld: warning: secret_area.o: missing .note.GNU-stack section implies executable stack
  ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

Signed-off-by: Kai Kang <kai.kang@windriver.com>
2022-08-24 21:22:50 +08:00
Jia Zhang 2ccf4aa4e3 meta-secure-core: support kirkstone
Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
2022-06-05 14:51:31 +08:00
Yi Zhao fea6a37625 recipes: update SRC_URI branch and protocols
Update SRC_URIs using git to include branch=master if no branch is set
and also to use protocol=https for github urls.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2021-11-15 09:56:02 +08:00
Yi Zhao 4ddcbda60d cryptfs-tpm2: upgrade to latest git rev
Drop backported patches.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2021-11-12 16:52:32 +08:00
Yi Zhao b988150cf3 cryptfs-tpm2: fix encrypt_secret.py for python3
Fixes:
encrypt_secret.py -i "H31i05" > "primary_key.secret" || exit 1
ERROR: Unable to encrypt the secret

Suggested-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2021-08-20 18:36:08 +08:00
Yi Zhao e004d37650 cryptfs-tpm2: fix LDFLAGS expansion
When LDFLAGS expands, The -fmacro-prefix-map and -fdebug-prefix-map will
be prefixed with -Wl, which will cause compilation error:
ld: -f may not be used without -shared

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2021-08-20 15:59:51 +08:00
Yi Zhao 9f03a89db8 layer.conf: add honister to LAYERSERIES_COMPAT
Drop other releases since they are not compatible anymore.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2021-08-09 18:51:13 +08:00
Yi Zhao 4042043742 meta-secure-core: Convert to new override syntax
Converting the metadata to use ":" as the override character instead of "_".

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2021-08-09 18:51:13 +08:00
Yi Zhao 6768abc7d4 cryptfs-tpm2: fix build reproducibility issue
Fixes:
| main.c: In function 'show_banner':
| main.c:43:62: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
|    43 |         info_cont("Build Time: " __DATE__ " " __TIME__ "\n\n");
|       |                                                              ^
| main.c:43:34: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
|    43 |         info_cont("Build Time: " __DATE__ " " __TIME__ "\n\n");
|       |                                  ^~~~~~~~
| cc1: all warnings being treated as errors

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2021-08-09 18:51:13 +08:00
Yi Zhao 6cbe3df2a2 layer.conf: add hardknott to LAYERSERIES_COMPAT
Remove other releases since they are not compatible anymore.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2021-04-21 12:57:22 +08:00
Bartłomiej Burdukiewicz 50a847007d conf/layer.conf: Add gatesgarth to LAYERSERIES_COMPAT
Signed-off-by: Bartłomiej Burdukiewicz <bartlomiej.burdukiewicz@gmail.com>
2020-12-09 09:17:12 +08:00
Yongxin Liu 628949305c meta-encrypted-storage: set CONFIG_HW_RANDOM_TPM to "y"
CONFIG_HW_RANDOM_TPM is bool, not tristate, and thus it cannot be
set to "m"

Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
2020-11-11 15:15:40 +08:00
Yi Zhao ddbcb4722a cyrptfs-tpm2: set correct soname for libcryptfs-tpm2
The current soname of libcryptfs-tpm2 is libcryptfs-tpm2.so:
$ readelf -d libcryptfs-tpm2.so.0.7.0 | grep SONAME
0x000000000000000e (SONAME)    Library soname: [libcryptfs-tpm2.so]

The libcryptfs-tpm2.so is a symbolic link of libcryptfs-tmp2.so.0.7.0
and it is not installed by default because it is packaged to dev
package. Then we will encounter an error when run command cryptfs-tpm2:
$ cryptfs-tpm2
cryptfs-tpm2: error while loading shared libraries: libcryptfs-tpm2.so:
cannot open shared object file: No such file or directory
$ ldd cryptfs-tpm2 | grep libcryptfs-tpm2
    libcryptfs-tpm2.so => not found

Set the soname to libcryptfs-tpm2.so.$(MAJOR_VERSION) to fix the issue.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2020-07-18 20:46:44 +08:00
richard 3590e302df update tpm2-tools_3.2.1 -> tpm2-tools_4.1.1.bb, tpm2-abrmd_2.0.3 -> tpm2-abrmd_2.3.0, tpm2-tss_2.2.3.bb -> tpm2-tss_2.3.2.bb 2020-06-27 19:01:35 +08:00
Christophe Priouzeau ac1ec689f2 conf/layer.conf: Add dunfell to LAYERSERIES_COMPAT
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
2020-05-27 08:22:24 +08:00
Yi Zhao e8e80fb7c4 cryptfs-tpm2: convert the script to python3
Convert the script to python3 to fix the do_compile failure.

Fixes:
/buildarea/poky/build/tmp/work/core2-64-poky-linux/cryptfs-tpm2/0.7.0+gitAUTOINC+888c46c827-r0/git/scripts/encrypt_secret.py -i "H31i05" > "primary_key.secret" || exit 1
/usr/bin/env: ‘python’: No such file or directory
Makefile:64: recipe for target 'primary_key.secret' failed

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2020-03-19 10:47:24 +08:00
Robert Yang 9e63c16057 cryptsetup_%.bbappend: Fix for native
Issue: LIN1019-2347

Fixed:
$ bitbake cryptsetup-native
[snip]
Nothing RPROVIDES 'lvm2-udevrules-native'
[snip]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-14 08:42:33 +08:00
Jason Wessel ca003d11bb lvm2: Fix hanging dmcrypt volumes on boot
The initrd takes care of starting the luks volumes and activing the
dmcrypt udev rules.  The udev rule required a modification to deal
with volumes that had already been started, else the cold plug event
that runs at user space startup puts the dmcrypt device into a state
that systemd cannot manage it.

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel 59a1f79ad8 packagegroup-luks.inc: Addlvm2-udevrules
The lvm2-udevrules is required else udev will never perform the device
notification when an encrypted volume is initially created.

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel e19748f11e cryptfs-tpm2: Add support for QEMU swtpm tpm2
The device nodes are in a different place when using the swtpm + ovfm
+ qemu.  The luks-setup.sh needs to look in an additional location to
properly support qemu.

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
muvarov e3678e964c conf/layer.conf: Add zeus to LAYERSERIES_COMPAT (#121)
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2019-11-01 08:39:17 +08:00
Yi Zhao 8d1b7c2a29 meta-secure-core: add linux-yocto-dev bbappend
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2019-08-13 20:53:14 +08:00
Yi Zhao a2688eb342 conf/layer.conf: Add warrior to LAYERSERIES_COMPAT
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2019-04-23 15:43:10 +08:00
Hongxu Jia c1a543fc99 layer.conf: update LAYERSERIES_COMPAT sumo' -> thud'
Since `9ec5a8a layer.conf: Drop sumo from LAYERSERIES_CORENAMES' and
`9867924 layer.conf: Add thud to LAYERSERIES_CORENAMES' applied in oe-core,
update LAYERSERIES_COMPAT `sumo' -> `thud'

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2018-10-08 14:47:47 +08:00
Jia Zhang 139a9b656d Clean up the stuffs for stable branches
The following commits are reverted by the way:

- seloader: Fix building for rocko (bc6bbe2)
- meta-integrity: rpm: Add back in required patches for rocko (5fa9c85)

Because they are only applicable to rocko.

Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
2018-09-20 21:21:37 -04:00
Jia Zhang 74af5e3644 cryptfs-tpm2: Fix build faiure due to -fstack-protector-strong
SECURITY_LDFLAGS includes -fstack-protector-strong which cannot work
with CCLD. To work around this issue, filter out it from LDFLAGS.

Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
2018-09-17 09:31:31 -04:00
Jia Zhang b3f12e7803 cryptfs-tpm2: Update to the latest
- Follow up the regular way to include header file.
- Use CCLD to build executable and library.

Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
2018-09-17 09:29:52 -04:00
Yunguo Wei cc40f6c890 cryptfs-tpm2: uprev to 0.7
Now cryptfs-tpm2 supports both TSS 1.x and 2.x API.

Please specify "TSS2_VER=1" in EXTRA_OEMAKE to support 1.x API.

Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com>
2018-09-12 17:49:31 +08:00
Hongxu Jia 23b208c08c cryptsetup_%.bbappend: move lvm2-udevrules from RDEPEND to RRECOMMENDS
when configuring lvm2 without udev, lvm2-udevrules package is empty,
causing do_rootfs failure.

Error:
ERROR: wrlinux-image-glibc-std-1.0-r5 do_rootfs: Function failed: do_rootfs
 Problem: conflicting requests
  - nothing provides lvm2-udevrules needed by cryptsetup-1.7.4-r0.corei7_64

Move lvm2-udevrules from RDEPEND to RRECOMMENDS could workaround the issue.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2018-08-27 10:50:37 +08:00
Tom Rini cd40815e69 layer.conf: Mark as compatible with rocko
As we also work with the 'rocko' release list that in our
LAYERSERIES_COMPAT.

Signed-off-by: Tom Rini <trini@konsulko.com>
2018-07-25 20:41:35 +08:00
Jia Zhang a4fda23803 cryptfs-tpm2: update to 0.6.3
Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
2018-06-16 22:16:02 -04:00
Trevor Woerner 6ca33b325d tpm2.0-tss: rename -> tpm2-tss
Unify how the TPM2 recipes are named.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2018-05-30 09:38:05 +08:00
Trevor Woerner 4b2c94fb64 tpm2.0-tools: rename -> tpm2-tools
Unify how the TPM2 recipes are named.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2018-05-30 09:38:05 +08:00
Trevor Woerner 18d65f8933 layer.conf: add LAYERSERIES_COMPAT
see https://patchwork.openembedded.org/patch/140542/

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2018-05-26 08:08:58 +08:00
Jia Zhang 387a9bf500 cryptfs-tpm2: Update the upstream URL
Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
2018-03-13 08:43:45 -04:00
Jia Zhang 365a400ed9 meta-secure-core: update TSS 2.0 to the latest stable version
Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
2018-02-19 04:39:19 -05:00
Wenzong Fan 6dff36ef09 Install packages if distro flag set (#21)
* install 'packagegroup-tpm2-initramfs' of distro flag 'tpm2' is set
* install 'initrdscripts-ima' if distro flag 'ima' is set
* install 'cryptfs-tpm2-initramfs' if distro flag 'luks' is set

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
2017-09-25 03:25:27 -04:00
WarrickJiang afc39392a6 cryptsetup:add lvm2-udevrules into RDEPENDS (#19)
meta-oe layer split the udevrules for lvm2 into a new package.
Add lvm2-udevrules into cryptsetup RDEPENDS list.

Signed-off-by: Jiang Lu <lu.jiang@windriver.com>
2017-09-25 03:24:24 -04:00
Jia Zhang b69537380c meta-secure-core: clean up ${COREBASE}/LICENSE and ${COREBASE}/meta/COPYING.MIT
${COREBASE}/LICENSE is not a valid license file. So it is recommended
to use '${COMMON_LICENSE_DIR}/MIT' for a MIT License file in
LIC_FILES_CHKSUM. This will become an error in the future.

Signed-off-by: Jia Zhang <lans.zhang2008@gmail.com>
2017-09-02 11:11:44 +08:00
Jia Zhang b1e14f4e88 encrypted-storage: use luks as the feature name for current implementation
encrypted-storage layer will include more security features about encrypted
storage so the term "encrypted-storage" won't be used to specify a dedicated
technology term such as "LUKS".

Signed-off-by: Jia Zhang <lans.zhang2008@gmail.com>
2017-08-20 15:31:11 +08:00
Lans Zhang ead58497c8 cryptfs-tpm2: sync up with upstream
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-08-16 11:20:18 +08:00
Lans Zhang b7705a7587 README.md: update reference links
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-08-16 10:57:24 +08:00
Lans Zhang aa9b435b55 cryptfs-tpm2: sync up with upstream
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-08-09 10:53:47 +08:00
Lans Zhang 1098d813ed systemd: work around circular dependency chains found if systemd is configured to enable cryptsetup
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-08-09 09:52:17 +08:00
Lans Zhang e8d6e006e7 systemd: fix the conditions of PACKAGECONFIG for ima and cryptsetup
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-08-04 22:03:45 +08:00
Lans Zhang dd9a695df8 systemd: enable ima and cryptsetup
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-08-04 17:01:00 +08:00
Lans Zhang 8dd6733e31 cryptsetup: depend on lvm2 to include dmsetup
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-08-04 16:36:41 +08:00