这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@twaik
Copy link
Member

@twaik twaik commented Apr 9, 2025

Updating apt repositories and installing libarchive-tools takes some time. We can avoid wasting this time and generate pacman package without it.

@Maxython @robertkirkman I will be appreciated for review and probably on-device test.

@twaik twaik force-pushed the dev/not-use-bsdtar branch 2 times, most recently from dc497f0 to 3f93f5a Compare April 9, 2025 16:57
Copy link
Member

@robertkirkman robertkirkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still working exactly correctly on apt and working at runtime, and the contents of the package are extremely similar to the contents of an older version

diff -burN termux-x11-deb-old/control termux-x11-deb-new/control
--- termux-x11-deb-old/control	2023-08-06 15:30:55.000000000 -0500
+++ termux-x11-deb-new/control	2025-04-09 12:02:19.000000000 -0500
@@ -1,7 +1,7 @@
 Package: termux-x11-nightly
 Architecture: all
 Maintainer: Twaik Yont @twaik
-Version: 1.03.00-0
+Version: 1.03.01-0
 Homepage: https://github.com/termux/termux-x11
 Depends: xkeyboard-config
 Description: Companion package for termux-x11 app
Binary files termux-x11-deb-old/control.tar.gz and termux-x11-deb-new/control.tar.gz differ
diff -burN termux-x11-deb-old/data/data/com.termux/files/usr/bin/termux-x11 termux-x11-deb-new/data/data/com.termux/files/usr/bin/termux-x11
--- termux-x11-deb-old/data/data/com.termux/files/usr/bin/termux-x11	2023-08-06 15:30:55.000000000 -0500
+++ termux-x11-deb-new/data/data/com.termux/files/usr/bin/termux-x11	2025-04-09 12:02:19.000000000 -0500
@@ -1,4 +1,7 @@
 #!/data/data/com.termux/files/usr/bin/sh
+[ -z "${LD_LIBRARY_PATH+x}" ] || export XSTARTUP_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
+[ -z "${LD_PRELOAD+x}" ] || export XSTARTUP_LD_PRELOAD="$LD_PRELOAD"
+[ -z "${CLASSPATH+x}" ] || export XSTARTUP_CLASSPATH="$CLASSPATH"
 export CLASSPATH=/data/data/com.termux/files/usr/libexec/termux-x11/loader.apk
 unset LD_LIBRARY_PATH LD_PRELOAD
-exec /system/bin/app_process / com.termux.x11.Loader "$@"
+exec /system/bin/app_process -Xnoimage-dex2oat / --nice-name="termux-x11 com.termux.x11 $*" com.termux.x11.Loader "$@"
Binary files termux-x11-deb-old/data/data/com.termux/files/usr/libexec/termux-x11/loader.apk and termux-x11-deb-new/data/data/com.termux/files/usr/libexec/termux-x11/loader.apk differ
Binary files termux-x11-deb-old/data.tar.xz and termux-x11-deb-new/data.tar.xz differ
diff -burN termux-x11-deb-old/postinst termux-x11-deb-new/postinst
--- termux-x11-deb-old/postinst	1969-12-31 18:00:00.000000000 -0600
+++ termux-x11-deb-new/postinst	2025-04-09 12:02:19.000000000 -0500
@@ -0,0 +1,2 @@
+#!/data/data/com.termux/files/usr/bin/sh
+chmod -w /data/data/com.termux/files/usr/libexec/termux-x11/loader.apk

@robertkirkman
Copy link
Member

robertkirkman commented Apr 10, 2025

Well, I noticed some small details but, I am not sure if they are important, since it seems to work without them exactly matching to the way they were before.

with the current termux-x11-nightly from pkg install termux-x11-nightly, ls -lah $PREFIX/libexec/termux-x11/loader.apk looks like this

-r--------. 1 u0_a289 u0_a289 5.0K Jan 12 14:12 /data/data/com.termux/files/usr/libexec/termux-x11/loader.apk

But with this one, it looks like this

-r--r--r--. 1 u0_a289 u0_a289 5.0K Apr  9 12:02 /data/data/com.termux/files/usr/libexec/termux-x11/loader.apk

and with the current one, I think postinst has permissions like this

-rw-r--r--   1 tacokoneko tacokoneko  112 Apr  9 05:26 postinst

but with this one, the postinst has permissions like this

-rw-------. 1 u0_a289 u0_a289 112 Apr  9 12:02 postinst

@twaik twaik force-pushed the dev/not-use-bsdtar branch from 3f93f5a to 4550b16 Compare April 10, 2025 05:32
Updating apt repositories and installing libarchive-tools takes some time.
We can avoid wasting this time and generate pacman package without it.

Also fetching the whole repo seems to be redunant, we do not need to fetch history.
@twaik twaik force-pushed the dev/not-use-bsdtar branch from 4550b16 to 8152472 Compare April 10, 2025 05:34
@twaik
Copy link
Member Author

twaik commented Apr 10, 2025

It is still working exactly correctly on apt and working at runtime, and the contents of the package are extremely similar to the contents of an older version

Yep, bsdtar is only used to generate pacman package.

Well, I noticed some small details but, I am not sure if they are important...

They only important thing is to keep loader.apk readonly because of W^X restriction of JVM, other stuff is not so important.

I populated pacman bootstrap in AVD and now I know this package is installable and it works.
I will merge it after CI finishes checking.

@twaik twaik merged commit 37b3bbb into master Apr 10, 2025
@twaik twaik deleted the dev/not-use-bsdtar branch April 10, 2025 06:17
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

Successfully merging this pull request may close these issues.

3 participants