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

makepkg & groups do not function #171

Closed
IamPARANOID opened this issue Jun 4, 2019 · 16 comments
Closed

makepkg & groups do not function #171

IamPARANOID opened this issue Jun 4, 2019 · 16 comments
Labels

Comments

@IamPARANOID
Copy link

Use case is to be able to install packages from the AUR.

Logical starting point: Install yay.
The PKGBUILD is downloaded, but makepkg -s can't be run as root (though it does require a password to act as root).
Next move, add a user that isn't root: startarch c adduser user username
Result: /bin/bash: adduser: command not found
adduser does not exist in either Termux or Arch apparently, in Arch they want you to use useradd as adduser is not real in the Arch ecosystem.
Recourse: Add a user manually using useradd username inside the proot, then add to group wheel (usermod -aG wheel username), and uncomment %wheel ALL=(ALL) NOPASSWD: ALL in visudo:
groups username run as root or username show username as being in wheel, but if just groups is run as username then it does not show as being in wheel.
Wheel group is set not to ask for a password, yet sudo requires ones and then fails with "user is not in the sudoers file", further proving it is not in the wheel group.

What do?

@SDRausty
Copy link
Owner

SDRausty commented Jun 4, 2019

@SDRausty
Copy link
Owner

SDRausty commented Jun 4, 2019

@IamPARANOID
Copy link
Author

IamPARANOID commented Jun 5, 2019

So after further reading it would seem:

  1. addauser and adduser are not to be confused, addauser, or more specifically startarch c addauser user works (confusion because adduser is real command in some distros).
  2. Even after patching makepkg as in Succesfully Modified Stock 'makepkg'... #38, /dev/fd/62 becomes an issue, apparently only on older Android versions (I'm on 5.1.1).

I do however have root access if that could be of any help at all.

@IamPARANOID
Copy link
Author

IamPARANOID commented Jun 5, 2019

As root doing ln -s /proc/self/fd /dev/fd fixed the /dev/fd/62 issue.
See: http://www.ducea.com/2009/02/18/linux-tips-bash-completion-devfd62-no-such-file-or-directory/

To enable root (in LineageOS 12.1 anyway) go to Developer Options -> Root access and set to at least "Apps only", then in Termux run su, or use adb.

However, the patch did not work correctly I believe, and only partially patched it, so now I have this error:
Do not use the '-F' option. This option is only for internal use by makepkg..

@IamPARANOID
Copy link
Author

Reinstalling the pacman package (which contains makepkg), pacman -S pacman, fixes the issue, by undoing the patch.

yay still requires a sudo password however, and will not run as root.

@SDRausty
Copy link
Owner

SDRausty commented Jun 5, 2019

have root access if that could be of any help at all.

Root access to Android is not required.

requires a sudo password

https://duckduckgo.com/html?q=add+user+to+sudo+Arch+Linux

@SDRausty
Copy link
Owner

SDRausty commented Jun 5, 2019

Add a user manually

Use startarch command addauser user to create a user and this user's home directory.

$ startarch help

startarch: Start Arch Linux as root.  This account is reserved for system administration.

startarch c[md] cmd: Run Arch Linux command from Termux as root user.

startarch u[ser]|l[ogin] user: Login as user.  Use startarch c addauser user first to create this user and user's home directory.

startarch r[aw]: Construct the startarch proot statement from exec.../bin/.  For example startarch r su will exec su in Arch Linux.

startarch s[u] user cmd: Login as user and execute command.  Use startarch c addauser user first to create this user and user's home directory.`

@IamPARANOID
Copy link
Author

https://aur.archlinux.org/packages/nosudo/ is your friend.
Manually installing nosudo, then setting a password for root (Arch's root), will get you as far as Password: su: Authentication token manipulation errorexit status 1, unless you log out & log back in.
Then yay works.

https://askubuntu.com/questions/57620/getting-an-authentication-token-manipulation-error-when-trying-to-change-my-us

Root access to Android is not required.

It is required for creating the symlink for /dev/fd/62.

https://duckduckgo.com/html?q=add+user+to+sudo+Arch+Linux

I did add the user to wheel (the sudo group on Arch), but as I stated in the OP, it does not actually set.

@SDRausty
Copy link
Owner

SDRausty commented Jun 7, 2019

@IamPARANOID any luck with using PRoot mounts instead of using ln? You can find an example file in ~/arch/var/binds/:

$ startarch c cat /var/binds/fbindexample.prs
# Hosting sdrausty.github.io/TermuxArch courtesy https://pages.github.com.
# https://sdrausty.github.io/TermuxArch/README has info about this project.
# https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
# To regenerate the start script use `setupTermuxArch.sh re[fresh]`.  Add as many proot statements as you want; The init script will parse this file at refresh.  Examples are included for convenience.  Usage: PROOTSTMNT+="-b host_path:guest_path " The space before the last double quote is necessary.
################################################################################
# PROOTSTMNT+="-b /data/data/com.termux/files/home/arch/var/binds/fbindprocstat:/proc/stat "
# if [[ ! -r /dev/shm ]] ; then
#               PROOTSTMNT+="-b /data/data/com.termux/files/home/arch/tmp:/dev/shm "
# fi

Modify this file. Then run $ startarch😀

@IamPARANOID
Copy link
Author

@SDRausty Nope.

I tried multiple options, including the one you quoted, the one you quoted but to /dev/fd/1, mounting each 'file' in /dev/fd, or just mounting the entire directory.
None worked.
Some notes that may or may not be relevant:

  • /proc/self/fd/3 would not mount.
  • /dev/fd/62 isn't actually a real "file or directory" in /dev/fd/ even when symlinked, meaning it is some "file or directory" in the symlinked /dev/fd that makepkg takes to mean /dev/fd/62.
  • The file command shows /dev/fd/1 as a special character (136/0), where as when symlinked it just simply prints out the file name.
  • /dev/stdout/ exists by default.

File used was /var/bind/fd.prs.

@SDRausty
Copy link
Owner

@IamPARANOID 🌺

$ ls -al /dev/fd/{0..62}
$ ls -al /dev/pts/{0..62}

Example diagnostics:

$ cat /var/bind/pts2.prs
 PROOTSTMNT+="-b /dev/pts/2:/dev/fd/62 "

Remember to login to Arch Linux for changes to take effect. Try asking at https://gitter.im/termux and similar too.

@SDRausty
Copy link
Owner

Root access to Android is not required.

It is required for creating the symlink for /dev/fd/62.

As the device is rooted/cracked your results will vary.

@SDRausty
Copy link
Owner

@IamPARANOID can you explain the motivation for using PRoot on a rooted device?

@IamPARANOID
Copy link
Author

@IamPARANOID can you explain the motivation for using PRoot on a rooted device?

I wanted to install PhantomJS (youtube-dl optional dep), as it was mentioned that it only worked on TermuxArch. It appears to be dead/non-functional however, unless it is manually compiled, which can take days.

@SDRausty
Copy link
Owner

SDRausty commented Sep 3, 2020

wanted to install PhantomJS

The command yay phantomjs builds:
6 aur/phantomjs-git 1:3.0.0dev+23+cb1b04bb5-1 (+0 0.00) (Installed: 1:3.0.0dev+31+0a0b0facb-1)

manually compiled, which can take days.

The package phantomjs-git compiled quickly on armv7l Android 9. To make the command yay you can use makeyay.

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

No branches or pull requests

2 participants