corbinlc / gnuroot

152 stars 29 forks source link

errors installing Oracle Java 7 on gnuroot/wheezyx (Galaxy S4) #6

Open drhuffman12 opened 10 years ago

drhuffman12 commented 10 years ago

When trying to install Oracle Java 7 on gnuroot/wheezyx (Galaxy S4) as 'fake root', I get the following errors:

I used the following commands for the install:

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer

The installation output looked like:

...
The following NEW packages will be installed:
  binutils gsfonts gsfonts-x11 java-common locales oracle-java7-installer
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 13.7 MB of archives.
After this operation, 33.4 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.debian.org/debian/ wheezy/main binutils armel 2.22-8 [4550 kB]
Get:2 http://ppa.launchpad.net/webupd8team/java/ubuntu/ precise/main oracle-java7-installer all 7u51-0~webupd8~7 [18.7 kB]
Get:3 http://ftp.debian.org/debian/ wheezy/main java-common all 0.47 [66.1 kB]
Get:4 http://ftp.debian.org/debian/ wheezy/main locales all 2.13-38+deb7u1 [5714 kB]
Get:5 http://ftp.debian.org/debian/ wheezy/main gsfonts all 1:8.11+urwcyr1.0.7~pre44-4.2 [3364 kB]
Get:6 http://ftp.debian.org/debian/ wheezy/main gsfonts-x11 all 0.22 [10.6 kB]
Fetched 13.7 MB in 15s (913 kB/s)
Preconfiguring packages ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Selecting previously unselected package binutils.
(Reading database ... 12247 files and directories currently installed.)
Unpacking binutils (from .../binutils_2.22-8_armel.deb) ...
Selecting previously unselected package java-common.
Unpacking java-common (from .../java-common_0.47_all.deb) ...
Selecting previously unselected package locales.
Unpacking locales (from .../locales_2.13-38+deb7u1_all.deb) ...
Processing triggers for man-db ...
/usr/bin/mandb: can't set effective uid: Permission denied
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up binutils (2.22-8) ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Selecting previously unselected package oracle-java7-installer.
(Reading database ... 13056 files and directories currently installed.)
Unpacking oracle-java7-installer (from .../oracle-java7-installer_7u51-0~webupd8~7_all.deb) ...
dpkg: error processing /var/cache/apt/archives/oracle-java7-installer_7u51-0~webupd8~7_all.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Selecting previously unselected package gsfonts.
Unpacking gsfonts (from .../gsfonts_1%3a8.11+urwcyr1.0.7~pre44-4.2_all.deb) ...
Selecting previously unselected package gsfonts-x11.
Unpacking gsfonts-x11 (from .../gsfonts-x11_0.22_all.deb) ...
Errors were encountered while processing:
 /var/cache/apt/archives/oracle-java7-installer_7u51-0~webupd8~7_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@localhost:/#
drhuffman12 commented 10 years ago

Likewise... errors installing Open Java 7 JRE on gnuroot/wheezyx (Galaxy S4)

When trying to install Open Java 7 JRE on gnuroot/wheezyx (Galaxy S4) as 'fake root', I get the following errors:

...as well as errors in the following apps:

I used the following commands for the install:

apt-get install openjdk-7-jre

The installation output looked like:

