Modify generate_rootstrap to use other hal-rootstrap-data-* packages 08/315408/1
authorSangYoun Kwak <sy.kwak@samsung.com>
Fri, 29 Nov 2024 07:45:19 +0000 (16:45 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Mon, 2 Dec 2024 02:34:25 +0000 (11:34 +0900)
hal-rootstrap generates two rootstrap packages:
hal-rootstrap, hal-rootstrap-headed.
For this separated generation, rootstrap resources(.xml files) are
separated as "common" and "headed" so "hal-rootstrap" package uses
"common" while "hal-rootstrap-headed" package uses "headed" exclusively.

Because of this separation, even hal-rootstrap-data-* is included, it is
not used. To resolve this, the "hal-rootstrap" package will use all
rootstrap resources except "headed" while the "hal-rootstrap-headed"
package uses only "headed" for its build.

Change-Id: I0724edcfb6d5669f797b30e637556c5f4c70333b
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
generate_rootstrap.sh

index 751dad90a5d98abff1200ef51aa3c09530292744..3550a417d4d59e0290b9574bb6de38460abf04d5 100755 (executable)
@@ -103,6 +103,24 @@ function generate_rootstrap_riscv64 {
        return ${RET}
 }
 
+function prepare_rootstrap_resource {
+       local rootstrap_type=$1
+       local rootstrap_resource_dir=$2
+
+       rm -rf "${rootstrap_resource_dir}"
+       case ${rootstrap_type} in
+       "headed")
+               cp -r "/tmp/rs_resource/${rootstrap_type}" "${rootstrap_resource_dir}"
+               ;;
+       *)
+               find "/tmp/rs_resource" \
+                       -maxdepth 1 -mindepth 1 \
+                       ! -wholename '*/headed' \
+                       -exec cp -r {} ${rootstrap_resource_dir} \;
+               ;;
+       esac
+}
+
 function generate_rootstrap {
        local arch=$1
        local rootstrap_type=$2
@@ -116,8 +134,7 @@ function generate_rootstrap {
                include_internal_option=""
        fi
 
-       rm -rf "${rootstrap_resource_dir}"
-       cp -r "/tmp/rs_resource/${ROOTSTRAP_TYPE}" "${rootstrap_resource_dir}"
+       prepare_rootstrap_resource "${rootstrap_type}" "${rootstrap_resource_dir}"
 
        case "${arch}" in
                "arm")