@@ -31,9 +31,9 @@ script_version="1.27"
31
31
# size to 0
32
32
init_size=50000
33
33
bash_size=1752808
34
- script_size=38502
34
+ script_size=42559
35
35
busybox_size=1181592
36
- utils_size=4392469
36
+ utils_size=4393102
37
37
38
38
# Full path to the script
39
39
if [ -n " ${BASH_SOURCE[0]} " ]; then
75
75
export working_dir=" ${BASE_DIR} " /" ${conty_dir_name} "
76
76
fi
77
77
78
- if [ " ${USE_SYS_UTILS} " != 1 ] && [ " ${busybox_size} " -gt 0 ]; then
78
+ if [ " ${USE_SYS_UTILS} " != 1 ] && [[ " ${busybox_size} " -gt 0 ] ]; then
79
79
busybox_bin_dir=" ${working_dir} " /busybox_bins
80
80
busybox_path=" ${busybox_bin_dir} " /busybox
81
81
@@ -402,7 +402,7 @@ nvidia_driver_handler () {
402
402
curl -#Lo nvidia.run " ${driver_url} "
403
403
404
404
# If the previous download failed, get the URL from FlatHub repo
405
- if [ ! -s nvidia.run ] || [ " $( stat -c%s nvidia.run) " -lt 30000000 ]; then
405
+ if [ ! -s nvidia.run ] || [[ " $( stat -c%s nvidia.run) " -lt 30000000 ] ]; then
406
406
rm -f nvidia.run
407
407
driver_url=" https:$( curl -#Lo - " https://raw.githubusercontent.com/flathub/org.freedesktop.Platform.GL.nvidia/master/data/nvidia-${nvidia_driver_version} -x86_64.data" | cut -d ' :' -f 6) "
408
408
curl -#Lo nvidia.run " ${driver_url} "
@@ -489,17 +489,17 @@ if [ "${dwarfs_image}" = 1 ]; then
489
489
if getconf _PHYS_PAGES & > /dev/null && getconf PAGE_SIZE & > /dev/null; then
490
490
memory_size=" $(( $(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE) / (1024 * 1024 )) )"
491
491
492
- if [ " ${memory_size} " -ge 45000 ]; then
492
+ if [[ " ${memory_size} " -ge 45000 ] ]; then
493
493
dwarfs_cache_size=" 4096M"
494
- elif [ " ${memory_size} " -ge 23000 ]; then
494
+ elif [[ " ${memory_size} " -ge 23000 ] ]; then
495
495
dwarfs_cache_size=" 2048M"
496
- elif [ " ${memory_size} " -ge 15000 ]; then
496
+ elif [[ " ${memory_size} " -ge 15000 ] ]; then
497
497
dwarfs_cache_size=" 1024M"
498
- elif [ " ${memory_size} " -ge 7000 ]; then
498
+ elif [[ " ${memory_size} " -ge 7000 ] ]; then
499
499
dwarfs_cache_size=" 512M"
500
- elif [ " ${memory_size} " -ge 3000 ]; then
500
+ elif [[ " ${memory_size} " -ge 3000 ] ]; then
501
501
dwarfs_cache_size=" 256M"
502
- elif [ " ${memory_size} " -ge 1500 ]; then
502
+ elif [[ " ${memory_size} " -ge 1500 ] ]; then
503
503
dwarfs_cache_size=" 128M"
504
504
else
505
505
dwarfs_cache_size=" 64M"
@@ -509,7 +509,7 @@ if [ "${dwarfs_image}" = 1 ]; then
509
509
if getconf _NPROCESSORS_ONLN & > /dev/null; then
510
510
dwarfs_num_workers=" $( getconf _NPROCESSORS_ONLN) "
511
511
512
- if [ " ${dwarfs_num_workers} " -ge 8 ]; then
512
+ if [[ " ${dwarfs_num_workers} " -ge 8 ] ]; then
513
513
dwarfs_num_workers=8
514
514
fi
515
515
fi
518
518
# Extract utils.tar.gz
519
519
mkdir -p " ${working_dir} "
520
520
521
- if ([ " ${USE_SYS_UTILS} " != 1 ] && [ " ${utils_size} " -gt 0 ]) || [ " $1 " = " -u" ]; then
521
+ if ([ " ${USE_SYS_UTILS} " != 1 ] && [[ " ${utils_size} " -gt 0 ] ]) || [ " $1 " = " -u" ]; then
522
522
# Check if filesystem of the working_dir is mounted without noexec
523
523
if ! exec_test; then
524
524
if [ -z " ${BASE_DIR} " ]; then
@@ -701,7 +701,7 @@ run_bwrap () {
701
701
sandbox_params+=(--dir " ${HOME} " )
702
702
fi
703
703
704
- if [ -n " ${SANDBOX_LEVEL} " ] && [ " ${SANDBOX_LEVEL} " -ge 2 ]; then
704
+ if [ -n " ${SANDBOX_LEVEL} " ] && [[ " ${SANDBOX_LEVEL} " -ge 2 ] ]; then
705
705
sandbox_level_msg=" (level 2)"
706
706
sandbox_params+=(--dir " ${XDG_RUNTIME_DIR} " \
707
707
--ro-bind-try " ${XDG_RUNTIME_DIR} " /" ${wayland_socket} " " ${XDG_RUNTIME_DIR} " /" ${wayland_socket} " \
@@ -716,7 +716,7 @@ run_bwrap () {
716
716
--bind-try /run/dbus /run/dbus)
717
717
fi
718
718
719
- if [ -n " ${SANDBOX_LEVEL} " ] && [ " ${SANDBOX_LEVEL} " -ge 3 ]; then
719
+ if [ -n " ${SANDBOX_LEVEL} " ] && [[ " ${SANDBOX_LEVEL} " -ge 3 ] ]; then
720
720
sandbox_level_msg=" (level 3)"
721
721
DISABLE_NET=1
722
722
fi
@@ -759,7 +759,7 @@ run_bwrap () {
759
759
760
760
if [ " ${DISABLE_X11} " != 1 ]; then
761
761
if [ " $( ls /tmp/.X11-unix 2> /dev/null) " ]; then
762
- if [ -n " ${SANDBOX_LEVEL} " ] && [ " ${SANDBOX_LEVEL} " -ge 3 ]; then
762
+ if [ -n " ${SANDBOX_LEVEL} " ] && [[ " ${SANDBOX_LEVEL} " -ge 3 ] ]; then
763
763
xsockets+=(--ro-bind-try /tmp/.X11-unix/X" ${xephyr_display} " /tmp/.X11-unix/X" ${xephyr_display} " \
764
764
--setenv " DISPLAY" :" ${xephyr_display} " )
765
765
else
@@ -782,7 +782,7 @@ run_bwrap () {
782
782
mount_opt=(--bind-try /opt /opt)
783
783
fi
784
784
785
- if ([ " ${NVIDIA_HANDLER} " -ge 1 ] || [ " ${USE_OVERLAYFS} " = 1 ]) && \
785
+ if ([[ " ${NVIDIA_HANDLER} " -ge 1 ] ] || [ " ${USE_OVERLAYFS} " = 1 ]) && \
786
786
[ " $( ls " ${overlayfs_dir} " /merged 2> /dev/null) " ]; then
787
787
newroot_path=" ${overlayfs_dir} " /merged
788
788
else
@@ -1038,7 +1038,7 @@ if [ "$(ls "${mount_point}" 2>/dev/null)" ] || launch_wrapper "${mount_command[@
1038
1038
available_disk_space=" $( df -P -B1 " ${PWD} " | awk ' END {print $4}' ) "
1039
1039
required_disk_space=" $(( current_file_size* 7 )) "
1040
1040
1041
- if [ " ${available_disk_space} " -lt " ${required_disk_space} " ]; then
1041
+ if [[ " ${available_disk_space} " -lt " ${required_disk_space} " ] ]; then
1042
1042
echo " Not enough free disk space"
1043
1043
echo " You need at least $(( required_disk_space/ 1024 / 1024 )) MB of free space"
1044
1044
exit 1
@@ -1084,7 +1084,7 @@ if [ "$(ls "${mount_point}" 2>/dev/null)" ] || launch_wrapper "${mount_command[@
1084
1084
echo " Creating an image..."
1085
1085
launch_wrapper " ${compression_command[@]} "
1086
1086
1087
- if [ " ${init_size} " -gt 0 ]; then
1087
+ if [[ " ${init_size} " -gt 0 ] ]; then
1088
1088
tail -c +$(( init_size+ bash_size+ 1 )) " ${script} " | head -c " ${script_size} " > conty-start.sh
1089
1089
else
1090
1090
head -c " ${script_size} " " ${script} " > conty-start.sh
@@ -1126,7 +1126,7 @@ if [ "$(ls "${mount_point}" 2>/dev/null)" ] || launch_wrapper "${mount_command[@
1126
1126
exit
1127
1127
fi
1128
1128
1129
- if [ " ${NVIDIA_HANDLER} " -ge 1 ]; then
1129
+ if [[ " ${NVIDIA_HANDLER} " -ge 1 ] ]; then
1130
1130
if [ -f /sys/module/nvidia/version ]; then
1131
1131
unset NVIDIA_SHARED
1132
1132
@@ -1294,7 +1294,7 @@ if [ "$(ls "${mount_point}" 2>/dev/null)" ] || launch_wrapper "${mount_command[@
1294
1294
fi
1295
1295
1296
1296
# If SANDBOX_LEVEL is 3, run Xephyr and openbox before running applications
1297
- if [ " ${SANDBOX} " = 1 ] && [ -n " ${SANDBOX_LEVEL} " ] && [ " ${SANDBOX_LEVEL} " -ge 3 ]; then
1297
+ if [ " ${SANDBOX} " = 1 ] && [ -n " ${SANDBOX_LEVEL} " ] && [[ " ${SANDBOX_LEVEL} " -ge 3 ] ]; then
1298
1298
if [ -f " ${mount_point} " /usr/bin/Xephyr ]; then
1299
1299
if [ -z " ${XEPHYR_SIZE} " ]; then
1300
1300
XEPHYR_SIZE=" 800x600"
0 commit comments