...
The following NEW packages will be installed:
  acl ca-certificates ca-certificates-java colord consolekit cpp cpp-4.6
  cryptsetup-bin dbus dbus-x11 dconf-gsettings-backend dconf-service
  desktop-file-utils dmsetup dosfstools eject file fontconfig fuse
  gcc-4.6-base gconf-service gconf2 gconf2-common gnome-mime-data gvfs
  gvfs-common gvfs-daemons gvfs-libs hdparm hicolor-icon-theme
  icedtea-7-jre-cacao icedtea-7-jre-jamvm java-common krb5-locales libaacs0
  libasound2 libasyncns0 libatasmart4 libatk-wrapper-java
  libatk-wrapper-java-jni libatk1.0-0 libatk1.0-data libavahi-client3
  libavahi-common-data libavahi-common3 libavahi-glib1 libbluray1
  libbonobo2-0 libbonobo2-common libcairo-gobject2 libcairo2 libcanberra0
  libcap2 libck-connector0 libcolord1 libcryptsetup4 libcups2 libdatrie1
  libdbus-1-3 libdbus-glib-1-2 libdconf0 libdevmapper-event1.02.1
  libdevmapper1.02.1 libexif12 libfam0 libffi5 libfile-copy-recursive-perl
  libflac8 libfuse2 libgconf-2-4 libgconf2-4 libgd2-xpm libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-common libgdu0 libgif4 libglib2.0-0 libglib2.0-data
  libgmp10 libgnome-keyring-common libgnome-keyring0 libgnome2-0
  libgnome2-common libgnomevfs2-0 libgnomevfs2-common libgnomevfs2-extra
  libgphoto2-2 libgphoto2-l10n libgphoto2-port0 libgssapi-krb5-2 libgtk-3-0
  libgtk-3-bin libgtk-3-common libgtk2.0-0 libgtk2.0-bin libgtk2.0-common
  libgudev-1.0-0 libgusb2 libidl0 libieee1284-3 libjasper1 libjbig0
  libjson0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 liblcms2-2
  libldap-2.4-2 libltdl7 liblvm2app2.2 libmagic1 libmpc2 libmpfr4 libnspr4
  libnss3 libogg0 liborbit2 libpam-ck-connector libpango1.0-0
  libparted0debian1 libpcre3 libpcsclite1 libpixman-1-0 libpng12-0
  libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libpulse0
  libsane libsane-common libsane-extras libsane-extras-common libsasl2-2
  libsasl2-modules libsgutils2-2 libsmbclient libsndfile1 libsystemd-login0
  libtalloc2 libtdb1 libthai-data libthai0 libtiff4 libusb-1.0-0 libv4l-0
  libv4lconvert0 libvorbis0a libvorbisenc2 libvorbisfile3 libwbclient0
  libwrap0 libxcb-render0 libxcb-shm0 libxcursor1 libxml2 mime-support
  module-init-tools ntfs-3g openjdk-7-jre openjdk-7-jre-headless
  openjdk-7-jre-lib openssl policykit-1 policykit-1-gnome powermgmt-base
  psmisc python python-minimal python2.7 python2.7-minimal sane-utils
  sgml-base shared-mime-info tcpd ttf-dejavu-extra tzdata-java udisks
  update-inetd xml-core
0 upgraded, 180 newly installed, 0 to remove and 0 not upgraded.
Need to get 91.7 MB of archives.
After this operation, 308 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
...
done.
Processing triggers for menu ...
Processing triggers for sgml-base ...
Errors were encountered while processing:
 colord
 sane-utils
E: Sub-process /usr/bin/dpkg returned an error code
cedric-vincent commented 10 years ago

