Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TermuxArch setup scripts has some error in Android x86_64(RemixOS 2.0.513) in Termux #46

Closed
codimiracle opened this issue Feb 12, 2018 · 29 comments

Comments

@codimiracle
Copy link

codimiracle commented Feb 12, 2018

i try to install TermuxArch v0.8 (using method 2) in My Android x86_64, but i meet the problem...

🕠 < 🕛 Checking download integrity with md5sum.  This may take a little while.

archlinux-bootstrap-2018.02.01-x86_64.tar.gz: OK

 🕕 < 🕛 System image file download integrity: OK

 🕡 < 🕛 Uncompressing .  This will take a long time.  Be patient.
bsdtar: Error opening archive: Failed to open '--strip-components'
rm: can't remove '*.tar.gz.md5': No such file or directory

 🕙 < 🕛 Arch Linux in Termux is installed.  Answer the following questions to complete the Arch Linux configuration.

archsystemconfigs.sh: line 143: etc/motd: No such file or directory
archsystemconfigs.sh: line 170: etc/resolv.conf: No such file or directory
necessaryfunctions.sh: line 156: etc/locale.gen: No such file or directory

i download the image and mv it to arch/ArchLinuxARM-x86_64-latest.tar.gz...
it wil be happen...

🕠 < 🕛 Checking download integrity with md5sum.  This may take a little while.

archlinux-bootstrap-2018.02.01-x86_64.tar.gz: OK

 🕕 < 🕛 System image file download integrity: OK

 🕡 < 🕛 Uncompressing .  This will take a long time.  Be patient.
