|
24 | 24 | # SOFTWARE. |
25 | 25 |
|
26 | 26 | export ROOT_DIR |
| 27 | +export BUILD_PALTFORM="linux" |
| 28 | + |
| 29 | +#Check if environment is Termux |
| 30 | +if [ "$(uname -o)" = "Android" ]; then |
| 31 | + export FS_COOK_PLATFORM="termux" |
| 32 | +fi |
| 33 | + |
| 34 | +if [ "$FS_COOK_PLATFORM" == "termux" ]; then |
| 35 | + lshout "Running on termux" |
| 36 | + BUILD_PALTFORM="termux" |
| 37 | +fi |
27 | 38 |
|
28 | 39 | if [ -z $ENABLE_USER_SETUP ]; then |
29 | 40 | export ENABLE_USER_SETUP=false |
@@ -105,24 +116,28 @@ do_mount() { |
105 | 116 |
|
106 | 117 | do_unmount() |
107 | 118 | { |
108 | | - local chroot_dir=$1 |
109 | | - points="$chroot_dir/dev $chroot_dir/sys $chroot_dir/proc" |
110 | | - see_for_directory "$points" |
111 | | - if is_mounted "$chroot_dir/dev"; then |
112 | | - shout "unmounting: $chroot_dir/dev" |
113 | | - $SUDO umount "$chroot_dir"/dev/pts |
114 | | - $SUDO umount "$chroot_dir"/dev |
115 | | - fi |
116 | | - |
117 | | - if is_mounted "$chroot_dir"/proc; then |
118 | | - shout "unmounting: $chroot_dir/proc" |
119 | | - $SUDO umount $chroot_dir/proc |
120 | | - fi |
121 | | - |
122 | | - if is_mounted "$chroot_dir"/sys; then |
123 | | - shout "unmounting: $chroot_dir/sys" |
124 | | - $SUDO umount "$chroot_dir"/sys |
125 | | - fi |
| 119 | + if [ "$FS_COOK_PLATFORM" == "termux" ]; then |
| 120 | + lshout "Skipping unmount for termux" |
| 121 | + else |
| 122 | + local chroot_dir=$1 |
| 123 | + points="$chroot_dir/dev $chroot_dir/sys $chroot_dir/proc" |
| 124 | + see_for_directory "$points" |
| 125 | + if is_mounted "$chroot_dir/dev"; then |
| 126 | + shout "unmounting: $chroot_dir/dev" |
| 127 | + $SUDO umount "$chroot_dir"/dev/pts |
| 128 | + $SUDO umount "$chroot_dir"/dev |
| 129 | + fi |
| 130 | + |
| 131 | + if is_mounted "$chroot_dir"/proc; then |
| 132 | + shout "unmounting: $chroot_dir/proc" |
| 133 | + $SUDO umount $chroot_dir/proc |
| 134 | + fi |
| 135 | + |
| 136 | + if is_mounted "$chroot_dir"/sys; then |
| 137 | + shout "unmounting: $chroot_dir/sys" |
| 138 | + $SUDO umount "$chroot_dir"/sys |
| 139 | + fi |
| 140 | + fi |
126 | 141 | } |
127 | 142 |
|
128 | 143 | is_mounted() { |
@@ -255,6 +270,7 @@ do_build() { |
255 | 270 | foreign_arch "$arch" |
256 | 271 | no_to_directory "$target_dir" |
257 | 272 |
|
| 273 | + |
258 | 274 | export chroot_dir |
259 | 275 | chroot_dir=$target_dir |
260 | 276 |
|
@@ -312,6 +328,7 @@ do_build() { |
312 | 328 |
|
313 | 329 | if [ "$FS_COOK_PLATFORM" == "termux" ]; then |
314 | 330 | lshout "Skipping second stage for termux" |
| 331 | + arch_translate "$arch" |
315 | 332 | else |
316 | 333 | do_second_stage "$target_dir" "$arch" |
317 | 334 | fi |
@@ -541,14 +558,4 @@ install_pkg() |
541 | 558 |
|
542 | 559 | banner |
543 | 560 |
|
544 | | -export BUILD_PALTFORM="linux" |
545 | | - |
546 | | -#Check if environment is Termux |
547 | | -if [ "$(uname -o)" = "Android" ]; then |
548 | | - export FS_COOK_PLATFORM="termux" |
549 | | -fi |
550 | 561 |
|
551 | | -if [ "$FS_COOK_PLATFORM" == "termux" ]; then |
552 | | - lshout "Running on termux" |
553 | | - BUILD_PALTFORM="termux" |
554 | | -fi |
|
0 commit comments