Difference between pages "Package:Boot-Update" and "CCACHE"

From Funtoo
(Difference between pages)
Jump to: navigation, search
 
 
Line 1: Line 1:
Funtoo boot-update provides a unified mechanism for configuring the GRUB 1.9x ({{Package|sys-boot/grub}}) and GRUB 0.97 ({{Package|sys-boot/grub-legacy}}) boot loaders. It is the recommended, official way to configure Funtoo Linux systems for booting.
+
CCACHE is an application that caches compilation results and reuses it in future compilations in order to achieve faster compile times. This short tutorial will show you how to use it on your system.
  
== Current Version ==
+
{{fancywarning|'''CCACHE can cause build failures'''. If it does, please try to compile the application without CCACHE enabled. Bug reports reported with CCACHE enabled will be closed.}}
  
* {{Package|sys-boot/boot-update}}
+
== Installing CCACHE ==
 +
To emerge {{Package|dev-util/ccache}}, run the following:
 +
<console>
 +
# ##i##emerge ccache
 +
</console>
  
== Man Pages ==
+
Once it finishes emerging, we will enable it in portage. This is very easy. Just open up ''<code>/etc/portage/make.conf</code>'' with your favorite text editor and add the following:
Consult the following man pages for detailed, up-to-date information on configuration file settings and command-line arguments:
+
<console>
 +
# ##i##FEATURES="ccache"
 +
</console>
  
* boot-update(8)
+
That's it. If you want to check how much the cache is taking up on your disk and other info, you can run the following command:
* boot.conf(5)
+
<console>
 +
# ##i##CCACHE_DIR="/var/tmp/ccache" ccache -s
 +
</console>
  
== GRUB 1.97+ Quick Start ==
+
You must pass the ''<code>CCACHE_DIR</code>'' option since ccache normally defaults to the user's home directory, and portage uses ''<code>/var/tmp/ccache</code>''.
  
If using ''<code>sys-boot/grub-1.97</code>'' or later, perform the following steps:
+
== Tweaking CCACHE ==
  
* Partition disk using GPT/GUID (recommended) or MBR partitions.
+
=== Disabling the CACHE limit ===
* Install kernel/initrd to /boot
+
  
<console>
+
If you want to let the cache have the flexibility to grow to whatever size it needs to (unlimited size cache), just do the following:
###i## emerge sys-boot/boot-update
+
###i## grub-install --no-floppy /dev/sda
+
</console>
+
Ensure that ''<code>/etc/fstab</code>'' is correct, and edit ''<tt>/etc/boot.conf</tt>'' to reflect your installation. Then run:
+
  
 
<console>
 
<console>
###i## boot-update
+
# ##i##CCACHE_DIR="/var/tmp/ccache" ccache -M 0
 
</console>
 
</console>
This will auto-generate the complex ''<tt>/boot/grub/grub.cfg</tt>'' required for booting. Re-run ''<tt>boot-update</tt>'' every time your available kernels/initrds or ''<tt>/etc/boot.conf</tt>'' configuration changes.
 
  
= GRUB 0.97 (grub-legacy) Quick Start =
+
This will let the cache grow to whatever size it needs to grow over time.
  
If using ''<code>sys-boot/grub-legacy-0.97</code>'', perform the following steps:
+
== Tricks ==
 +
===  Using CCACHE to compile your kernel faster ===
 +
In order to do this you need to change a few variables, you probably only want to change these variables temporarily, but you could change them permanently if you want to. Since we just want to do this temporarily for this example, make a new file called "build.sh" and put the following inside of it:
  
* Partition disk using MBR partitions '''(GPT not supported)'''
+
<console>
* Install kernel/initrd to ''<code>/boot</code>''
+
#!/bin/bash
  
<console>
+
export CCACHE_DIR="/var/tmp/ccache"
###i## emerge -av sys-boot/boot-update
+
export PATH="/usr/lib/ccache/bin:${PATH}"
###i## emerge ">=sys-boot/grub-legacy-0.97-r11"
+
 