necessaryfunctions.sh: line 139: [: too many arguments


Download Exception!  Exiting...

now, i have no idea to deal with the problem.

@SDRausty
Copy link
Owner

SDRausty commented Feb 12, 2018

@codimiracle Sorry to hear that you are having problems. Thank you for sharing. Can you check if c6ff507 update v0.8 id097122283 works for you out-of-box?

@codimiracle
Copy link
Author

codimiracle commented Feb 13, 2018

necessaryfunctions.sh line 139

 if [ $(du ~/arch/*z | awk {'print $1}') -gt 112233 ];then

should be

if [ $(du ~/arch/*z | awk  {'print $1'}) -gt 112233 ];then

@codimiracle
Copy link
Author

knownconfigurations.sh

x86_64 ()
{
        # x86_64 downloads the latest file automatically.  $file is unnecessary for download.
        mirror=mirrors.evowise.com
        path=/archlinux/iso/latest/
        makesystem
}

but i need to rerun setupTermuxArch.sh(do not uninstall) using command as follows:

export file=archlinux-bootstrap-2018.02.01-x86_64.tar.gz
bash setupTermuxArch.sh

and then i install TermuxArch successfully.

@SDRausty
Copy link
Owner

SDRausty commented Feb 13, 2018

Thanks for the update. 98ca911#diff-a8f27a760a6efd68e7e20b3deb5354df gen.v0.8 id447049456 is currently available for testing. To access gen versions, activate line line 182 in setupTermuxArch.sh dfl=/gen.

@SDRausty SDRausty reopened this Feb 13, 2018
@SDRausty
Copy link
Owner

SDRausty commented Feb 13, 2018

Update; this gen.v0.8 id086259509 requests testing. f977c17#diff-a8f27a760a6efd68e7e20b3deb5354df Access update via line 182 dfl=/gen.

@codimiracle
Copy link
Author

necessaryfunctions.sh line 141

proot --link2symlink -O bsdtar -xpf $file --strip-components 1 

O is not zero.
should be

proot --link2symlink -0 bsdtar -xpf $file --strip-components 1 

take it easy!

@SDRausty
Copy link
Owner

Looks good for a stable candidate 756c251#diff-a8f27a760a6efd68e7e20b3deb5354df 663274271

@SDRausty
Copy link
Owner

This stable release 7815630#diff-f38f8ed8605d40e475f567d0a126c647 id558937627 should resolve this thread. Thank you for your time, interest and input @codimiracle

@codimiracle
Copy link
Author

codimiracle commented Feb 13, 2018

getimagefunctions.sh
Oh...
line 51 nmirror=$(grep Location gmirror | awk {'print $3 } ' )
line 59 nmirror=$(grep Location gmirror | awk {'print $3 } ' )

getimagefunctions.sh
line 18 filename=$(ls *tar.gz)
line 19 sed '2q;d' md5sums.txt > $filename.md5
maybe:
file=$(ls *tar.gz)
sed '2q;d' md5sums.txt > $file.md5
reason:
knownconfigurations.sh:

x86_64 ()
{
        # x86_64 downloads the latest file automatically.  $file is unnecessary for download.
        mirror=mirrors.evowise.com
        path=/archlinux/iso/latest/
        makesystem
}

necessaryfunctions.sh

proot --link2symlink -0 bsdtar -xpf $file --strip-components 1

$file maybe not right.everywhare are not finds file=... when architecture is x86_64

@codimiracle
Copy link
Author

codimiracle commented Feb 13, 2018

id663274271 TEST:

$ bash setupTermuxArch.sh

 🕛 < 🕛 TermuxArch will attempt to install Linux in Termux.  Arch Linux will be available upon successful completion.  Ensure background data is not restricted.  If you do not see one o'clock 🕐 below, check the wireless connection.  Run bash setupTermuxArch.sh --help for additional information.

 🕧 < 🕛 Prerequisite packages: OK

setupTermuxArch.md5        100%[======================================>]      57  --.-KB/s    in 0s
setupTermuxArch.tar.gz     100%[======================================>]   8.78K  --.-KB/s    in 0s

 🕐 < 🕛 TermuxArch downloaded: OK
                                                                                                          setupTermuxArch.sh: UPDATED                                                                               TermuxArch: RESTARTED                                                                                                                                                                                                🕛 < 🕛 TermuxArch will attempt to install Linux in Termux.  Arch Linux will be available upon successful completion.  Ensure background data is not restricted.  If you do not see one o'clock 🕐 below, check the wireless connection.  Run bash setupTermuxArch.sh --help for additional information.

 🕧 < 🕛 Prerequisite packages: OK

setupTermuxArch.md5        100%[======================================>]      57  --.-KB/s    in 0s
setupTermuxArch.tar.gz     100%[======================================>]   8.78K  --.-KB/s    in 0s

 🕐 < 🕛 TermuxArch downloaded: OK

 🕑 < 🕛 TermuxArch gen.v0.8 id663274271 integrity: OK

TermuxArch: DIRECTORY WARNING!  `/data/data/com.termux/files/home/arch/` directory detected.  Termux Arch installation will continue.  Installing into a clean directory is recommended.  Uninstalling before continuing is suggested.

Uninstall Arch Linux? [y|n] y
Uninstalling Arch Linux...
Uninstalling Arch Linux, nothing to do for /data/data/com.termux/files/usr/bin/startarch.
Uninstalling Arch Linux done.

 🕝 < 🕛 Detected x86_64 Android operating system: OK

 🕒 < 🕛 Activated termux-wake-lock.  Downloading  and the corresponding checksum from http://mirrors.evowise.com.  This may take a long time pending connection.

index.html                     [ <=>                                   ]   3.13K  --.-KB/s    in 0s
Downloading  and the corresponding checksum from http://mirrors.evowise.com.  This may take a long time pending Internet connection.

md5sums.txt                    [ <=>                                   ]     145  --.-KB/s    in 0s
ls: *tar.gz: No such file or directory
--2018-02-13 18:54:08--  http://mirrors.evowise.com/archlinux/iso/latest/
Resolving mirrors.evowise.com... 104.19.135.75, 104.19.136.75, 104.19.138.75, ...
Connecting to mirrors.evowise.com|104.19.135.75|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.tmp’

index.html.tmp                 [ <=>                                   ]   3.13K  --.-KB/s    in 0s

Last-modified header missing -- time-stamps turned off.
2018-02-13 18:54:09 (45.2 MB/s) - ‘index.html.tmp’ saved [3202]

Loading robots.txt; please ignore errors.
--2018-02-13 18:54:09--  http://mirrors.evowise.com/robots.txt
Reusing existing connection to mirrors.evowise.com:80.
HTTP request sent, awaiting response... 404 Not Found
2018-02-13 18:54:09 ERROR 404: Not Found.

Removing index.html.tmp since it should be rejected.

--2018-02-13 18:54:09--  http://mirrors.evowise.com/archlinux/iso/latest/arch/
Reusing existing connection to mirrors.evowise.com:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.tmp’

index.html.tmp                 [ <=>                                   ]   2.31K  --.-KB/s    in 0s

Last-modified header missing -- time-stamps turned off.
2018-02-13 18:54:09 (64.9 MB/s) - ‘index.html.tmp’ saved [2369]

Removing index.html.tmp since it should be rejected.

--2018-02-13 18:54:09--  http://mirrors.evowise.com/archlinux/iso/latest/archlinux-bootstrap-2018.02.01-x86_64.tar.gz
Reusing existing connection to mirrors.evowise.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 134312950 (128M) [application/octet-stream]
Saving to: ‘archlinux-bootstrap-2018.02.01-x86_64.tar.gz’

archlinux-bootstrap-2018.0 100%[======================================>] 128.09M  2.17MB/s    in 65s

2018-02-13 18:55:14 (1.97 MB/s) - ‘archlinux-bootstrap-2018.02.01-x86_64.tar.gz’ saved [134312950/134312950]

--2018-02-13 18:55:14--  http://mirrors.evowise.com/archlinux/iso/latest/arch/boot/
Reusing existing connection to mirrors.evowise.com:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.tmp’

index.html.tmp                 [ <=>                                   ]   2.58K  --.-KB/s    in 0s

Last-modified header missing -- time-stamps turned off.
2018-02-13 18:55:15 (77.5 MB/s) - ‘index.html.tmp’ saved [2642]

Removing index.html.tmp since it should be rejected.

--2018-02-13 18:55:15--  http://mirrors.evowise.com/archlinux/iso/latest/arch/x86_64/
Reusing existing connection to mirrors.evowise.com:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.tmp’

index.html.tmp                 [ <=>                                   ]   2.46K  --.-KB/s    in 0s

Last-modified header missing -- time-stamps turned off.
2018-02-13 18:55:15 (55.1 MB/s) - ‘index.html.tmp’ saved [2519]

Removing index.html.tmp since it should be rejected.

--2018-02-13 18:55:15--  http://mirrors.evowise.com/archlinux/iso/latest/arch/boot/x86_64/
Reusing existing connection to mirrors.evowise.com:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.tmp’

index.html.tmp                 [ <=>                                   ]   2.58K  --.-KB/s    in 0.001s

Last-modified header missing -- time-stamps turned off.
2018-02-13 18:55:15 (3.53 MB/s) - ‘index.html.tmp’ saved [2645]

Removing index.html.tmp since it should be rejected.

FINISHED --2018-02-13 18:55:15--
Total wall clock time: 1m 7s
Downloaded: 6 files, 128M in 1m 5s (1.97 MB/s)

 🕠 < 🕛 Checking download integrity with md5sum.  This may take a little while.

archlinux-bootstrap-2018.02.01-x86_64.tar.gz: OK

 🕕 < 🕛 System image file download integrity: OK

 🕡 < 🕛 Uncompressing .  This will take a long time.  Be patient.
bsdtar: Error opening archive: Failed to open '--strip-components'
rm: can't remove '*.tar.gz.md5': No such file or directory

 🕙 < 🕛 Arch Linux in Termux is installed.  Answer the following questions to complete the Arch Linux configuration.

archsystemconfigs.sh: line 143: etc/motd: No such file or directory
archsystemconfigs.sh: line 170: etc/resolv.conf: No such file or directory
necessaryfunctions.sh: line 156: etc/locale.gen: No such file or directory

@SDRausty
Copy link
Owner

Thanks for the update. The code had a logical error which 481321b this commit resolves. Does it resolve this matter too @codimiracle?

@codimiracle
Copy link
Author

codimiracle commented Feb 14, 2018

thanks for update.
as follow.

l🔆 ERROR md5sum mismatch! The download failed and was removed!  Run `bash setupTermuxArch.sh` again.  See `bash setupTermuxArch.sh --help` to resolve md5sum errors.  This kind of error can go away, like magic.  Waiting before executing again is recommended.  There are many reasons for checksum errors.  Proxies are one explaination.  Mirroring and mirrors are another explaination for md5sum errors.  Interrupted download is one more reason.  If this keeps repeating, copy `knownconfigurations.sh` to `setupTermuxArchConfigs.sh` with preferred mirror.  After editing setupTermuxArchConfigs.sh, run `bash setupTermuxArch.sh` and `setupTermuxArchConfigs.sh` loads automaticaly from the same directory.  Change mirror to desired geographic location to resolve md5sum errors.

        Run `bash setupTermuxArch.sh` again.  Exiting...

try i again also.

@SDRausty
Copy link
Owner

SDRausty commented Feb 14, 2018

These two commits should resolve this matter: 1d97713 and ff64863 Thank you for your suggestions.

@SDRausty
Copy link
Owner

It looks like both curl and wget change the md5sum.txt file structure from http://mirrors.evowise.com/archlinux/iso/latest/md5sums.txt This is strange.

From

9ef8f8df6134961966e38de4b9bd7174  archlinux-2018.02.01-x86_64.iso
2f3fab72a10e915e9394c6e6a7880255  archlinux-bootstrap-2018.02.01-x86_64.tar.gz

To

[10:54 ~ ]$ wget http://mirrors.evowise.com/archlinux/iso/latest/md5sums.txt
--2018-02-14 11:38:05--  http://mirrors.evowise.com/archlinux/iso/latest/md5sums.txt
Connecting to 192.168.0.6:5680... connected.
Proxy request sent, awaiting response... 200 OK
Length: 127 [text/plain]
Saving to: ‘md5sums.txt’

md5sums.txt          100%[=====================>]     127  --.-KB/s    in 0s

2018-02-14 11:38:07 (2.28 MB/s) - ‘md5sums.txt’ saved [127/127]

[11:38 ~ ]$ cat md5sums.txt
� �
  �{��A�����L0m��T�HQ��5��k�J�"������̹$Ha������9��Y c�����
                                                         f��䪯�����=�%Y�uȭ�}t��\C�y��?uه3�[11:38 ~ ]$

@codimiracle
Copy link
Author

thanks for update
i intall TermuxArch successfully.
but scripts running command pacman -Syu geting some errors(x86_64 only, it works in aarch64.).
I suggest running these two commands before the command

pacman-key --init
pacman-key --populate

error is:

warning: Public keyring not found; have you run 'pacman-key --init'?
downloading required keys...
error: key "EEEEE2EEEE2EEEEE" could not be looked up remotely
error: key "3C1C876030B65FE2" could not be looked up remotely
error: key "4A1AFC345EBE18F8" could not be looked up remotely
error: key "BBE43771487328A9" could not be looked up remotely
error: key "94657AB20F2A092B" could not be looked up remotely
error: key "FC1B547C8D8172C8" could not be looked up remotely
error: key "A6234074498E9CEE" could not be looked up remotely
error: key "426991CD8406FFF3" could not be looked up remotely
error: key "A5E9288C4FA415FA" could not be looked up remotely
error: key "6D1655C14CE1C13E" could not be looked up remotely
error: key "786C63F330D7CB92" could not be looked up remotely
error: required key missing from keyring
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

reason(maybe):

[03:03 home ]$ date
Thu Feb 15 03:03:23 UTC 2018

but real time is

$ date
Thu Feb 15 11:05:03 CST 2018

and then.
another error is:

Generating locales...
/bin/locale-gen: line 33: sed: command not found
  .UTF-8/bin/locale-gen: line 35: sed: command not found
.../bin/locale-gen: line 38: sed: command not found

@SDRausty
Copy link
Owner

SDRausty commented Feb 16, 2018

@codimiracle this https://github.com/sdrausty/TermuxArch/releases/tag/0.8.1 release addreses the issues discussed in this thread except for:

pacman-key --init
pacman-key --populate

See #33 for further details about entropy. Thank you for your time and information with diagnostics. Functionality for two important architectures is regained and setupTermuxArch.sh has new options thanks to this topic too.

if [ $(getprop ro.product.cpu.abi) = x86 ] || [ $(getprop ro.product.cpu.abi) = x86_64 ];then
		pacman -Syu sed --noconfirm 
	else
		pacman -Syu --noconfirm 
	fi

Hence locale-gen should not have problems findingsed. Update the system and install sed manually with pacman -Syu sed, then use locale-gen again.

@wulvyrn
Copy link

wulvyrn commented Feb 22, 2018

where in the script could this be added before it gets and install packages ?
rng-tools needs to be installed first

rngd -r /dev/urandom

then pacman-key --init etc should work.

@SDRausty
Copy link
Owner

@wulvyrn added with 16517a8 this commit; Thank you for this solution 🎼🏄🐬💦

@SDRausty
Copy link
Owner

SDRausty commented Feb 22, 2018

I got what appeared as success @wulvyrn at first, but now:

$ rngd -r /dev/urandom
unable to adjust write_wakeup_threshold: Permission denied
$ rngd
Unable to open file: /dev/tpm0
can't open any entropy source
Maybe RNG device modules are not loaded

What exactly is wrong with the random devices? Is it because they are devices?

@wulvyrn
Copy link

wulvyrn commented Feb 22, 2018

i don't know. this rabbit hole seems pretty deep! i'll do more digging as i cloned the repo and can test before throwing more dirt out the hole.

is there a rng-tools package for termux? from what i read, it has to be done on the host.

@wulvyrn
Copy link

wulvyrn commented Feb 22, 2018

dumb question: i can't find where it is calling pacman -Syu to update all the packages before it fails.
would it be possible to put this before that command ?

pacman-key --init
pacman-key --autopopulate archlinux

@SDRausty
Copy link
Owner

cloned the repo and can test

Are you familiar with the bloom option? It is designed for testing script modifications locally on device. First run bash setupTermuxArch.sh --bloom. Modify TermuxArch components in $HOME/TermuxArchBloom as desired. Then use bash setupTermuxArch.sh --run to run the entire script locally on device. Good luck.

is there a rng-tools package for termux?

Thank you for opening termux/termux-packages#2180. Let's stay on topic with these issues. pacman-key --populate archlinux hangs #33 is now reopened seeking resolution. Thank you @wulvyrn et al

@wulvyrn
Copy link

wulvyrn commented Feb 23, 2018

i found those option buried in some of the comments of other issues. i must have missed them on the webpages somehow.

@SDRausty
Copy link
Owner

SDRausty commented Feb 23, 2018

@wulvyrn options bloom, run and rootdir have been in the making for months. All three are recent commits that appeared just a little while ago. They are not fully implemented. Comments in the code for all options are upcoming. Most are already listed in bash setupTermuxArch.sh --help.

missed them on the webpages somehow.

The webpages want better documentation. Pull requests are welcome at https://github.com/sdrausty/docsTermuxArch/pulls regarding documentation. Suggestions how to improve the site are welcome as well.

@SDRausty
Copy link
Owner

Comments to the options section in setupTermuxArch.sh are now present with this 4cf8315 commit. This will assist current and future users and developers alike. Thanks for sharing your thoughts about usage @wulvyrn

@SDRausty
Copy link
Owner

Issue termux/proot#10, "pacman -S archlinux-keyring Hangs in Arch Linux Termux PRoot" is now open regarding pacman-key hangs.

@SDRausty
Copy link
Owner

SDRausty commented Mar 3, 2018

Upstream has resolved this issue termux/proot#10 (comment) after working on this topic afaict, @michalbednarski has found:

pacman-key --init
echo disable-scdaemon > /etc/pacman.d/gnupg/gpg-agent.conf
pacman-key --populate

Use this code to resolve pacman-key --populate archlinux issues with Arch Linux in Termux PRoot. Before using pacman-key --populate archlinux, run pacman -S archlinux-keyring first.

Arch x86 and x86_64 results are requested, arm results as well pertaining to finishsetup.sh and pacman-key. If a post setup autoconfiguration with update script is deemed wanted for setupTermuxArch.sh regarding pacman-key, this can be done on a per architecture basis.

@khairiGuiri123
Copy link

Screenshot_20190726_085114_com termux
are you here pleze help me

@SDRausty
Copy link
Owner

@khairiGuiri123 try again. If it doesn't work try the following:
Screenshot_20190726-110727

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants