scripts: gen-secure-initramfs: convert absolute symlinks into relative ones
prpl CI enables CONFIG_IB which runs imagebuilder. Imagebuilder was failing when trying to copy targets from symlink whose path was absolute. The solution is to convert absolute symlinks into relative ones when creating the secure initramfs. Fixes: PCF-1893 Tracked-by: FEAT-29 Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
This commit is contained in:
parent
6ecd84b713
commit
5aa0a8800d
@ -104,9 +104,16 @@ function find_binary {
|
||||
|
||||
|
||||
function import_file_symlink {
|
||||
import_file_other "$1"
|
||||
mkdir -p `dirname $TMP_FOLDER$1`
|
||||
target=`readlink "$ROOTFS_FOLDER$1"`
|
||||
[[ "$target" == /* ]] || target=`dirname "$1"`/$target
|
||||
if [[ "$target" == /* ]] ; then
|
||||
# Create a relative symlink
|
||||
reltarget=$(realpath --relative-to="$(dirname "$ROOTFS_FOLDER$1")" "$ROOTFS_FOLDER$target")
|
||||
ln -sf "$reltarget" "$TMP_FOLDER$1"
|
||||
else
|
||||
cp -pPTr "$ROOTFS_FOLDER$1" "$TMP_FOLDER$1"
|
||||
target=`dirname "$1"`/$target
|
||||
fi
|
||||
import_file "$target"
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user