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

Succesfully Modified Stock 'makepkg'... #38

Closed
markfelt opened this issue Jan 26, 2018 · 45 comments
Closed

Succesfully Modified Stock 'makepkg'... #38

markfelt opened this issue Jan 26, 2018 · 45 comments

Comments

@markfelt
Copy link

markfelt commented Jan 26, 2018

...To work on stock TermuxArch. I have built and installed the 'aur/cylon' package on a Samsung S8+.

I basically commented out lines so that 'su' instead of 'sudo' is used, and 'fakeroot' isn't used.

@markfelt
Copy link
Author

Here's the diff from the current (as of this posting) stock 'makepkg' to a version that'll work on Android:
makepkg.zip

@SDRausty
Copy link
Owner

Thank you for sharing your success with us! Can you outline a few steps how to use it with aur?

@markfelt
Copy link
Author

The basic scenario:
After installing Termux and TermuxArch on the Android device, do this:
Have the 'makepkg.diff' file in a location it can be accessed (in the following example, it's located in the normal 'home' directory).

Then run this command:
patch -n -i makepkg.diff -o makepkg /bin/makepkg
(This creates an updated 'makepkg' in the 'home' directory.)

Next, copy the updated 'makepkg' over the original 'makepkg' by running this command:
cp makepkg /bin

Now you're ready to use aur packages...

For example, do these commands to install and run 'aur/cylon' while starting in the 'home' directory:
pacman -S cower
cower -d cylon
cd cylon
makepkg -i
cylon

@markfelt
Copy link
Author

Your mileage may vary based on the Android device used. I wasn't able to build 'cylon' on one device due to a problem with '/dev' and another device won't allow the direct patching of '/bin/makepkg' (which is why I gave the patching steps listed above).

@markfelt
Copy link
Author

Also, the '/dev' problem relates to how redirection is handled in the shell:
https://unix.stackexchange.com/questions/367849/why-is-there-a-dev-fd-63-in-the-output-of-echo-123-cat

In this case, these are the 'makepkg' errors when running on certain devices:
/usr/share/makepkg/util/pkgbuild.sh: line 69: /dev/fd/62: No such file or directory
/usr/share/makepkg/source/file.sh: line 44: /dev/fd/62: No such file or directory

@Raywarioba
Copy link

how can you install arch linux desktop on chromebook, i successful installed the arch linux environment on my chromebook but the problem is i dont know how to install desktop environment

@SDRausty
Copy link
Owner

SDRausty commented Feb 4, 2018

@Raywarioba your question is off topic for this thread unless you are interested in building X and similar on device. "How to use Xorg in TermuxArch?" has information regarding your question. Post more information about Linux desktop topic at #27, or open a new issue. "How to use Xorg in TermuxArch?" #27 can be reopened at any time when requested. Posting information output from bash setupTermuxArch.sh sysinfo is requested.

@SDRausty
Copy link
Owner

SDRausty commented Mar 1, 2018

This TermuxArch v0.9 release adds user functionality to Termux for Arch Linux PRoot users:

  • addauser creates an Arch Linux user and user $HOME directory.
  • addauserps creates an Arch Linux user, user $HOME directory and Arch Linux user startarch login from Termux.

@SDRausty SDRausty changed the title Succesfully modified stock 'makepkg'... Succesfully Modified Stock 'makepkg'... Mar 8, 2018
@SDRausty
Copy link
Owner

@markfelt this TermuxArch v1.1 release adds the patch. However:

makepkg -i
/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
==> Making package: cylon 5.2-4 (Fri Mar  9 12:49:44 UTC 2018)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
/usr/share/makepkg/source/file.sh: line 44: /dev/fd/62: No such file or directory

This error happens on all devices tested, including aarch64 and armv7.

@markfelt
Copy link
Author

markfelt commented Mar 11, 2018 via email

@SDRausty
Copy link
Owner

@markfelt as the patch does not work on Android 6 the patching process has been dropped at present.

an old(?) Kernel (or Bash)

This patch was applied in the latest versions of Arch Linux in armv7 and aarch64. How could this be an old version issue? Making aur repositories accessible is important. Do you have any idea why it works on Android 7, but not on Android 6?

This question, "Everthing Goes Well, Except for These Three Errors #51," might be related since both threads have a common denominator, /dev errors. Why does makepkg need access to /dev? This sounds unreasonable just to build a package, doesn't it? Is there a simple way to have makepkg drop all requests to /dev?

@SDRausty SDRausty added the bug label Mar 14, 2018
@SDRausty
Copy link
Owner

@markfelt after testing in Android 7: fakeroot error. There doesn't appear to be anything setupTermuxArch.sh can do about this at present. Is your device rooted? What architecture is the Android 7 mentioned?

@markfelt
Copy link
Author

Device isn't rooted, which is why I'm using TermuxArch. System Info is attached:
setupTermuxArchDebug.log

@SDRausty
Copy link
Owner

SDRausty commented Mar 18, 2018

Device isn't rooted

Awesome; compiling as root is a no no. Compiling on a rooted device is a no^no no^no; unless seeing the device fail, and how it failed is the goal. Can this be one of the reasons makepkg refuses to run when envoked as root user? If you cannot envoke it, then it is not possible to observe it in action.

System Info is attached:

Cannot open the provided link; @markfelt can you repost it into this thread. This information is important for other projects like au and buildAPKs. It would be great to automate these projects like this one. The information that you provide should be helpful in achieving this sought goal.

haven't figured out how to add AUR, but I got octave working easily.

"A few questions about Arch Linux in Termux PRoot #59," has a question that you might find easy to answer.

@markfelt
Copy link
Author

Begin setupTermuxArch debug information.

Wed Mar 14 08:02:30 PDT 2018
BASH_VERSINFO[0] = 4
BASH_VERSINFO[1] = 4
BASH_VERSINFO[2] = 19
BASH_VERSINFO[3] = 1
BASH_VERSINFO[4] = release
BASH_VERSINFO[5] = aarch64-unknown-linux-android

cat /proc/cpuinfo results:

Processor : AArch64 Processor rev 4 (aarch64)
processor : 0
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 1
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 2
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 3
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 4
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 1

processor : 5
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 1

processor : 6
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 1

processor : 7
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 1

Hardware : Qualcomm Technologies, Inc MSM8998

dpkg --print-architecture result:

aarch64

getprop ro.product.cpu.abi result:

arm64-v8a

getprop ro.product.device result:

dream2qltesq

Download directory information results.

lrwxrwxrwx 1 u0_a335 u0_a335 28 Jan 15 05:56 /data/data/com.termux/files/home/storage/downloads -> /storage/emulated/0/Download
ls: cannot access '/data/data/com.termux/files/home/downloads': No such file or directory
/sdcard/Download exists
/storage/emulated/0/Download exists

uname -mo results:

aarch64 Android

End setupTermuxArch debug information.

Post this information along with information regarding your issue at https://github.com/sdrausty/TermuxArch/issues. This debugging information is found in /data/data/com.termux/files/home/setupTermuxArchDebug.log. If you think screenshots will help in resolving this matter better, include them in your post please.

@ghost
Copy link

ghost commented Mar 21, 2020

@SDRausty @markfelt

To solve the /dev/fd/62: No such file or directory issue, re-compile Arch Linux ARM's bash package and add the bash_cv_dev_fd=whacky option when configuring:

  ./configure --prefix=/usr --with-curses --enable-readline \
    --without-bash-malloc --with-installed-readline \
    bash_cv_dev_fd=whacky

(Reference: termux/termux-packages@ab41f5b)

On an x86_64 machine, one can use qemu-arm-staticAUR to run an ALARM chroot for re-compiling the package (the build process can be quite slow, and using distcc to redirect the compilation to the phone may help speed up a bit).

@SDRausty
Copy link
Owner

To solve the /dev/fd/62: No such file or directory

This is now resolved with the latest commits. The command setupTermuxArch.bash r refreshes the installation quickly and resolves No such file or directory when using makepkg.

@SDRausty
Copy link
Owner

This updated diff is current (as of this posting) and was tested on armv7h Android:
makepkg.zip

@SDRausty
Copy link
Owner

SDRausty commented Jul 19, 2020

The patch is now included in the root directory of the project, but an error persists. The best result with makepkg at present is:

-==> Starting prepare()...
-patching file libfakeroot.c
-patch: setting attribute security.selinux for security.selinux: Permission denied
-==> ERROR: A failure occurred in prepare().
-    Aborting...

Thank you to those who have contributed. More contributions are welcome.

EDIT: $ makepkg --noprepare resolves this error:

+==> Leaving fakeroot environment.
+==> Finished making: fakeroot-tcp 1.24-2 (Sun 19 Jul 2020 05:36:07 AM EDT)

@SDRausty SDRausty pinned this issue Jul 19, 2020
@SDRausty SDRausty reopened this Jul 19, 2020
@SDRausty
Copy link
Owner

Using makepkg with the --noprepare

@petkar
Copy link

petkar commented Jul 19, 2020

I can't thank you enough! I'm really happy that I'm able to install packages from the aur.

@SDRausty
Copy link
Owner

SDRausty commented Aug 6, 2020

The aur repository is now partly automated with functions _ADDmakefakeroot-tcp_, _ADDmakeyay_ and _ADDpatchmakepkg_ added to archlinuxconfig.bash to help easily enable aur. These functions add these makefakeroot-tcp.bash, makeyay.bash and patchmakepkg.bash commands.

@SDRausty
Copy link
Owner

SDRausty commented Aug 6, 2020

@petkar you are very welcome. Thank you for contributing to this project.

@ghost
Copy link

ghost commented Jun 16, 2021

Why my pacman doesn't install the cower package?
pacman -S cower
Output: error: target not found: cower

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

No branches or pull requests

6 participants