We have moved to a new Sailfish OS Forum. Please start new discussions there.
0

How to run command from recovery mode ? [answered]

asked 2016-07-22 16:15:02 +0200

Schturman gravatar image

updated 2016-07-22 22:19:50 +0200

Hi.
After updating to 2.0.3.11 I started to install patches, it was no errors at all. But probably one of lockscreen patches did something and after lipstick restart I see only clean and beautiful ambience image :D No lockcode, no status bar, nothing. I can't access to the phone and sadly to say wifi connection was disabled before (can't ssh and restore changes).
I successfully connected to Recovery (0.3.1), choose option 4 to start shell, but now I probably need to mount fs because when I run command to revert patch, I get this message:

[OK] Code accepted.
/ # /usr/share/unapply-all-patches.sh
sh: /usr/share/unapply-all-patches.sh: not found
/ #

after /usr it can't auto-complete other folders (/share etc..). It doesn't see nothing, except:

/ # ls -l /usr/
drwxr-xr-x    2 0        0                0 Jun 16 09:12 bin
drwxr-xr-x    2 0        0                0 Jun 16 09:12 lib
drwxr-xr-x    2 0        0                0 Jun 16 09:12 sbin
/ #


PLEASE, can someone explain me what I need write after access, that will allow me to run my command ?
Thanks

Ok. Here I found how to mount it (https://together.jolla.com/question/22079/howto-all-computer-users-recover-or-reset-a-device-that-is-stuck-in-boot-loop/?sort=votes&page=1).

 mkdir /mnt/rootfs
 mkdir /mnt/sd
 mount /dev/mmcblk0p28 /mnt/rootfs
 mount /dev/mmcblk1p1 /mnt/sd

Now chroot to this:

chroot /mnt/rootfs

now you should "be" in your normal sailfish file system and should be able to run your script
To unmount, just run this commands:

umount /mnt/rootfs
umount /mnt/sd

Thanks to @till :)
Problem solved!

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by olf
close date 2019-10-22 15:49:57.498613

Comments

The correct way to close an answered question is to mark the answer as accepted, click on "close" and select "the question was answered, an answer was accepted".

Sthocs ( 2016-07-22 18:19:50 +0200 )edit

Thanks, done...

Schturman ( 2016-07-22 22:20:11 +0200 )edit

3 Answers

Sort by » oldest newest most voted
4

answered 2016-07-22 16:26:34 +0200

till gravatar image

updated 2016-07-22 16:31:17 +0200

recovery mode is not the normal sailfish file system, you have to mount that first indeed.

what I've done (from memory, might have forgotten something) in such a situation was:

1) mount /dev/mmcblk0p28 to somewhere, for example /mnt:

mount /dev/mmcblk0p28 /mnt

2) bind-mount /dev, /proc, /run,/sys into /mnt:

mount -o bind /dev /mnt/dev
...
mount -o bind /sys /mnt/sys

3) chroot into /mnt:

chroot /mnt

now you should "be" in your normal sailfish file system and should be able to run your script

Be careful, you might brick your device/loose data if you do such things, and check what the commands do in advance

edit flag offensive delete publish link more

Comments

Thanks, I updated my question (already found), but can you tell me if I need umount when I'll done ? If yes, what the correct command ?
Thanks

Schturman ( 2016-07-22 16:35:15 +0200 )edit

you can unmount with

umount /mnt

but if you perform a reboot, that's not neccessary

till ( 2016-07-22 16:40:40 +0200 )edit
1

Thank you, very much! All is done and phone returned to life :D

Schturman ( 2016-07-22 16:45:36 +0200 )edit
2

answered 2017-04-23 19:08:26 +0200

Schturman gravatar image

Hi to all...
Sorry for reopen, but I have a question... How I can access to /home/nemo?
After " chroot /rootfs" I can see only empty /home directory...
And another question is it possible to be a user (nemo) in shell ? after "chroot /rootfs". If yes, how ?
Thanks

edit flag offensive delete publish link more

Comments

3

it depends on device model. on jolla 1 you need to mount btrfs subvolume, on jolla c and tablet you need to mount home partition from lvm.

coderus ( 2017-04-23 19:17:08 +0200 )edit

Thanks
Please, can you provide a full/correct command like "mount /dev/mmcblk0p28 /mnt/rootfs" for both types of devices (Jolla1 and C/tablet) ?

Schturman ( 2017-04-23 19:56:09 +0200 )edit
3

jor Jolla 1 you do:

mount -o subvolid=0 /dev/mmcblk0p28 /mnt

For Jolla C do:

mount /dev/sailfish/home /homefs
coderus ( 2017-04-23 20:11:55 +0200 )edit

Thank you very much!
Now I can see my files in nemo dir, but I still can't use dconf commands like read or reset specific dconf key... I get errors like this:
/homefs/@/root/rpmbuild # dconf read /desktop/lipstick/jollastyle/notifier1
sh: dconf: not found
/homefs/@/root/rpmbuild # su -l nemo -c "dconf read /desktop/lipstick/jollastyle/notifier1"
su: unknown user nemo
/homefs/@/root/rpmbuild #

Any idea ?

Schturman ( 2017-04-23 20:49:29 +0200 )edit
2

dconf will not work until you boot sailfishos

coderus ( 2017-04-24 10:04:01 +0200 )edit
0

answered 2016-07-23 04:43:55 +0200

Schturman gravatar image

Sorry, but I should reopen this question...
I'm trying to do the same on Jolla tablet, but when I trying to mount, I get this error:

 # mkdir /mnt/rootfs
/ # mount /dev/mmcblk0p28 /mnt/rootfs
mount: mounting /dev/mmcblk0p28 on /mnt/rootfs failed: No such file or directory
/ #

Probably on tablet it's a different... Can someone tell me what the correct command for mounting rootfs and sd on Jolla tabet ?
Thanks

edit flag offensive delete publish link more

Comments

Find answer by my self... After choosing Shell, I can directly run:
chroot /rootfs
:)

Schturman ( 2016-07-23 04:59:58 +0200 )edit

Question tools

Follow
5 followers

Stats

Asked: 2016-07-22 16:15:02 +0200

Seen: 1,920 times

Last updated: Apr 23 '17