maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   additional swap file (https://talk.maemo.org/showthread.php?t=86752)

chenliangchen 2013-02-01 21:03

Re: additional swap file
 
@rainisto I have open mode, opensh installed, reflashed my device, but I still can't get the proper output of
accli -I |grep tcb-sign

What is the problem? Thank you!

BTW, does this trick apply for 512mb N950 as well?
-----------------------------------------------------

login as: root
root@192.168.1.195's password:


BusyBox v1.20.0.git (MeeGo 3:1.20-0.2+0m8) built-in shell (ash)
Enter 'help' for a list of built-in commands.

RM680-21-3_PR_RM680:~# devel-su


BusyBox v1.20.0.git (MeeGo 3:1.20-0.2+0m8) built-in shell (ash)
Enter 'help' for a list of built-in commands.

RM680-21-3_PR_RM680:~# opensh


BusyBox v1.20.0.git (MeeGo 3:1.20-0.2+0m8) built-in shell (ash)
Enter 'help' for a list of built-in commands.

RM680-21-3_PR_RM680:~# accli -I |grep tcb-sign
RM680-21-3_PR_RM680:~#

TMavica 2013-02-01 22:33

Try use inception

chenliangchen 2013-02-01 23:11

Re: additional swap file
 
Quote:

Originally Posted by TMavica (Post 1319994)
Try use inception

I have incepted already, shall I use ariadne sh?

coderus 2013-02-01 23:25

Re: additional swap file
 
yes you should use ariadne sh or incept opensh. regular opensh installation doesnt grant required credentials.

TMavica 2013-02-02 00:17

Use ariadne sh is ok

chenliangchen 2013-02-02 02:31

Re: additional swap file
 
Success!! Thank everyone helped here! :) This is great!

Storm_11 2013-02-02 06:32

Re: additional swap file
 
just done the mod myself. Got a heart attack when the phone restarted when I inserted this command:

validator-init; aegis-loader;echo 1 > /sys/kernel/security/validator/flush

It first said validator-init not found. Before I could add the /usr directory for validator, the phone restarted. Reading about the malf's got me a bit concerned (reflashed too many times already), but it started, and dropcache shows the extra swap size, as does the free command. So far slight improvement in speed.

Akkumaru 2013-02-02 10:44

Re: additional swap file
 
Storm, I got that message too. Nothing weird has happened thoug :)

rainisto 2013-02-02 10:58

Re: additional swap file
 
Quote:

Originally Posted by chenliangchen (Post 1319977)
@rainisto I have open mode, opensh installed, reflashed my device, but I still can't get the proper output of
accli -I |grep tcb-sign

Did you remember to install opensh with right command?

# AEGIS_FIXED_ORIGIN=com.nokia.maemo dpkg -i opensh*.deb

patlak 2013-02-05 16:43

Re: additional swap file
 
Where did the tutorial go? Also, to make it complete, provide steps to reverse the procedure.

Eminem 2013-02-05 20:45

Re: additional swap file
 
I get this error message. Any thoughts?

RM696-21-3_PR_001:~# cp /etc/init/enable-swap.conf /tmp/enable-swap.conf
cp: can't open '/etc/init/enable-swap.conf': Permission denied

rainisto 2013-02-05 21:54

Re: additional swap file
 
Quote:

Originally Posted by Eminem (Post 1320997)
I get this error message. Any thoughts?

RM696-21-3_PR_001:~# cp /etc/init/enable-swap.conf /tmp/enable-swap.conf
cp: can't open '/etc/init/enable-swap.conf': Permission denied

That only happens if you have not followed the instructions to the letter, since it will always return permission denied if you have edited that file and before aegis refhashlist is happy about the new signature.

Eminem 2013-02-05 22:08

Re: additional swap file
 
Quote:

Originally Posted by rainisto (Post 1321015)
That only happens if you have not followed the instructions to the letter, since it will always return permission denied if you have edited that file and before aegis refhashlist is happy about the new signature.

Fixable or reflash?

rainisto 2013-02-05 22:12

Re: additional swap file
 
its fixable if you still have opensh shell open with tcb-sign rights and matching enable-swap.conf file in filesystem ie /tmp/ that you can read sha1sum from, if not then its a reflash.

ladoga 2013-02-07 15:42

Re: additional swap file
 
@Eminem

I fixed something like this (different file, but the same problem) after I had ariadne shell closed and had malf warning popping up on my screen.

I used aegisctl to enter permissive mode, edited the file back to what it was and used ageisctl to return to developer mode. Then IIRC I ran devel-su, ariadne sh and finally validator-init, aegis-loader and echo 1 > /sys/kernel/security/validator/flush after which the device returned to normal state and works fine till today.

Details are bit fuzzy in my head, so I'm not 100% sure about exact steps I took, but if you have no other options you might try something along those lines as last resort. Idea is to have the file in a state that it was, when refhashlist was last succesfully updated.

PS. If reflash is your only option and you want to avoid playing with refhashlist in the future I suggest you to flash to open mode.

Eminem 2013-02-07 21:06

Re: additional swap file
 
Quote:

Originally Posted by ladoga (Post 1321416)
@Eminem

I fixed ....

Reflashed it and did it right this time. :)

branja 2013-02-09 18:30

Re: additional swap file
 
Is there any way that someone could explain the whole process in a totally noobie (and I mean toooootally noobie) way or write some scripts that could do that process with one click?!

please... ^^

baboo 2013-02-09 18:51

Re: additional swap file
 
how can we incept opensh without a .deb package ?

kumary 2013-02-09 18:57

Re: additional swap file
 
Quote:

Originally Posted by branja (Post 1322042)
Is there any way that someone could explain the whole process in a totally noobie (and I mean toooootally noobie) way or write some scripts that could do that process with one click?!

please... ^^

I have written a complete guide for noobies (I am also one of them) but its in .docx format and contain few link to direct download software as well.. I have posted it here however it has been removed as it must have break any rule of the forum :confused:

Can anyone suggest how I can best post that guide here, without breaking the forum rules. I am happy to make changes to guide.

Cheers

Quote:

Originally Posted by baboo (Post 1322048)
how can we incept opensh without a .deb package ?

If you have inception installed then you need not to install opensh instead try "ariadne sh" as both of these are same thing and give same result.

Cheers

ladoga 2013-02-10 05:54

Re: additional swap file
 
If you use patched openmode you can just edit /etc/init/enable-swap.conf and be done with it. No additional steps needed.

If you have incepted device and are unsure about following Rainisto's step by step instruction you probably shouldn't even try it. (or atleast be aware that one typo or logging out of shell between the steps is very likely to malf your N9 and require a reflash.) Similarly if you don't have a clear idea why you are doing this, (no it won't speed up things noticeably/at all unless you have something already hogging up most of your RAM.) then don't do it.

Boxeri 2013-02-12 14:25

Re: additional swap file
 
Hmm, everything seems to be working alright with my phone, but are my "swap" columns are not supposed to be showing zero, right?

From the few examples that people posted and what my other phone's "free" command I get the feeling that something went wrong. I did get a MALF warning but after that everything has worked normally

BusyBox v1.20.0.git (MeeGo 3:1.20-0.2+0m8) built-in shell (ash)
Enter 'help' for a list of built-in commands.

Code:

~ $ free
            total        used        free      shared      buffers
Mem:      1008648      708512      300136            0        25688
-/+ buffers:            682824      325824
Swap:            0            0            0
~ $


thedead1440 2013-02-12 14:34

Re: additional swap file
 
Boxeri,

Seems like you didn't do the procedure correctly; do it over SSH in opensh again and it should be fine...

Boxeri 2013-02-12 14:50

Re: additional swap file
 
Yes, i was already also able to locate my error. Have to reflash, but it is ok, as this is my learning/practice device. Is nano the best to edit the lines?

thedead1440 2013-02-12 14:54

Re: additional swap file
 
Quote:

Originally Posted by Boxeri (Post 1322652)
Yes, i was already also able to locate my error. Have to reflash, but it is ok, as this is my learning/practice device. Is nano the best to edit the lines?

Nano is the easiest if you are not familiar with vi

death_jax 2013-02-18 09:54

Re: additional swap file
 
Quote:

Originally Posted by Boxeri (Post 1322641)
Hmm, everything seems to be working alright with my phone, but are my "swap" columns are not supposed to be showing zero, right?

From the few examples that people posted and what my other phone's "free" command I get the feeling that something went wrong. I did get a MALF warning but after that everything has worked normally

BusyBox v1.20.0.git (MeeGo 3:1.20-0.2+0m8) built-in shell (ash)
Enter 'help' for a list of built-in commands.

Code:

~ $ free
            total        used        free      shared      buffers
Mem:      1008648      708512      300136            0        25688
-/+ buffers:            682824      325824
Swap:            0            0            0
~ $


I tried the procedure with Inception (in the past I tried it in Open Mode). At the beginning, the swap had regural MB, but after opened some applications (like games or browser), that MB went slowly down, and now I have 0 MB, also with applications closed, phone rebooted or turned off.

Garp 2013-03-01 19:41

Re: additional swap file
 
Someone able to answer to this?
I don't understand but my swap seems never to be used after the change. Below is just after reboot.:confused:

BusyBox v1.21.0 (1.21.0power1+harmattan0) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ $ free
total used free shared buffers
Mem: 1008108 688284 319824 0 93476
-/+ buffers: 594808 413300
Swap: 422136 0 422136
~ $ free
total used free shared buffers
Mem: 1008108 702244 305864 0 95688
-/+ buffers: 606556 401552
Swap: 422136 0 422136
~ $ free
total used free shared buffers
Mem: 1008108 750712 257396 0 91228
-/+ buffers: 659484 348624
Swap: 422136 0 422136

coderus 2013-03-01 19:44

Re: additional swap file
 
swap used whrn memory full.
try to open 20+ applications and check swap then

Garp 2013-03-01 20:18

Re: additional swap file
 
Quote:

Originally Posted by coderus (Post 1326275)
swap used whrn memory full.
try to open 20+ applications and check swap then

Of course, thanks!:)

xcentric 2013-05-01 23:16

Re: additional swap file
 
Quote:

Originally Posted by rainisto (Post 1271033)
I made more advanded tutorial howto enable the unused mtd partition as swap. With this method you can freely still use the mass-storage mode.

Disclaimer: you can brick your device if you don't have opensh and don't follow instructions carefully.

RM696-21-3_PR_001:~# devel-su
RM696-21-3_PR_001:~# opensh
RM696-21-3_PR_001:~# accli -I |grep tcb-sign
aegis-enabler::tcb-sign <--- If grep doesn't find this line then you have to STOP and not go further.
RM696-21-3_PR_001:~# free
total used free shared buffers
Mem: 1008648 803080 205568 0 33580
-/+ buffers: 769500 239148
Swap: 262136 54012 208124
RM696-21-3_PR_001:/# cp /etc/init/enable-swap.conf /tmp/enable-swap.conf
RM696-21-3_PR_001:/# vi /tmp/enable-swap.conf
# make editions on 2 lines that is mentioned in my earlier patch that I posted here. http://pastebin.com/raw.php?i=8rS81vUX
RM696-21-3_PR_001:/# cp /tmp/enable-swap.conf /etc/init/enable-swap.conf
RM696-21-3_PR_001:/# export A=`sha1sum /tmp/enable-swap.conf |cut -b1-40`;
RM696-21-3_PR_001:/# perl -pi -w -e 's#40 (.*) A(.*)enable-swap#40 $ENV{A} A$2enable-swap#smg' /var/lib/aegis/refhashlist
RM696-21-3_PR_001:/# accli -c tcb-sign -F /var/lib/aegis/refhashlist -i /var/lib/aegis/refhashlist
RM696-21-3_PR_001:/# /usr/sbin/validator-init; aegis-loader;echo 1 > /sys/kernel/security/validator/flush
RM696-21-3_PR_001:~# reboot
# wait system to reboot and login again:
RM696-21-3_PR_001:~# free
total used free shared buffers
Mem: 1008648 478264 530384 0 24040
-/+ buffers: 454224 554424
Swap: 444664 0 444664


As you can see after reboot you have about 530MB free ram which is 256MB more than before, and swap file is now the 450MB mtd partiotion which was previously unused by the device.

I'm not going to make comparision if onenand mtd partition is faster than mass storage flash partition. If pages are cached in either flash its going to be a bit slower than ramz.

Performance benefit of this is that you have 256MB more ram to play with, and if your not running over 15 apps simultaneously then most likely this increased amount of ram will make your device faster, since its more unlikely that system needs to page your background apps in swap :)

i followed all the steps until the last step where its suppose to reboot itself...
cause it didnt reboot itself so i did it manually and now i am stuck at "device not working properly" error..it managed to switch on for some reason and i check dropcache showed new swap memory...but when i restarted again i am stuck at "device not working properly" error how do i fix this...without losing my phone settings and apps...thanks

rainisto 2013-05-02 04:35

Re: additional swap file
 
Quote:

Originally Posted by xcentric (Post 1340549)
i followed all the steps until the last step where its suppose to reboot itself...
cause it didnt reboot itself so i did it manually and now i am stuck at "device not working properly" error..it managed to switch on for some reason and i check dropcache showed new swap memory...but when i restarted again i am stuck at "device not working properly" error how do i fix this...without losing my phone settings and apps...thanks

Most common problem is that people are trying to run these command from terminal manually and not by logging in with ssh. In that case any typo or perl command will mess up your refhashlist. To recover you need to check what sha1sum line differs in refhashlist, and fix the line and resign.

That disclaimer is there for a reason, if people dont login with ssh and use copy paste, you most likely end up in brick and need to reflash.

kanser 2013-05-02 13:10

Re: additional swap file
 
Im a little disappointed that after so mutch time, this isnt added to N9 qtweak :-(
Is it realy hard to do it? Im asking because we have so many Pros in this community.

thedead1440 2013-05-02 13:34

Re: additional swap file
 
Quote:

Originally Posted by kanser (Post 1340644)
Im a little disappointed that after so mutch time, this isnt added to N9 qtweak :-(
Is it realy hard to do it? Im asking because we have so many Pros in this community.

The real reason is there are many people who don't bother reading and may end up MALF'ing their device if this was added to N9QT...

Hacker 2013-05-03 12:33

Quote:

Originally Posted by thedead1440 (Post 1340657)
The real reason is there are many people who don't bother reading and may end up MALF'ing their device if this was added to N9QT...

Actually, I think that this closely relates to the point kanser was making.

Given that this tweak is a sensitive process that is easy to mess up, and since we want to eliminate the procedural errors that lead to MALFs, wouldn't it be smart to automate this process, whether through N9QT or otherwise?

This way, accidental changes and other screw ups could be avoided. So, is it possible to automate? Why or why not?

Schturman 2013-05-03 13:50

Re: additional swap file
 
i Think all possible.. If we want.. ;)
I don't remember all process of this tweak, but i remember the problem that user need deactivate this tweak if he want connect her phone via USB cable as mass storage... This we can solve via icon - one press activate, another one deactivate.. But still user need to remember this...

wook_sf 2013-05-04 00:29

Re: additional swap file
 
Quote:

Originally Posted by Schturman (Post 1340939)
i Think all possible.. If we want.. ;)
I don't remember all process of this tweak, but i remember the problem that user need deactivate this tweak if he want connect her phone via USB cable as mass storage... This we can solve via icon - one press activate, another one deactivate.. But still user need to remember this...

Depends on what are you doing/using
extra swap file - swap file solution on mass storage does have issue, but enabling extra swap partition (a dangerous method for some) doesn't need to be disabled AFAIK.

(i don't use usb cable for my phone though) :D

Hacker 2013-05-04 03:20

Quote:

Originally Posted by wook_sf (Post 1341041)
Depends on what are you doing/using
extra swap file - swap file solution on mass storage does have issue, but enabling extra swap partition (a dangerous method for some) doesn't need to be disabled AFAIK.

(i don't use usb cable for my phone though)

I don't have this tweak, but what exactly are the issues with mass storage mode?

If this tweak is properly accomplished, are there any other problems or threats to consider?

If it's safe, then wooohoooo! I'm sure that I and many others would be very happy to see this tweak automated in a separate tweak or a future version of N9QT . . .

pichlo 2013-05-04 06:54

Re: additional swap file
 
Quote:

Originally Posted by Hacker (Post 1341067)
I don't have this tweak, but what exactly are the issues with mass storage mode?

If your additional swap is a file on the SD card rather than a partition, then unmounting the SD card in mass storage mode means kaboom! A partition is OK, as I can vouch myself.

Schturman 2013-05-04 09:03

Re: additional swap file
 
This its a reasons that i don't want to add this to n9qt..

juiceme 2013-05-04 09:22

Re: additional swap file
 
Quote:

Originally Posted by Hacker (Post 1341067)
If this tweak is properly accomplished, are there any other problems or threats to consider?

If it's safe, then wooohoooo! I'm sure that I and many others would be very happy to see this tweak automated in a separate tweak or a future version of N9QT . . .

Well, it depends on what do you call "hafmful side effects" :D

When the mtd4 NAND-FLASH partition is used for swap, it will get a lot of writes and the quality of that type of FLASH is not very good. It is most certainly not meant to be used like that.

What happens, sooner or later is that you will burn your flash partition to unuseful condition, it will literally be worn out. :eek:

Now, is this bad or not? It depends, because your device will operate just like before, normally mtd5 is not used for anyting, it's just spare storage on your device.

I myself keep an additional OS there, but you can use it for anything you like, even as swap space...

wook_sf 2013-05-04 09:45

Re: additional swap file
 
Quote:

Originally Posted by Hacker (Post 1341067)
I don't have this tweak, but what exactly are the issues with mass storage mode?

If this tweak is properly accomplished, are there any other problems or threats to consider?

If it's safe, then wooohoooo! I'm sure that I and many others would be very happy to see this tweak automated in a separate tweak or a future version of N9QT . . .

check this:
1st method = you have file on mass storage that is always in use, so, no unmounting until you disable swap
2nd method = using one "disk" that has not being used...

both methods will some day damage your phone, sooner or later :D


All times are GMT. The time now is 04:08.

vBulletin® Version 3.8.8