diff options
Diffstat (limited to 'generate_rootstrap.sh')
-rwxr-xr-x | generate_rootstrap.sh | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/generate_rootstrap.sh b/generate_rootstrap.sh index 69e9b98..6c381bc 100755 --- a/generate_rootstrap.sh +++ b/generate_rootstrap.sh @@ -14,13 +14,15 @@ function prepare_generation { } function generate_rootstrap_ix86 { + local build_profile=$1 + ./script/convert32.sh if [[ $? -ne 0 ]]; then echo "Failed to convert .xml files into 32-bit." return $? fi - ./make_rootstrap.sh -C rs-config ./rs_resource --emulator -A i686 + ./make_rootstrap.sh -C rs-config ./rs_resource --emulator -A i686 -p "${build_profile}" RET=$? if [[ ${RET} -ne 0 ]]; then echo "Failed to create rootstrap." @@ -30,13 +32,15 @@ function generate_rootstrap_ix86 { } function generate_rootstrap_x86_64 { + local build_profile=$1 + ./script/convert64.sh if [[ $? -ne 0 ]]; then echo "Failed to convert .xml files into 64-bit" return $? fi - ./make_rootstrap_64.sh -C rs-config ./rs_resource --emulator -A x86_64 + ./make_rootstrap_64.sh -C rs-config ./rs_resource --emulator -A x86_64 -p "${build_profile}" RET=$? if [[ ${RET} -ne 0 ]]; then echo "Failed to create rootstrap." @@ -46,13 +50,15 @@ function generate_rootstrap_x86_64 { } function generate_rootstrap_arm { + local build_profile=$1 + ./script/convert32.sh if [[ $? -ne 0 ]]; then echo "Failed to convert .xml files into 32-bit." return $? fi - ./make_rootstrap.sh -C rs-config ./rs_resource --target -A arm + ./make_rootstrap.sh -C rs-config ./rs_resource --target -A arm -p "${build_profile}" RET=$? if [[ ${RET} -ne 0 ]]; then echo "Failed to create rootstrap." @@ -62,13 +68,15 @@ function generate_rootstrap_arm { } function generate_rootstrap_aarch64 { + local build_profile=$1 + ./script/convert64.sh if [[ $? -ne 0 ]]; then echo "Failed to convert .xml files into 64-bit" return $? fi - ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A aarch64 + ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A aarch64 -p "${build_profile}" RET=$? if [[ ${RET} -ne 0 ]]; then echo "Failed to create rootstrap." @@ -78,13 +86,15 @@ function generate_rootstrap_aarch64 { } function generate_rootstrap_riscv64 { + local build_profile=$1 + ./script/convert64.sh if [[ $? -ne 0 ]]; then echo "Failed to convert .xml files into 64-bit" return $? fi - ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A riscv64 + ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A riscv64 -p "${build_profile}" RET=$? if [[ ${RET} -ne 0 ]]; then echo "Failed to create rootstrap." @@ -96,6 +106,7 @@ function generate_rootstrap_riscv64 { function generate_rootstrap { local arch=$1 local rootstrap_type=$2 + local build_profile=$3 local rootstrap_resource_dir="./rs_resource" rm -rf "${rootstrap_resource_dir}" @@ -103,23 +114,23 @@ function generate_rootstrap { case "${arch}" in "arm") - generate_rootstrap_arm + generate_rootstrap_arm "${build_profile}" return $? ;; "aarch64") - generate_rootstrap_aarch64 + generate_rootstrap_aarch64 "${build_profile}" return $? ;; "i386") - generate_rootstrap_ix86 + generate_rootstrap_ix86 "${build_profile}" return $? ;; "x86_64") - generate_rootstrap_x86_64 + generate_rootstrap_x86_64 "${build_profile}" return $? ;; "riscv64") - generate_rootstrap_riscv64 + generate_rootstrap_riscv64 "${build_profile}" return $? ;; *) @@ -132,11 +143,12 @@ function generate_rootstrap { ARCH=$1 ROOTSTRAP_TYPE=$2 COPY_DEST=$3 +BUILD_PROFILE=$4 -if [[ -z "${ARCH}" ]] || [[ -z "${ROOTSTRAP_TYPE}" ]] || [[ -z "${COPY_DEST}" ]]; then +if [[ -z "${ARCH}" ]] || [[ -z "${ROOTSTRAP_TYPE}" ]] || [[ -z "${COPY_DEST}" ]] || [[ -z "${BUILD_PROFILE}" ]]; then echo "3 parameters are required: <architecture> <rootstrap type> <generate destination>" exit 1 fi prepare_generation "${COPY_DEST}" -generate_rootstrap "${ARCH}" "${ROOTSTRAP_TYPE}" +generate_rootstrap "${ARCH}" "${ROOTSTRAP_TYPE}" "${BUILD_PROFILE}" |