diff options
| author | Yi Zhao <yi.zhao@windriver.com> | 2020-07-17 13:29:51 +0800 |
|---|---|---|
| committer | Jia Zhang <zhang.jia@linux.alibaba.com> | 2020-07-18 20:46:44 +0800 |
| commit | ddbcb4722a09c9df26b0ae1a5f6f2b4609b4164e (patch) | |
| tree | d546d0cb2a49884c050e2d01e1b526756fbdbd5d | |
| parent | 3801a7e7162dd0dbb740100afddbcafb5719d8da (diff) | |
| download | meta-secure-core-ddbcb4722a09c9df26b0ae1a5f6f2b4609b4164e.tar.gz | |
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>
3 files changed, 49 insertions, 0 deletions
diff --git a/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2/0001-lib-Makefile-set-correct-soname-for-libcryptfs-tpm2.patch b/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2/0001-lib-Makefile-set-correct-soname-for-libcryptfs-tpm2.patch new file mode 100644 index 0000000..af6a6ab --- /dev/null +++ b/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2/0001-lib-Makefile-set-correct-soname-for-libcryptfs-tpm2.patch | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | From 04b865d3af710e4116f0ff980918a984345a7ee3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Yi Zhao <yi.zhao@windriver.com> | ||
| 3 | Date: Fri, 17 Jul 2020 13:12:35 +0800 | ||
| 4 | Subject: [PATCH] lib/Makefile: set correct soname for libcryptfs-tpm2 | ||
| 5 | |||
| 6 | The current soname of libcryptfs-tpm2 is libcryptfs-tpm2.so: | ||
| 7 | $ readelf -d libcryptfs-tpm2.so.0.7.0 | grep SONAME | ||
| 8 | 0x000000000000000e (SONAME) Library soname: [libcryptfs-tpm2.so] | ||
| 9 | |||
| 10 | The libcryptfs-tpm2.so is a symbolic link of libcryptfs-tmp2.so.0.7.0 | ||
| 11 | and it is not installed by default because it is packaged to dev | ||
| 12 | package. Then we will encounter an error when run command cryptfs-tpm2: | ||
| 13 | $ cryptfs-tpm2 | ||
| 14 | cryptfs-tpm2: error while loading shared libraries: libcryptfs-tpm2.so: cannot open shared object file: No such file or directory | ||
| 15 | $ ldd cryptfs-tpm2 | grep libcryptfs-tpm2 | ||
| 16 | libcryptfs-tpm2.so => not found | ||
| 17 | |||
| 18 | Set the soname to libcryptfs-tpm2.so.$(MAJOR_VERSION) to fix the issue. | ||
| 19 | |||
| 20 | Upstream-Status: Pending | ||
| 21 | |||
| 22 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 23 | --- | ||
| 24 | src/lib/Makefile | 6 +++--- | ||
| 25 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
| 26 | |||
| 27 | diff --git a/src/lib/Makefile b/src/lib/Makefile | ||
| 28 | index 75144e7..5a61572 100644 | ||
| 29 | --- a/src/lib/Makefile | ||
| 30 | +++ b/src/lib/Makefile | ||
| 31 | @@ -40,11 +40,11 @@ install: all | ||
| 32 | $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR) | ||
| 33 | $(INSTALL) -m 755 $(LIB_NAME).a $(DESTDIR)$(LIBDIR) | ||
| 34 | $(INSTALL) -m 755 $(LIB_NAME).so $(DESTDIR)$(LIBDIR)/$(LIB_NAME).so.$(VERSION) | ||
| 35 | - $(foreach x, $(LIB_NAME).so, ln -sfn $(x).$(VERSION) $(DESTDIR)$(LIBDIR)/$(patsubst %,%.$(MAJOR_VERSION).$(MINOR_VERSION),$(x)); \ | ||
| 36 | - ln -sfn $(x).$(MAJOR_VERSION).$(MINOR_VERSION) $(DESTDIR)$(LIBDIR)/$(patsubst %,%.$(MAJOR_VERSION),$(x));) | ||
| 37 | + $(foreach x, $(LIB_NAME), ln -sfn $(x).so.$(VERSION) $(DESTDIR)$(LIBDIR)/$(patsubst %,%.so.$(MAJOR_VERSION),$(x)); \ | ||
| 38 | + ln -sfn $(x).so.$(VERSION) $(DESTDIR)$(LIBDIR)/$(patsubst %,%.so,$(x));) | ||
| 39 | |||
| 40 | $(LIB_NAME).so: $(OBJS_$(LIB_NAME)) | ||
| 41 | - $(CCLD) $^ -o $@ $(CFLAGS) -shared -Wl,-soname,$(patsubst %.$(VERSION),%,$@) | ||
| 42 | + $(CCLD) $^ -o $@ $(CFLAGS) -shared -Wl,-soname,$(patsubst %,%.$(MAJOR_VERSION),$@) | ||
| 43 | |||
| 44 | $(LIB_NAME).a: $(filter-out init.o,$(OBJS_$(LIB_NAME))) | ||
| 45 | $(AR) rcs $@ $^ | ||
| 46 | -- | ||
| 47 | 2.17.1 | ||
| 48 | |||
diff --git a/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2/0002-luks-setup.sh-Updated-TPM-Tools.patch b/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2/0002-luks-setup.sh-Updated-TPM-Tools.patch index 29a73f0..29a73f0 100755..100644 --- a/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2/0002-luks-setup.sh-Updated-TPM-Tools.patch +++ b/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2/0002-luks-setup.sh-Updated-TPM-Tools.patch | |||
diff --git a/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2_git.bb b/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2_git.bb index d8025c3..42f5bb1 100644 --- a/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2_git.bb +++ b/meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2_git.bb | |||
| @@ -24,6 +24,7 @@ SRC_URI = "\ | |||
| 24 | file://0001-luks-setup.sh-Add-support-for-qemu-with-the-swtpm.patch \ | 24 | file://0001-luks-setup.sh-Add-support-for-qemu-with-the-swtpm.patch \ |
| 25 | file://0001-encrypt_secret.py-switch-to-python3.patch \ | 25 | file://0001-encrypt_secret.py-switch-to-python3.patch \ |
| 26 | file://0002-luks-setup.sh-Updated-TPM-Tools.patch \ | 26 | file://0002-luks-setup.sh-Updated-TPM-Tools.patch \ |
| 27 | file://0001-lib-Makefile-set-correct-soname-for-libcryptfs-tpm2.patch \ | ||
| 27 | " | 28 | " |
| 28 | SRCREV = "87c35c63090a33d4de437f518b8da9f2d1f1d828" | 29 | SRCREV = "87c35c63090a33d4de437f518b8da9f2d1f1d828" |
| 29 | 30 | ||
