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

How to fix makepkg without reinstalling TermuxArch? #129

Closed
dlintw opened this issue Sep 27, 2018 · 26 comments
Closed

How to fix makepkg without reinstalling TermuxArch? #129

dlintw opened this issue Sep 27, 2018 · 26 comments
Labels
enhancement makepkg question shmem https://github.com/sdrausty/libandroid-shmem

Comments

@dlintw
Copy link

dlintw commented Sep 27, 2018

I want to fix makepkg issues, there are two major issues, it seems has solved. But I can not do it by exist makepkg.

  1. sudo - seems nosudo can replace it, but it is not the same as sudo, it require type in root password.
  2. fakeroot - seems fakeroot-tcp can replace it, but it failed compile I got no selinux issue

Why not provide a workable script to build the replacement packcakage just during the TermuxArchSetup.sh?

Or, if it has contains in the TermuxArchSetup.sh, How can I redo it without reinstall the archlinux(I've setup many packages, it is a hardwork for re-setup all).

@SDRausty
Copy link
Owner

SDRausty commented Sep 27, 2018

@dlintw setupTermuxArch.sh r should do what you desire. See setupTermuxArch.sh h for information.

@dlintw
Copy link
Author

dlintw commented Sep 27, 2018

@SDRausty I just try to do 'r' again. And it doesn't let the 'makepkg' workable.
I try to run 'makepkg' on nosudo package. It failed on call fakeroot: lack of SYSV IPC

@SDRausty
Copy link
Owner

[user13:37~]$ sudo whoami

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for root:
root
[user13:38~]$ whoami
user

@dlintw did you use a user account in Arch Linux, i.e., startarch l user?

@SDRausty
Copy link
Owner

SDRausty commented Sep 27, 2018

Are you familiar with this Succesfully Modified Stock 'makepkg'... #38 issue?

@dlintw
Copy link
Author

dlintw commented Sep 27, 2018

yes, I use normal user to do this. I wish there is a setupMakepkg.sh to provide what #38 said to build fakeroot-tcp. I think it will also install base-devel and git if necessary.

@SDRausty SDRausty added question shmem https://github.com/sdrausty/libandroid-shmem makepkg labels Sep 28, 2018
@SDRausty
Copy link
Owner

SDRausty commented Sep 28, 2018

@dlintw I have added labels for this topic as markers, a bit like guides.

Can you outline a little more what you are working on? This way I can follow along.

@dlintw
Copy link
Author

dlintw commented Sep 29, 2018

I have not do it. I was misunderstand is is already included in setup.sh.

@SDRausty
Copy link
Owner

What are you trying to build with makepkg @dlintw?

@dlintw
Copy link
Author

dlintw commented Sep 29, 2018

In fact, I want to use yay for any AUR packages. So, the first fakeroot-tcp, than nosudo. When makepkg work, maybe bvi

@SDRausty
Copy link
Owner

I want to use yay for any AUR packages.

I tried building yay:

[user16:09yay]$ makepkg -si
==> Making package: yay 8.1139-1 (Sun 30 Sep 2018 04:10:01 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading yay-8.1139.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   118    0   118    0     0    203      0 --:--:-- --:--:-- --:--:--   204
100  340k  100  340k    0     0   114k      0  0:00:02  0:00:02 --:--:--  173k
==> Validating source files with sha1sums...
    yay-8.1139.tar.gz ... Passed
==> Extracting sources...
  -> Extracting yay-8.1139.tar.gz with bsdtar
==> Starting build()...
go build -v -ldflags '-s -w -X main.version=8.1139' -o yay
github.com/jguer/go-alpm
github.com/Morganamilo/go-srcinfo
github.com/Morganamilo/go-pacmanconf/ini
github.com/Morganamilo/go-pacmanconf
github.com/mikkeloscar/aur
_/home/user/yay/src/yay-8.1139
==> Entering fakeroot environment...
fakeroot, while creating message channels: Function not implemented
This may be due to a lack of SYSV IPC support.
fakeroot: error while starting the `faked' daemon.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
[user16:11yay]$

Do you get a similar result @dlintw?

@dlintw
Copy link
Author

dlintw commented Sep 30, 2018

yes, so, I guess use fakeroot-tcp may let it work. But I can't use makepkg directly because fakeroot can't work.

@SDRausty
Copy link
Owner

use fakeroot-tcp may let it work.

[user16:11yay]$ sudo pc fakeroot-tcp
[sudo] password for root:

==> Running TermuxArch pc fakeroot-tcp v1.6.2.id3957…

error: target not found: fakeroot-tcp
error: no operation specified (use -h for help)

 pc WARNING:  Generated script signal 1 near or at line number 78 by !


TermuxArch pc fakeroot-tcp v1.6.2.id3957: DONE 🏁

[user17:56yay]$

But I can't use makepkg directly because fakeroot can't work.

Ditto, I cannot get it to run correctly.

@SDRausty
Copy link
Owner

SDRausty commented Oct 1, 2018

One way to do it would be to build a separate copy of fakeroot-tcp from source http://ftp.debian.org/debian/pool/main/f/fakeroot/
open up the PKGBUILD, install the dependencies (arch packages):
depends=('glibc' 'filesystem' 'sed' 'util-linux' 'sh')
makedepends=('po4a')
follow the commands in PKGBUILD
install it to a temporary prefix (say, /opt/fakeroot),
add said prefix to $PATH,
use that to bootstrap fakeroot-tcp from makepkg.

Reference https://www.reddit.com/r/archlinux/comments/7rycmu/cannot_build_fakeroottcp_without_fakeroot/

Let's see whether this method works well with our setup.

@SDRausty SDRausty changed the title How to fixed makepkg issue without reinstall TermuxArch? How to fix makepkg issue without reinstalling TermuxArch? Oct 1, 2018
@SDRausty SDRausty changed the title How to fix makepkg issue without reinstalling TermuxArch? How to fix makepkg without reinstalling TermuxArch? Oct 1, 2018
@dlintw
Copy link
Author

dlintw commented Oct 6, 2018

https://gist.github.com/10da0d331d7fccee77c2a9062a2617dc

Here is my work script, it is still in draft. And I found another issue in this Proot env, the 'patch' can NOT work well, it complaint no selinux permission.

@SDRausty
Copy link
Owner

I managed to get nosudo to work. It should function as expected with this 87fcaa5 commit.

@SDRausty
Copy link
Owner

I am curious how far our thread shall go. Hopefully, we will build some more interesting projects with these tools in the near future. Here is the output of nosudo on Android smartphone:

[user13:21~]$ ./nosudo/src/nosudo
usage: ./nosudo/src/nosudo [-u username|#uid] [-bEHi] [VAR=value] command
usage: ./nosudo/src/nosudo [-u username|#uid] -l [-n] [command]
usage: ./nosudo/src/nosudo [-u username|#uid] -e [file ...]

Options:
  -b       run command in the background
  -E       preserve user environment when executing command
  -e       edit files instead of running a command
  -H       set HOME variable to target user's home dir
  -h       display help message and exit
  -i       run a login shell as target user
  -l       list user's available commands (dummy)
  -n       non-interactive mode, will not prompt user
  -u user  run command (or edit file) as specified user
  --       stop processing command line arguments

Thank you for the details that you provided. They helped greatly.

@dlintw
Copy link
Author

dlintw commented Oct 10, 2018

I do not think nosudo is necessary for makepkg. but patch is required.

@SDRausty
Copy link
Owner

pacman -S patch will install patch.

@dlintw
Copy link
Author

dlintw commented Oct 11, 2018

It installed, but contained selinux issue when build chroot-tcp. I mean it's native PkGBUILD.

@dlintw
Copy link
Author

dlintw commented Oct 11, 2018

To let makepkg build, just remove sudo and it will work without nosudo.

@takov751
Copy link

I had a bit of experiment i did installed fakeroot in termux itself and then tried copy the stuff in arch subsystem. In the end i figured out that the interpreter bound to the system itself

/faked: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, stripped

Is there any way to link android /system in the subsystem?

@weitongdao
Copy link

I am a newer and like this archlinux in termux.
however.i relay on the yaourt much.
recently when i am trytoinstall yaourt manually.
the pkgbuild goes wrong.
------output such as
/usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory /usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory /usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory /usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory /usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory /usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory /usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory /usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory /usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory /usr/bin/makepkg: line 1025: /dev/fd/62: No such file or directory ==> Making package: package-query 1.9-3 (Sat 01 Dec 2018 07:39:40 PM CST) ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> Retrieving sources... /usr/share/makepkg/source/file.sh: line 44: /dev/fd/62: No such file or directory

i have no idea butask for help here.

thanks for reply.
My Android phone Z9max .system version 5.1

@SDRausty
Copy link
Owner

SDRausty commented Feb 4, 2019

@takov751

Is there any way to link android /system in the subsystem?

Try:

for lib in $(find /system/framework -type f -iname \*.jar); do
    BOOTCLASSPATH=${lib}:${BOOTCLASSPATH};
done
BOOTCLASSPATH=${BOOTCLASSPATH%%:}
export BOOTCLASSPATH

Let us know how it works🍀

@mambiux
Copy link

mambiux commented Sep 19, 2019

Hey guys im having the same issue installing yay==> Entering fakeroot environment...
fakeroot, while creating message channels: Function not implemented
This may be due to a lack of SYSV IPC support

Also tried to install fakeroot-tcp, but it failed, did you found a workaround?, thanks for the help, im loving the arch in my pocket, thanks SDRausty

Well well well, after a lot of thinkering and my girlfriend almost killing me because of me staring many many hours(days) at my phone, got fakeroot to work,

./bootstrap

./configure --prefix=/opt/fakeroot \ --libdir=/opt/fakeroot/libs \ --disable-static \ --with-ipc=tcp

make

sudo make install

/opt/fakeroot/bin/fakeroot

exit

exit

logout

login into user

installed yay

installed fakeroot-tcp from yay

rm /usr/bin/fakeroot

reinstalled fakeroot-tcp from yay

yay -Syu

pacman -Syyu

and it fucking works!!

@sobaee
Copy link

sobaee commented Aug 12, 2020

@mambiux
Were you working on root in the first steps then log out or what?

@xnn403
Copy link

xnn403 commented Apr 29, 2023


[user13:37~]$ sudo whoami



We trust you have received the usual lecture from the local System

Administrator. It usually boils down to these three things:



    #1) Respect the privacy of others.

    #2) Think before you type.

    #3) With great power comes great responsibility.



[sudo] password for root:

root

[user13:38~]$ whoami

user

@dlintw did you use a user account in Arch Linux, i.e., startarch l user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement makepkg question shmem https://github.com/sdrausty/libandroid-shmem
Projects
None yet
Development

No branches or pull requests

7 participants