Friday 16 July 2010

LAP - Toolchain, Part 7 - Finish

I mentioned at a much earlier stage that I was write permitting a program to allow it to be edited later.  Now is that later.  What we are doing is clearing out unnecessary documentation and debugging symbols to reduce the size of the Toolchain.  Not strictly necessary, but you may well want to back up the toolchain once you are finished building it so you do not have to go through all of this again.  If so, you would want the backup to be as small as possible.  Also if you are installing to a small disk then you will need lots of space to install the software to come.

We achieve this size reduction quite simply:
strip --strip-debug /tools/lib/*
strip --strip-unneeded /tools/{,s}bin/*
rm -rf /tools/{,share}/{info,man}
The strip command is clever enough to remove the debug stuff automatically, but the command to [r]e[m]ove the documentation is a bit more brutal.

Finally, the toolchain is currently owned by the lfs user, because that is how we made it.  This will screw it up once we chroot into it, because there is no lfs user in the new system; only the host.  SO we need to change the ownership of the whole tools directory.  First exit the su - lfs system:
exit
Then simply:
chown -R root:root /media/lfs/tools
This command [ch]anges the [own]ership of the [/media/lfs/tools] folder to the user [root] of group [root].  Simple enough.  Oh, hang on, not it isn't.  Error fucking permission bullshit city again.
sudo chown -R root:root /media/lfs/tools
That's got the bastard.

The toolchain is DONE!  Have a beer.

No comments:

Post a Comment