@corbinlc , regarding seteuid() issues (#4, #5 and this one), my guess is: either GNURoot uses an old version of PRoot (< v3.1), or the "fake id0" extension doesn't work correctly on ARM.

corbinlc commented 10 years ago

The proot version is 3.2.2 with the link2symlink extension added. The fake id extension obviously works in some regards, because programs like apt-get check if you are user root and only progress if you are. I figured these were limitations of that extension though, as opposed to bugs. I am glad to hear they may be bugs though, because that means many of these issues will get better with some work. Thanks for chiming in. Tell me whatever testing you want done on my end.

cedric-vincent commented 10 years ago

I suspect a bug because these commands works with proot/wheezy on x86. I'll take a look next week.

cedric-vincent commented 10 years ago

I was able to reproduce most of these errors, either on Debian ARM or on my x86_64 workstation.

  1. about errors related to the installation of packages that try to connect to services (colord, sane-utils). Since GNURoot isn't kept alive in the background, there's no point at starting these services, so they have to be disabled 1:
$ proot -b /dev -b /proc -r rootfs -0 sh -x setup.sh
+ dpkg-divert --local --rename --add /usr/sbin/xinetd
+ dpkg-divert --local --rename --add /sbin/initctl
+ dpkg-divert --local --rename --add /usr/bin/dbus-daemon
+ ln -s /bin/true /usr/sbin/xinetd
+ ln -s /bin/true /sbin/initctl
+ ln -s /bin/true /usr/bin/dbus-daemon

@corbinlc, can you add this rootfs setup to GNURoot (Debian & Ubuntu flavors)?

  1. about errors related to set*id (man-db). This is already fixed in the development version of PRoot, thus these errors should disappear once GNURoot moves to PRoot v3.3 (not yet released). Fortunately, errors reported by mandb are not fatal to dpkg.
  2. about errors related to "/dev/pts", I need more information. Please, could anyone send me the output of this command on GNURoot:
ls -l /proc/self/fd
corbinlc commented 10 years ago

Cedric,

Thanks!

With regards to packages that try to connect to services. I can update the roots accordingly to have the dpkg-divert and symbolic links.

With regards to errors related to set*id (man-db). Great! I look forward to the update.

With regards to running: ls -l /proc/self/fd

This is what I get currently...

lrwx------ 1 root root 64 Apr 16 20:04 0 -> /dev/pts/0 l-wx------ 1 root root 64 Apr 16 20:04 1 -> /sdcard/ls.log l-wx------ 1 root root 64 Apr 16 20:04 10 -> /dev/cpuctl/tasks lr-x------ 1 root root 64 Apr 16 20:04 14 -> /system/framework/framework.jar lr-x------ 1 root root 64 Apr 16 20:04 15 -> /system/fonts/DroidSans.ttf lr-x------ 1 root root 64 Apr 16 20:04 16 -> /system/framework/core.jar lr-x------ 1 root root 64 Apr 16 20:04 17 -> /dev/urandom lr-x------ 1 root root 64 Apr 16 20:04 18 -> /system/framework/framework-res.apk lr-x------ 1 root root 64 Apr 16 20:04 19 -> /system/framework/twframework-res.apk lrwx------ 1 root root 64 Apr 16 20:04 2 -> /dev/pts/0 l-wx------ 1 root root 64 Apr 16 20:04 20 -> /dev/cpuctl/bg_non_interactive/tasks lrwx------ 1 root root 64 Apr 16 20:04 22 -> /dev/ashmem lrwx------ 1 root root 64 Apr 16 20:04 23 -> /dev/ashmem lr-x------ 1 root root 64 Apr 16 20:04 24 -> /data/app/champion.gnuroot-1.apk lr-x------ 1 root root 64 Apr 16 20:04 25 -> /data/app/champion.gnuroot-1.apk lr-x------ 1 root root 64 Apr 16 20:04 27 -> /system/fonts/DroidSans-Bold.ttf lrwx------ 1 root root 64 Apr 16 20:04 29 -> /dev/ashmem l-wx------ 1 root root 64 Apr 16 20:04 3 -> /dev/log/main lrwx------ 1 root root 64 Apr 16 20:04 30 -> /dev/ashmem lrwx------ 1 root root 64 Apr 16 20:04 31 -> /dev/ashmem lrwx------ 1 root root 64 Apr 16 20:04 32 -> /dev/pvrsrvkm lrwx------ 1 root root 64 Apr 16 20:04 33 -> /dev/ashmem lrwx------ 1 root root 64 Apr 16 20:04 34 -> /dev/pvrsrvkm lrwx------ 1 root root 64 Apr 16 20:04 35 -> /dev/pts/0 l-wx------ 1 root root 64 Apr 16 20:04 4 -> /dev/log/radio l-wx------ 1 root root 64 Apr 16 20:04 5 -> /dev/log/events l-wx------ 1 root root 64 Apr 16 20:04 6 -> /dev/log/system lr-x------ 1 root root 64 Apr 16 20:04 7 -> /proc/25934/fd lrwx------ 1 root root 64 Apr 16 20:04 9 -> /dev/ashmem

I have one more proot related issue: https://github.com/corbinlc/gnuroot/issues/7

I'd appreciate if you could look at it.

Thanks, Corbin

drhuffman12 commented 10 years ago

Attachment is from running "ls -l /proc/self/fd" from within Wheezyx on my s4.

-Daniel

Sent from Yahoo Mail on Android

total 0 lrwx------. 1 root root 64 Apr 17 09:15 0 -> /dev/pts/0 l-wx------. 1 root root 64 Apr 17 09:15 1 -> /proc.self.f lrwx------. 1 root root 64 Apr 17 09:15 2 -> /dev/pts/0 lr-x------. 1 root root 64 Apr 17 09:15 3 -> /proc/18865/fd lr-x------. 1 root root 64 Apr 17 09:15 36 -> /system/framework/twframework-res.apk lr-x------. 1 root root 64 Apr 17 09:15 37 -> /system/framework/framework.jar l-wx------. 1 root root 64 Apr 17 09:15 38 -> /d/tracing/trace_marker lr-x------. 1 root root 64 Apr 17 09:15 39 -> /system/framework/framework-res.apk lr-x------. 1 root root 64 Apr 17 09:15 40 -> /system/framework/core.jar lr-x------. 1 root root 64 Apr 17 09:15 41 -> pipe:[66905] l-wx------. 1 root root 64 Apr 17 09:15 42 -> pipe:[66905] lrwx------. 1 root root 64 Apr 17 09:15 45 -> anon_inode:[eventpoll] lr-x------. 1 root root 64 Apr 17 09:15 46 -> /data/app/champion.gnuroot-3.apk lrwx------. 1 root root 64 Apr 17 09:15 48 -> /dev/kgsl-3d0 lrwx------. 1 root root 64 Apr 17 09:15 49 -> socket:[66916] lrwx------. 1 root root 64 Apr 17 09:15 50 -> socket:[66919] lr-x------. 1 root root 64 Apr 17 09:15 51 -> /dev/ion lrwx------. 1 root root 64 Apr 17 09:15 52 -> /dev/pts/0 lrwx------. 1 root root 64 Apr 17 09:15 53 -> socket:[65524] lrwx------. 1 root root 64 Apr 17 09:15 54 -> anon_inode:dmabuf lrwx------. 1 root root 64 Apr 17 09:15 55 -> anon_inode:dmabuf lr-x------. 1 root root 64 Apr 17 09:15 56 -> /dev/ion lrwx------. 1 root root 64 Apr 17 09:15 57 -> anon_inode:dmabuf lrwx------. 1 root root 64 Apr 17 09:15 58 -> anon_inode:dmabuf lrwx------. 1 root root 64 Apr 17 09:15 60 -> anon_inode:dmabuf lrwx------. 1 root root 64 Apr 17 09:15 61 -> anon_inode:dmabuf lrwx------. 1 root root 64 Apr 17 09:15 62 -> anon_inode:dmabuf lrwx------. 1 root root 64 Apr 17 09:15 63 -> anon_inode:dmabuf lrwx------. 1 root root 64 Apr 17 09:15 64 -> socket:[69012] lrwx------. 1 root root 64 Apr 17 09:15 65 -> anon_inode:dmabuf lrwx------. 1 root root 64 Apr 17 09:15 66 -> anon_inode:dmabuf lr-x------. 1 root root 64 Apr 17 09:15 9 -> /dev/properties

drhuffman12 commented 10 years ago

"apt-get install sane-utils" errors out on my s4. Below is the end of the install's output:

...
Setting up libsane:armel (1.0.22-7.4) ...
Adding scanner group...
Setting up libsystemd-login0:armel (44-11+deb7u4) ...
Setting up dbus (1.6.8-1+deb7u1) ...
Starting system message bus: dbus.
Setting up libfile-copy-recursive-perl (0.38-1) ...
Setting up libgphoto2-l10n (2.4.14-2) ...
Setting up libsane-extras-common (1.0.22.2) ...
Setting up libsane-extras:armel (1.0.22.2) ...
Setting up update-inetd (4.43) ...
Setting up sane-utils (1.0.22-7.4) ...
Adding saned group and user...
Adding user saned to group scanner
Cannot change ID to root.
adduser: `/usr/bin/gpasswd -a saned scanner' returned error code 1. Exiting.
dpkg: error processing sane-utils (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
sane-utils
E: Sub-process /usr/bin/dpkg returned an error code (1)

-Daniel

Sent from Yahoo Mail on Android

JulieYe commented 9 years ago

any update on fixing this bug?

drhuffman12 commented 9 years ago

As kinda work-around, I can install JDK on Gnuroot Wheezy x86 on an Intel-based Android [e.g.: Dell Venue 7]; see https://gist.github.com/drhuffman12/59c0a355a70feaddca1b#file-gnuroot_wheezy86_to_jessie_jruby. I tried to do likewise for arm-based [e.g.: Samsung Galaxy S4], but couldn't get it working; see https://gist.github.com/drhuffman12/f2a72870fe32c39cb913#file-gnuroot_wheezyx_to_jessie_jruby.

corbinlc commented 9 years ago

Sorry it has been so long. Can you update to the latest gnuroot and gnuroot wheezy (or wheezyX or wheezy x86, based on your needs) test apks found here: https://www.dropbox.com/sh/xjbg1z49ur3t5b6/AAAoBzmCK3A27Sk9DZAeolLla?dl=0 This uses proot v5.0. Can you then try again and tell me what you see?

drhuffman12 commented 9 years ago

Using the patchess found here: "

https://www.dropbox.com/sh/xjbg1z49ur3t5b6/AAAoBzmCK3A27Sk9DZAeolLla?dl=0",

I get errors when trying to install Oracle JDK 7 or 8 on S4. See attached 'sh' and 'log' files. ...having trouble attaching files....

Thanks,

Daniel Huffman drhuffman12@yahoo.com

drhuffman12 commented 9 years ago

However, the following does work for installing OpenJDK 7:

apt-get install python-software-properties -y --fix-missing
add-apt-repository ppa:openjdk-r/ppa
apt-get update -y --fix-missing
apt-get upgrade -y --fix-missing
apt-get autoremove -y
apt-get remove -y
apt-get clean -y

apt-get install openjdk-7-jdk -y --fix-missing

java -version

... gives me:

java version "1.7.0_03"
OpenJDK Runtime Environment (IcedTea7 2.1.7) (7u3-2.1.7-1)
OpenJDK Zero VM (build 22.0-b10, mixed mode)
tapirbait commented 9 years ago

Hi, I want to bring in some information about java7 on wheezy (not wheezyX)

Installing with apt-get install openjdk-7-jre-headless worked for me. But when I want to run:

root@localhost:/# java -version
/usr/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

That lib is /usr/lib/jvm/java-7-openjdk-armel/jre/lib/arm/jli/libjli.so Setting LD_LIBRARY_PATH did not help. It only works when I run with the full path:

# /usr/lib/jvm/java-7-openjdk-armel/jre/bin/java -version
java version "1.7.0_03"
OpenJDK Runtime Environment (IcedTea7 2.1.7) (7u3-2.1.7-1)
OpenJDK Zero VM (build 22.0-b10, mixed mode)

The rpath in the java elf binary is $ORIGIN/../lib/arm/jli:$ORIGIN/../jre/lib/arm/jli:$ORIGIN/../lib/arm:$ORIGIN/../jre/lib/arm Substituting the actual java binary directory for $origin leads to a search path, where libjli.so can be found. But it seems the android elf loader does not follow the link chain /usr/bin/java -> /etc/alternatives/java -> /usr/lib/jvm/java-7-openjdk-armel/jre/bin/java when processing the rpath.

Now shell scripts and makefiles running java don't work properly. Does anyone know an elegant way to fix this?