Posts: 248 | Thanked: 1,142 times | Joined on Dec 2014 @ Earth
#191
Originally Posted by Kabouik View Post
What would be the best way to use Arch chroot from the SD card (ext4) on a Jolla C instead of /opt/easychroot/Arch?
My past job was around deploying chroots (for scientific software on a clusters)

- tar -xvf ArchRootfsFile.tar.gz /media/sdcard/XXX/easychroot/Arch/ (as nemo or as root by the way?)
As root (unless the chroot doc specifies otherwise).
I don't know the specific details of *that* chroot, but most of the time it requires some specific access rights (e.g.: a different owner user:group) and you need root rights to set those, otherwise tar will complain that it cannot change the rights to the untarred files .


Alter ArchChroot.sh and DeskChroot.sh to use this path in all mount points instead of /opt/easychroot/Arch/
Good idea, but won't necessarily work :

- some will just call "chroot" to start the environment inside a new path name space (i.e.: the will see the content of the tar as "/usr/lib64" instead of "/opt/easychroot/Arch/usr/lib64")
that is simply a change as you mention.

- some chroot might entirely rely on environment variables, like "LD_LIBRARY_PATH" to indicate where to fetch the .so dynamic libraries (e.g.: "/opt/easychroot/Arch/lib64" instead of "/usr/lib64")

- but other my use Rpaths : search patch directly set inside an elf executable. (i.e.: the files in "/opt/easychroot/Arch/bin" are designed to search first in "/opt/easychroot/Arch/lib64". If the libraries are instead in "/media/sdcard/XXX/easychroot/Arch/lib64", the executable will miss them and default to the next search path which will lead to the Phone's own /usr/lib64, which won't contain what you need).

I'll have to check exactly how the archive work.

Usually debian works like the first case above. (it's basically a regular "/ust" debian tree, put into a different path that you "chroot" into).

Gentoo works using a mix of the other 2 solution (it's basically gentoo, but recompiled to work out of a sub-directory instead of /usr).

The best would be to head for your solution B :

mount /media/sdcard/XXX/easychroot/ /opt/easychroot/
Bind mounting could work.

But you could as well put a symlink :
Code:
ln -s /media/sdcard/XXX/easychroot /opt/
Both should work equally well.

And both work regardless of how the Arch chroot is organised.

mount -o remount,exec /media/sdcard/XXX[/I]
Yes, it is needed.
By default, the mount script ( /usr/sbin/sd-mount ) uses noexec.
 

The Following 6 Users Say Thank You to DrYak For This Useful Post:
Posts: 1,335 | Thanked: 3,931 times | Joined on Jul 2010 @ Brittany, France
#192
Thanks to both of you for your detailed answers. I was concerned about # B because there was some kind of mount loop and I was afraid it would end up in . The symlink seems like a good alternative. I thought about it but never remember in which order to put the source and destination arguments.

Can I put the following line at the beginning of DeskChroot.sh?

Code:
mount -o remount,exec /media/sdcard/XXX
Are there any side effects to expect, for the other files stored on my SD card (all my android_storage for instance, the rest is mostly just documents)?

Also, I suppose my issues with /etc/sudoers and sudoers.so was related to the fact that I unpacked the .tar.gz as nemo. I'll do it again as root.

Last edited by Kabouik; 2017-08-03 at 21:24.
 

The Following 2 Users Say Thank You to Kabouik For This Useful Post:
Posts: 1,335 | Thanked: 3,931 times | Joined on Jul 2010 @ Brittany, France
#193
So I fixed the typo Jukk reported, and then tried # B. Unfortunately, I can't get xfce running using solution # B, either with a symlink or a mount point to /opt/, while it did work yesterday when I tried with # A. However, several things were different, as I also had unpacked the .tar.gz as nemo, and had to solve several things manually after that, so I'm not exactly sure how to replicate and identify the exact source of the problem now. I did not try it extensively either yesterday so I don't know if it was fully working with # A, probably not, but at least a window was launched, as opposed to now. Maybe the issue I'm having now is not even related to # A or # B, but to the rootfs being unpacked as nemo?

This is the output of what I tried (with a symlink):

Code:
[root@Sailfish nemo]# ln -s /media/sdcard/2d4ffa5e-6ead-48da-bdd6-ce1c5a775849/easychroot /opt/
[root@Sailfish nemo]# mount -o remount,exec /media/sdcard/2d4ffa5e-6ead-48da-bdd6-ce1c5a775849
[root@Sailfish nemo]# sh /media/sdcard/2d4ffa5e-6ead-48da-bdd6-ce1c5a775849/easychroot/DeskChrootOrig.sh 1268 720 startxfce4
mount: mount point /opt/easychroot/Arch/home/nemo/real_home does not exist
mount: mount point /opt/easychroot/Arch/home/nemo/Downloads does not exist
mount: mount point /opt/easychroot/Arch/home/nemo/android_storage does not exist
mount: mount point /opt/easychroot/Arch/home/nemo/Music does not exist
mount: mount point /opt/easychroot/Arch/home/nemo/Videos does not exist
mount: mount point /opt/easychroot/Arch/home/nemo/Pictures does not exist
mount: mount point /opt/easychroot/Arch/home/nemo/Documents does not exist
rm: cannot remove '/run/user/100000/wayland-0.lock': No such file or directory
declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/100000/dbus/user_bus_socket"
declare -x EGL_DRIVER="egl_gallium"
declare -x EGL_PLATFORM="wayland"
declare -x FF_MEMLESS_SETTINGS="/usr/lib/qt5/plugins/feedback/qtfeedback-l500d.ini"
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTCONTROL="ignoredups"
declare -x HISTSIZE="1000"
declare -x HOME="/root"
declare -x HOSTNAME=""
declare -x LOGNAME="nemo"
declare -x LS_COLORS="no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:"
declare -x OLDPWD
declare -x PATH="/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/nemo/bin"
declare -x PWD="/"
declare -x QMLSCENE_DEVICE="customcontext"
declare -x QML_FIXED_ANIMATION_STEP="no"
declare -x QSG_FIXED_ANIMATION_STEP="no"
declare -x QT_DF_BASE="0.5"
declare -x QT_DF_BASEDEVIATION="0.025"
declare -x QT_DF_RANGE="0.08"
declare -x QT_DF_SCALEFORMAXDEV="0.37"
declare -x QT_DF_SCALEFORNODEV="0.6"
declare -x QT_GSTREAMER_CAMERABIN_FLAGS="15"
declare -x QT_GSTREAMER_CAMERABIN_SRC="droidcamsrc"
declare -x QT_GSTREAMER_PLAYBIN_FLAGS="0"
declare -x QT_IM_MODULE="Maliit"
declare -x QT_MESSAGE_PATTERN="[%{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif}] %{function}:%{line} - %{message}"
declare -x QT_QPA_PLATFORM="wayland"
declare -x QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
declare -x QT_WAYLAND_FORCE_DPI="96"
declare -x QT_WAYLAND_RESIZE_AFTER_SWAP="1"
declare -x SHELL="/bin/bash"
declare -x SHLVL="4"
declare -x SSH_CLIENT="10.0.0.8 50672 22"
declare -x SSH_CONNECTION="10.0.0.8 50672 10.0.0.114 22"
declare -x SSH_TTY="/dev/pts/0"
declare -x TERM="xterm"
declare -x USER="root"
declare -x WAYLAND_DISPLAY="../../display/wayland-0"
declare -x XDG_RUNTIME_DIR="/run/user/100000"
/usr/share/easychroot/scripts/start_xwayland_user_shell.sh: line 15:  7141 Segmentation fault      kwin_wayland --xwayland --height "$Height" --width "$Width"
xhost:  unable to open display ":0"
declare -x DISPLAY=":0"
declare -x HOME="/home/nemo"
declare -x HOSTNAME=""
declare -x LOGNAME="nemo"
declare -x LS_COLORS="no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:"
declare -x MAIL="/var/mail/nemo"
declare -x OLDPWD
declare -x PATH="/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/nemo/bin"
declare -x PWD="/"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SUDO_COMMAND="/sbin/bash /usr/share/easychroot/scripts/start_de.sh startxfce4"
declare -x SUDO_GID="0"
declare -x SUDO_UID="0"
declare -x SUDO_USER="root"
declare -x TERM="xterm"
declare -x USER="nemo"
declare -x USERNAME="nemo"
declare -x XDG_RUNTIME_DIR="/run/user/100000"
/sbin/startxfce4: X server already running on display :0
xrdb: Bad file descriptor
xrdb: Can't open display ':0'
/etc/X11/xinit/xinitrc.d/50-systemd-user.sh: line 3:  7201 Segmentation fault      systemctl --user import-environment DISPLAY XAUTHORITY
/etc/X11/xinit/xinitrc.d/50-systemd-user.sh: line 7:  7204 Segmentation fault      dbus-update-activation-environment DISPLAY XAUTHORITY
/etc/xdg/xfce4/xinitrc: line 121:  7206 Segmentation fault      xfce4-session
[root@Sailfish nemo]#
DeskChrootOrig.sh is the original script from Preflex's github repository with the unaltered paths.

Any ideas?

Last edited by Kabouik; 2017-08-04 at 01:37.
 

The Following 2 Users Say Thank You to Kabouik For This Useful Post:
Posts: 81 | Thanked: 342 times | Joined on Jul 2012 @ Finland
#194
You need to check that the directories exist before mounting. And after chrooting, check that it looks like you are inside the correct environment (should look like normal arch linux filesystem in this case). I recommend ssh:ing to the device and configure mounting and chrooting everything that way (much more easy to handle terminal from a PC). Of course starting xwayland and xfce must be done on the device itself, so you need to also to chroot on the device before doing that (mounting is only required once).

The easiest thing to do is to put the image where you want and then correct the paths in the script. There is no reason in this case to keep the exact paths as written in the original script. The only reason I see for that in some other case, is if you have some external software managing chroots, which at least I don't have on the Jolla device. Or if the images are specially built (not like copies of a normal linux system).

DrYak's instructions may apply when you have custom chroot images (maybe built from the host system), but in this case we have a normal Arch filesystem inside a tar. It would be the same as when you have a linux system on a hard disk that is currently unbootable and you use a rescue image (USB/CD) to boot and then mount the hard disk in a temporary directory, bind mount proc, sys, dev, etc. and then chroot into it and do the resuce operations. I've done this many, many times. Once in a chroot in such an image, it works just like a normal linux environment and no need to mess around with any libraries etc.
 

The Following 4 Users Say Thank You to jukk For This Useful Post:
Posts: 1,335 | Thanked: 3,931 times | Joined on Jul 2010 @ Brittany, France
#195
I don't think the missing directories in /home/nemo are not the real issue, they were already missing when I got xfce4 to start the other day.

Alright for the paths, then if there is no need to keep them as in Preflex's original file, I'll just use my altered script with the sd card path. However the same problem persists: I get these segmentation faults at the end and xrdb errors. I have no idea what they mean unfortunately, I'm not familiar with that. The only things that changed is that I untared the rootfs as root instead of nemo this time (and eventually did not have to fix uid 0 issues), and I fixed the typo in start_xwayland_user_shell.sh. Since you all said the .tar.gz should not be unpacked as nemo, I'm guessing you did it as root and got it working.

I am sshing no worries! You can see it in the terminal output I pasted above. Are you sure that starting xwayland and xfce cannot be started from ssh as well? I don't understand why it would be different, and in fact I'm almost sure I did it from ssh when I managed to get Arch and Xfce running correctly.

Last edited by Kabouik; 2017-08-04 at 14:57.
 

The Following User Says Thank You to Kabouik For This Useful Post:
Posts: 1,335 | Thanked: 3,931 times | Joined on Jul 2010 @ Brittany, France
#196
I confirm having the same issue after creating the missing /home/nemo folders with nemo:nemo ownership and running a DeskChroot.sh with /path/to/sdcard/easychroot instead of /opt/easychroot in the mount commands:

Code:
[nemo@Sailfish ~]$ devel-su
Password:
[root@Sailfish nemo]# mount -o remount,exec /media/sdcard/2d4ffa5e-6ead-48da-bdd6-ce1c5a775849
[root@Sailfish nemo]# sh /media/sdcard/2d4ffa5e-6ead-48da-bdd6-ce1c5a775849/easychroot/DeskChroot.sh 1268 720 startxfce4
rm: cannot remove '/run/user/100000/wayland-0.lock': No such file or directory
declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/100000/dbus/user_bus_socket"
declare -x EGL_DRIVER="egl_gallium"
declare -x EGL_PLATFORM="wayland"
declare -x FF_MEMLESS_SETTINGS="/usr/lib/qt5/plugins/feedback/qtfeedback-l500d.ini"
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTCONTROL="ignoredups"
declare -x HISTSIZE="1000"
declare -x HOME="/root"
declare -x HOSTNAME=""
declare -x LOGNAME="nemo"
declare -x LS_COLORS="no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:"
declare -x OLDPWD
declare -x PATH="/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/nemo/bin"
declare -x PWD="/"
declare -x QMLSCENE_DEVICE="customcontext"
declare -x QML_FIXED_ANIMATION_STEP="no"
declare -x QSG_FIXED_ANIMATION_STEP="no"
declare -x QT_DF_BASE="0.5"
declare -x QT_DF_BASEDEVIATION="0.025"
declare -x QT_DF_RANGE="0.08"
declare -x QT_DF_SCALEFORMAXDEV="0.37"
declare -x QT_DF_SCALEFORNODEV="0.6"
declare -x QT_GSTREAMER_CAMERABIN_FLAGS="15"
declare -x QT_GSTREAMER_CAMERABIN_SRC="droidcamsrc"
declare -x QT_GSTREAMER_PLAYBIN_FLAGS="0"
declare -x QT_IM_MODULE="Maliit"
declare -x QT_MESSAGE_PATTERN="[%{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif}] %{function}:%{line} - %{message}"
declare -x QT_QPA_PLATFORM="wayland"
declare -x QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
declare -x QT_WAYLAND_FORCE_DPI="96"
declare -x QT_WAYLAND_RESIZE_AFTER_SWAP="1"
declare -x SHELL="/bin/bash"
declare -x SHLVL="4"
declare -x SSH_CLIENT="10.0.0.8 50734 22"
declare -x SSH_CONNECTION="10.0.0.8 50734 10.0.0.114 22"
declare -x SSH_TTY="/dev/pts/0"
declare -x TERM="xterm"
declare -x USER="root"
declare -x WAYLAND_DISPLAY="../../display/wayland-0"
declare -x XDG_RUNTIME_DIR="/run/user/100000"
/usr/share/easychroot/scripts/start_xwayland_user_shell.sh: line 15:  7220 Segmentation fault      kwin_wayland --xwayland --height "$Height" --width "$Width"
xhost:  unable to open display ":0"
declare -x DISPLAY=":0"
declare -x HOME="/home/nemo"
declare -x HOSTNAME=""
declare -x LOGNAME="nemo"
declare -x LS_COLORS="no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:"
declare -x MAIL="/var/mail/nemo"
declare -x OLDPWD
declare -x PATH="/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/nemo/bin"
declare -x PWD="/"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SUDO_COMMAND="/sbin/bash /usr/share/easychroot/scripts/start_de.sh startxfce4"
declare -x SUDO_GID="0"
declare -x SUDO_UID="0"
declare -x SUDO_USER="root"
declare -x TERM="xterm"
declare -x USER="nemo"
declare -x USERNAME="nemo"
declare -x XDG_RUNTIME_DIR="/run/user/100000"
/sbin/startxfce4: X server already running on display :0
xrdb: Bad file descriptor
xrdb: Can't open display ':0'
/etc/X11/xinit/xinitrc.d/50-systemd-user.sh: line 3:  7351 Segmentation fault      systemctl --user import-environment DISPLAY XAUTHORITY
/etc/X11/xinit/xinitrc.d/50-systemd-user.sh: line 7:  7353 Segmentation fault      dbus-update-activation-environment DISPLAY XAUTHORITY
/etc/xdg/xfce4/xinitrc: line 121:  7355 Segmentation fault      xfce4-session
[root@Sailfish nemo]#
 

The Following User Says Thank You to Kabouik For This Useful Post:
Posts: 81 | Thanked: 342 times | Joined on Jul 2012 @ Finland
#197
Whenever shell scripts are failing and you don't know why, run all of the commands step by step in terminal. Now it looks like it is crashing when launching kwin_wayland, but you will see it better if doing it manually. Maybe some packages are missing from the image?
 

The Following 3 Users Say Thank You to jukk For This Useful Post:
Posts: 1,335 | Thanked: 3,931 times | Joined on Jul 2010 @ Brittany, France
#198
Thanks Jukk. In fact I did, sorry if I did not tear it down from the beginning, but I still get the same error without much more details than what you already understood from the full output above:

Mounting is not the issue, chrooting in Arch is no issue either, but issues appear when start_xwayland_user_shell.sh is started:

Code:
[root@Sailfish scripts]# rm /run/user/100000/wayland-0.lock
rm: cannot remove '/run/user/100000/wayland-0.lock': No such file or directory
But I suppose it's nothing, probably just due to the fact that it never worked before in this rootfs (remember that I deleted the one I unpacked as nemo and unpacked a new one as root) so there is no .lock file to delete in Arch's system.

Code:
[root@Sailfish scripts]# kwin_wayland --xwayland --height 1268 --width 720 &
[1] 11469
Kinda works I guess since there's an output (not sure this is the expected output though?), but regardless of the next command to be executed (could be something as simple as ls or pwd), a segmentation fault will appear. In fact, the segmentation fault comes with this kwin_wayland command, but only appears in the next command due to the & at the end. Without the &, I just get the segmentation fault without the 11469 output.

From there, and until this issue is solved, I'm not sure it makes much sense to further investigate the next commands in the script (export DISPLAY=:0, then xhost +, then sudo -u nemo bash /usr/share/easychroot/scripts/start_de.sh "$Start_DE") as they are probably influenced by this error.

Is kwin_wayland causing a segmentation fault for you too guys? Maybe someone using a Jolla C as well, or at least an ARM device?

Last edited by Kabouik; 2017-08-04 at 23:37.
 

The Following 2 Users Say Thank You to Kabouik For This Useful Post:
Posts: 1,335 | Thanked: 3,931 times | Joined on Jul 2010 @ Brittany, France
#199
Bump! Any ideas? I'd like to make it work, I have a use for some desktop applications, and I think functional chroot will be very convenient when Chen's phone becomes a real thing (if we manage to rotate the chroot display into landscape).
 

The Following 2 Users Say Thank You to Kabouik For This Useful Post:
Posts: 29 | Thanked: 126 times | Joined on Feb 2013
#200
When you run kwin_wayland --xwayland... do you see a window?
Perhaps it would help to use a different OS base for the chroot. Debian has lots of ARM packages..
You could also use the android runtime and use xserver xsdl as a workaround.
 

The Following 3 Users Say Thank You to one_with_linux For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 13:36.