Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Moving a system to external USB drive
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sun Oct 12, 2014 8:27 am    Post subject: Reply with quote

Nice work creaker :-)

I'd try -Os first in a low-RAM situation. The kernel has an option for it too (iirc it defaults on, but that might have changed.)

I add a couple of CFLAGS to get a slightly-slimmer build without using -Os, but I've never analysed the result. Just that when I only had 2GB RAM I tried most things to get it leaner, and I've been using the align flags for best part of a decade now (from when I was on 32-bit, where you'd use 3, not 7.) Never wanted to add that to kernel CFLAGS though: I don't mind if the kernel takes up a tiny bit more space (since it's so central, ofc.)

(As for adding CFLAGS to kernel build, which you asked earlier, there is a custom-cflags USE, but you don't need it afaict. It can ofc just be done at build time.)

Another thing I found really helped was lowering the debug setting to zero for things like firefox; though that was more about hard-drive space, if you're using any -g flags for any package, you definitely want FEATURES=splitdebug. (as well as compressdebug.)

It's all written up here. Feedback from a man of your ability, is always welcome.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Tue Oct 14, 2014 1:26 am    Post subject: Reply with quote

steveL, thanks for reply.
Yes, Os is a sane idea. Not aware of what benefit I might get with gcc, but afair msvc reduced code size approx for 15% in comparison to O3.
Unfortunately Os does nothing with non-binariy files and I have a lot of them at /usr/share, so I'm looking for additional ways to reduce RAM usage.
The last thing I did was a rough rm -rf on /usr before populating RAM disk with stuffs from there. Since the system is read-only (if not forced to save changes), it doesn't ruins a setup. I just do this on every boot after mounting /usr:
Code:
        mount -rt squashfs -o loop,ro /squashed/usr/usr.sqfs /usr
        ebegin "Mounting read-write usr image with unionfs (aufs)"
        mkdir -p /dev/shm/.usr-rw
        mount -t aufs -o udba=reval,br=/dev/shm/.usr-rw=rw:/usr=ro usrAufs /usr

        cd /usr
        find . -type d -name "*libreo*" -exec rm -vrf {} \;
        find . -type d -name "*mysql*" -exec rm -vrf {} \;
        find . -type d -name "*myisam*" -exec rm -vrf {} \;
        find . -type d -name "*gimp*" -exec rm -vrf {} \;
        find . -type d -name "*amarok*" -exec rm -vrf {} \;
        find . -type d -name "*strigi*" -exec rm -vrf {} \;
        find . -type d -name "*python*" -exec rm -vrf {} \;

        mount none -t tmpfs -o size=1000M /mnt/ramdisk
        ebegin "Moving /usr/lib to RAM, please wait"
        cp -a /usr/lib64/* /mnt/ramdisk
        mount -o bind /mnt/ramdisk/ /usr/lib64/

It frees a good amount of RAM, now I have RAM usage reduced from 3.5Gb to 2.2Gb. However it's still too much. It would be greate to get it at range of 1.5G. Now I'm thinking of what can I shred in addition to above list. What's about Qt4?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum