The Following 30 Users Say Thank You to ccooke For This Useful Post: | ||
|
2009-10-24
, 21:46
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#2
|
I
* The script has been tested and works on my Ubuntu box and my n900. There is no reason it won't work for the n8x0 on Maemo 4 or Mer.
The Following User Says Thank You to attila77 For This Useful Post: | ||
|
2009-10-24
, 21:57
|
Posts: 7 |
Thanked: 34 times |
Joined on Oct 2009
@ London, UK
|
#3
|
A few notes:
Maemo 4 does not have an ext3 partition on the built-in card so it's a no-go unless you repartition (at which point you are better off cloning the whole root).
Also, I have not analyzed your script, but be VERY careful about moving /usr/lib stuff around - that can cause serious breakage.
|
2009-10-25
, 07:03
|
|
Posts: 3,105 |
Thanked: 11,088 times |
Joined on Jul 2007
@ Mountain View (CA, USA)
|
#4
|
The Following User Says Thank You to qgil For This Useful Post: | ||
|
2009-10-25
, 09:52
|
Posts: 7 |
Thanked: 34 times |
Joined on Oct 2009
@ London, UK
|
#5
|
|
2009-10-25
, 10:25
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#6
|
The Following User Says Thank You to attila77 For This Useful Post: | ||
|
2009-10-25
, 10:28
|
Posts: 7 |
Thanked: 34 times |
Joined on Oct 2009
@ London, UK
|
#7
|
The Following User Says Thank You to ccooke For This Useful Post: | ||
|
2009-10-25
, 17:29
|
|
Posts: 3,105 |
Thanked: 11,088 times |
Joined on Jul 2007
@ Mountain View (CA, USA)
|
#8
|
|
2009-10-25
, 21:05
|
|
Posts: 643 |
Thanked: 628 times |
Joined on Mar 2007
@ Seattle (or thereabouts)
|
#9
|
The Following User Says Thank You to Johnx For This Useful Post: | ||
|
2009-10-25
, 21:08
|
Posts: 2,802 |
Thanked: 4,491 times |
Joined on Nov 2007
|
#10
|
-rwxr-xr-x 1 root root 8514264 Sep 17 22:43 /usr/bin/mencoder -rwxr-xr-x 1 root root 8683832 Sep 17 22:43 /usr/bin/mplayer
-rw-r--r-- 1 root root 4866193 Oct 20 21:04 /usr/share/maemo-pc-connectivity/manual.pdf
-rwxr-xr-x 1 root root 2018258 Aug 24 16:09 /usr/share/bluemaemo/themes/bluemaemo.edj
dpkg-query -W -f='${Installed-Size}\t${Package}\n' '*' | sort -n | tail -50
Tags |
n800, n810, n900, optification, optifying, rootfs |
Thread Tools | |
|
This is a simple script that calculates which packages are taking up the largest number of blocks in /usr on the filesystem and can relocate portions of them to /opt. It does this in a safe manner - every operation is atomic and it will verify the files are identical before the final switch. It can also undo the relocation, if needed.
The first run will take ages - leave the device on power for fifteen minutes or so while it churns through all your packages and works out which ones use up most space in /usr. Subsequent runs will use a cache, unless you start it with the --clean option.
A few caveats:
* The script does *NOT* make sure /opt is in a sensible location. Make sure it actually is referring to a different partition!
* There's no blacklisting of packages. It *WILL* be possible to damage your system with this script if you relocate something that is needed before the partition holding /opt is mounted. Only relocate packages you believe to be safe! Anything you know you've installed yourself is a good bet, or anything which is entirely GUI based. The n900's nokia-maps app is a prime candidate. 'busybox' is *NOT*, even though it will probably be detected as the largest package.
* The script has been tested and works on my Ubuntu box and my n900. There is no reason it won't work for the n8x0 on Maemo 4 or Mer.
* Technically, there's a race condition when switching files, so I suggest everyone disables multi-user logins on their tablets and makes sure there's no malicious software installed. Or in other words: It's not really a problem in this case.
* The script will only relocate normal files in /usr. Nothing from elsewhere, no directories, links, special files, etc.
Use:
Get root on your tablet.
Make sure bash is installed.
Download the script.
--
for((P=10**8,Q=P/100,X=320*Q/(`tput cols`-1),Y=210*Q/`tput lines`,y=-105*Q,v=-2\
20*Q,x=v;y<105*Q;x=v,y+=Y));do for((;x<P;a=b=i=k=c=0,x+=X));do for((;a*a+b*b<4*\
P*P&&i++<99;a=((c=a)*a-b*b)/P+x,b=2*c*b/P+y));do :;done;(((j=(i<99?i%16:0)+30)>\
37?k=1,j-=8:0));echo -ne "\E[$k;$j"mE;done;echo -e \\E[0m;done # Charles Cooke