( cd usr/lib64 ; rm -rf libtss2-esys.so )
( cd usr/lib64 ; ln -sf libtss2-esys.so.0.0.1 libtss2-esys.so )
( cd usr/lib64 ; rm -rf libtss2-esys.so.0 )
( cd usr/lib64 ; ln -sf libtss2-esys.so.0.0.1 libtss2-esys.so.0 )
( cd usr/lib64 ; rm -rf libtss2-fapi.so )
( cd usr/lib64 ; ln -sf libtss2-fapi.so.1.0.0 libtss2-fapi.so )
( cd usr/lib64 ; rm -rf libtss2-fapi.so.1 )
( cd usr/lib64 ; ln -sf libtss2-fapi.so.1.0.0 libtss2-fapi.so.1 )
( cd usr/lib64 ; rm -rf libtss2-mu.so )
( cd usr/lib64 ; ln -sf libtss2-mu.so.0.0.1 libtss2-mu.so )
( cd usr/lib64 ; rm -rf libtss2-mu.so.0 )
( cd usr/lib64 ; ln -sf libtss2-mu.so.0.0.1 libtss2-mu.so.0 )
( cd usr/lib64 ; rm -rf libtss2-policy.so )
( cd usr/lib64 ; ln -sf libtss2-policy.so.0.0.0 libtss2-policy.so )
( cd usr/lib64 ; rm -rf libtss2-policy.so.0 )
( cd usr/lib64 ; ln -sf libtss2-policy.so.0.0.0 libtss2-policy.so.0 )
( cd usr/lib64 ; rm -rf libtss2-rc.so )
( cd usr/lib64 ; ln -sf libtss2-rc.so.0.0.0 libtss2-rc.so )
( cd usr/lib64 ; rm -rf libtss2-rc.so.0 )
( cd usr/lib64 ; ln -sf libtss2-rc.so.0.0.0 libtss2-rc.so.0 )
( cd usr/lib64 ; rm -rf libtss2-sys.so )
( cd usr/lib64 ; ln -sf libtss2-sys.so.1.0.1 libtss2-sys.so )
( cd usr/lib64 ; rm -rf libtss2-sys.so.1 )
( cd usr/lib64 ; ln -sf libtss2-sys.so.1.0.1 libtss2-sys.so.1 )
( cd usr/lib64 ; rm -rf libtss2-tcti-cmd.so )
( cd usr/lib64 ; ln -sf libtss2-tcti-cmd.so.0.0.0 libtss2-tcti-cmd.so )
( cd usr/lib64 ; rm -rf libtss2-tcti-cmd.so.0 )
( cd usr/lib64 ; ln -sf libtss2-tcti-cmd.so.0.0.0 libtss2-tcti-cmd.so.0 )
( cd usr/lib64 ; rm -rf libtss2-tcti-device.so )
( cd usr/lib64 ; ln -sf libtss2-tcti-device.so.0.0.0 libtss2-tcti-device.so )
( cd usr/lib64 ; rm -rf libtss2-tcti-device.so.0 )
( cd usr/lib64 ; ln -sf libtss2-tcti-device.so.0.0.0 libtss2-tcti-device.so.0 )
( cd usr/lib64 ; rm -rf libtss2-tcti-mssim.so )
( cd usr/lib64 ; ln -sf libtss2-tcti-mssim.so.0.0.0 libtss2-tcti-mssim.so )
( cd usr/lib64 ; rm -rf libtss2-tcti-mssim.so.0 )
( cd usr/lib64 ; ln -sf libtss2-tcti-mssim.so.0.0.0 libtss2-tcti-mssim.so.0 )
( cd usr/lib64 ; rm -rf libtss2-tcti-pcap.so )
( cd usr/lib64 ; ln -sf libtss2-tcti-pcap.so.0.0.0 libtss2-tcti-pcap.so )
( cd usr/lib64 ; rm -rf libtss2-tcti-pcap.so.0 )
( cd usr/lib64 ; ln -sf libtss2-tcti-pcap.so.0.0.0 libtss2-tcti-pcap.so.0 )
( cd usr/lib64 ; rm -rf libtss2-tcti-spi-helper.so )
( cd usr/lib64 ; ln -sf libtss2-tcti-spi-helper.so.0.0.0 libtss2-tcti-spi-helper.so )
( cd usr/lib64 ; rm -rf libtss2-tcti-spi-helper.so.0 )
( cd usr/lib64 ; ln -sf libtss2-tcti-spi-helper.so.0.0.0 libtss2-tcti-spi-helper.so.0 )
( cd usr/lib64 ; rm -rf libtss2-tcti-swtpm.so )
( cd usr/lib64 ; ln -sf libtss2-tcti-swtpm.so.0.0.0 libtss2-tcti-swtpm.so )
( cd usr/lib64 ; rm -rf libtss2-tcti-swtpm.so.0 )
( cd usr/lib64 ; ln -sf libtss2-tcti-swtpm.so.0.0.0 libtss2-tcti-swtpm.so.0 )
( cd usr/lib64 ; rm -rf libtss2-tctildr.so )
( cd usr/lib64 ; ln -sf libtss2-tctildr.so.0.0.0 libtss2-tctildr.so )
( cd usr/lib64 ; rm -rf libtss2-tctildr.so.0 )
( cd usr/lib64 ; ln -sf libtss2-tctildr.so.0.0.0 libtss2-tctildr.so.0 )

# Create tss user / group
if chroot . getent group tss >/dev/null
then
  : tss group already present
else
  GROUPOPT="-g 196"
  if chroot . groupadd $GROUPOPT tss 2>/dev/null
  then
    : tss group successfully added
  else
    chroot . groupadd tss
  fi
fi

if chroot . getent passwd tss >/dev/null
then
  : tss user already present
else
  USEROPT="-g tss -u 196 -d /var/lib/tpm2-tss"
  if chroot . useradd $USEROPT tss 2>/dev/null
  then
    : tss user successfully added
  else
    chroot . useradd tss
  fi
fi