###i## grub-install-legacy /dev/sda
+
cd /usr/src/linux
</console>
+
time make bzImage modules
Due to an issue with ''<code>grub-legacy</code>'', you may see the following message:
+
<console>
+
###i## grub-install-legacy /dev/sda
+
The file /boot/grub-legacy/stage1 not read correctly.
+
</console>
+
Should you receive this message, you will have to install ''<code>grub-legacy</code>'' from the grub shell.
+
Assuming ''<code>/boot</code>'' is ''<code>/dev/sda1</code>'' and you want to install grub to the MBR, you would run the following:
+
<console>
+
###i## grub-legacy
+
root (hd0,0)
+
setup (hd0)
+
quit
+
</console>
+
When adjusting to fit your setup, remember 'root' is the location of your boot partition, 'setup' is where you want to install grub, and don't forget about grub's unique naming conventions for harddrives/partitions. For more information run:
+
<console>
+
###i## info grub-legacy
+
 
</console>
 
</console>
  
Ensure that ''<tt>/etc/fstab</tt>'' is correct, and edit ''<tt>/etc/boot.conf</tt>'' to reflect your installation. Ensure a ''<tt>generate grub-legacy</tt>'' setting in the ''<tt>boot</tt>'' section. Then run:
+
Give the file execute permission:
  
 
<console>
 
<console>
###i## boot-update
+
# ##i##chmod u+x build.sh
 
</console>
 
</console>
This will auto-generate the ''<tt>/boot/grub-legacy/grub.conf</tt>'' required for booting. Note that grub-legacy-0.97-r11 and later stores ''<tt>grub.conf</tt>'' in the ''<tt>/boot/grub-legacy</tt>'' directory.
 
 
Re-run ''<tt>boot-update</tt>'' every time your available kernels/initrds or ''<tt>/etc/boot.conf</tt>'' configuration changes.
 
  
[[Category:HOWTO]]
+
This will temporarily export the variables neccessary, then go into the ''<code>/usr/src/linux</code>'' folder (whatever you declared with 'eselect kernel') and then compile the kernel.[[Category:HOWTO]]
[[Category:Projects]]
+
[[Category:Funtoo features]]
+

Revision as of 16:19, 11 January 2014

CCACHE is an application that caches compilation results and reuses it in future compilations in order to achieve faster compile times. This short tutorial will show you how to use it on your system.

Warning: CCACHE can cause build failures. If it does, please try to compile the application without CCACHE enabled. Bug reports reported with CCACHE enabled will be closed.

Contents

Installing CCACHE

To emerge dev-util/ccache, run the following:

# emerge ccache

Once it finishes emerging, we will enable it in portage. This is very easy. Just open up /etc/portage/make.conf with your favorite text editor and add the following:

# FEATURES="ccache"

That's it. If you want to check how much the cache is taking up on your disk and other info, you can run the following command:

# CCACHE_DIR="/var/tmp/ccache" ccache -s

You must pass the CCACHE_DIR option since ccache normally defaults to the user's home directory, and portage uses /var/tmp/ccache.

Tweaking CCACHE

Disabling the CACHE limit

If you want to let the cache have the flexibility to grow to whatever size it needs to (unlimited size cache), just do the following:

# CCACHE_DIR="/var/tmp/ccache" ccache -M 0

This will let the cache grow to whatever size it needs to grow over time.

Tricks

Using CCACHE to compile your kernel faster

In order to do this you need to change a few variables, you probably only want to change these variables temporarily, but you could change them permanently if you want to. Since we just want to do this temporarily for this example, make a new file called "build.sh" and put the following inside of it:

#!/bin/bash

export CCACHE_DIR="/var/tmp/ccache"
export PATH="/usr/lib/ccache/bin:${PATH}"

cd /usr/src/linux
time make bzImage modules

Give the file execute permission:

# chmod u+x build.sh

This will temporarily export the variables neccessary, then go into the /usr/src/linux folder (whatever you declared with 'eselect kernel') and then compile the kernel.