From ddbcb4722a09c9df26b0ae1a5f6f2b4609b4164e Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 17 Jul 2020 13:29:51 +0800 Subject: 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 --- ...le-set-correct-soname-for-libcryptfs-tpm2.patch | 48 ++++++++++++++++++++++ .../0002-luks-setup.sh-Updated-TPM-Tools.patch | 0 .../recipes-tpm/cryptfs-tpm2/cryptfs-tpm2_git.bb | 1 + 3 files changed, 49 insertions(+) create mode 100644 meta-encrypted-storage/recipes-tpm/cryptfs-tpm2/cryptfs-tpm2/0001-lib-Makefile-set-correct-soname-for-libcryptfs-tpm2.patch mode change 100755 => 100644 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/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 @@ +From 04b865d3af710e4116f0ff980918a984345a7ee3 Mon Sep 17 00:00:00 2001 +From: Yi Zhao +Date: Fri, 17 Jul 2020 13:12:35 +0800 +Subject: [PATCH] lib/Makefile: 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. + +Upstream-Status: Pending + +Signed-off-by: Yi Zhao +--- + src/lib/Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/lib/Makefile b/src/lib/Makefile +index 75144e7..5a61572 100644 +--- a/src/lib/Makefile ++++ b/src/lib/Makefile +@@ -40,11 +40,11 @@ install: all + $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 755 $(LIB_NAME).a $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 755 $(LIB_NAME).so $(DESTDIR)$(LIBDIR)/$(LIB_NAME).so.$(VERSION) +- $(foreach x, $(LIB_NAME).so, ln -sfn $(x).$(VERSION) $(DESTDIR)$(LIBDIR)/$(patsubst %,%.$(MAJOR_VERSION).$(MINOR_VERSION),$(x)); \ +- ln -sfn $(x).$(MAJOR_VERSION).$(MINOR_VERSION) $(DESTDIR)$(LIBDIR)/$(patsubst %,%.$(MAJOR_VERSION),$(x));) ++ $(foreach x, $(LIB_NAME), ln -sfn $(x).so.$(VERSION) $(DESTDIR)$(LIBDIR)/$(patsubst %,%.so.$(MAJOR_VERSION),$(x)); \ ++ ln -sfn $(x).so.$(VERSION) $(DESTDIR)$(LIBDIR)/$(patsubst %,%.so,$(x));) + + $(LIB_NAME).so: $(OBJS_$(LIB_NAME)) +- $(CCLD) $^ -o $@ $(CFLAGS) -shared -Wl,-soname,$(patsubst %.$(VERSION),%,$@) ++ $(CCLD) $^ -o $@ $(CFLAGS) -shared -Wl,-soname,$(patsubst %,%.$(MAJOR_VERSION),$@) + + $(LIB_NAME).a: $(filter-out init.o,$(OBJS_$(LIB_NAME))) + $(AR) rcs $@ $^ +-- +2.17.1 + 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 old mode 100755 new mode 100644 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 = "\ file://0001-luks-setup.sh-Add-support-for-qemu-with-the-swtpm.patch \ file://0001-encrypt_secret.py-switch-to-python3.patch \ file://0002-luks-setup.sh-Updated-TPM-Tools.patch \ + file://0001-lib-Makefile-set-correct-soname-for-libcryptfs-tpm2.patch \ " SRCREV = "87c35c63090a33d4de437f518b8da9f2d1f1d828" -- cgit v1.2.3-54-g00ecf