Skip to content
This repository was archived by the owner on Jan 27, 2025. It is now read-only.

Commit a69d8d3

Browse files
authored
script: function jack_env (#76)
* script: function jack_env Added a function that detects how much RAM it's on the system and exports it on JACK_SERVER_VM_ARGUMENTS. The amount of RAM that will be set it's physical GB amount minus 1GB, unless there is more than 16GB RAM
2 parents 5262bb3 + 288b513 commit a69d8d3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build-dakkar.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ elif [[ $(uname -s) = "Linux" ]];then
1313
fi
1414

1515
## handle command line arguments
16+
read -p "Do you want to sync? " choice
1617

1718
function help() {
1819
cat <<EOF
@@ -290,6 +291,13 @@ function build_variant() {
290291
cp "$OUT"/system.img release/"$rom_fp"/system-"$2".img
291292
}
292293

294+
function jack_env() {
295+
RAM=$(free | awk '/^Mem:/{ printf("%0.f", $2/(1024^2))}') #calculating how much RAM (wow, such ram)
296+
if [[ "$RAM" -lt 16 ]];then #if we're poor guys with less than 16gb
297+
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx"$((RAM -1))"G"
298+
fi
299+
}
300+
293301
parse_options "$@"
294302
get_rom_type "$@"
295303
get_variants "$@"
@@ -299,12 +307,15 @@ if [[ -z "$mainrepo" || ${#variant_codes[*]} -eq 0 ]]; then
299307
exit 1
300308
fi
301309

310+
if [[ $choice == *"y"* ]];then
302311
init_release
303312
init_main_repo
304313
init_local_manifest
305314
init_patches
306315
sync_repo
316+
fi
307317
patch_things
318+
jack_env
308319

309320
. build/envsetup.sh
310321

0 commit comments

Comments
 (0)