Difference between pages "Uvesafb" and "System Administration Practice"

From Funtoo
(Difference between pages)
Jump to: navigation, search
(Bootloader configuration)
 
(Keep Portage Tree Up-To-Date)
 
Line 1: Line 1:
== ''How to'' : Framebuffer: Userspace VESA VGA graphics support ==
+
== Keep Portage Tree Up-To-Date ==
Uvesafb is an improved framebuffer driver for Linux systems with some enhancements compared to vesa.  
+
Even if you're not doing a full update every day, you should sync the portage tree and overlays regularly. It will reduce the time that you need to sync tree before a system upgrade. Also, if you just want to install something, it will be installed with latest deps so you will not waste time on upgrading it later. Here is an example script to upgrade portage and overlay every day. Edit <code>/etc/cron.daily/autosync.sh</code> with your favorite text editor:
=Kernel configuration=
+
{{File
 +
|/etc/cron.daily/autosync.sh|<pre>
 +
#!/bin/bash
 +
log="/var/log/autosync.log"
 +
if [ ! -f $log ]; then
 +
touch $log
 +
chmod 600 $log
 +
chown root:root $log
 +
fi
  
{{Kernelop
+
echo >> $log
| <br> |<pre>
+
echo "*** autosync started! ($(date +'%d-%m-%Y %H:%M:%S'))" >> $log
Device Drivers ->
+
echo "*** running emerge --sync" >> $log
    <*> Connector - unified userspace <-> kernelspace linker  --->
+
emerge -q --sync >> $log 2>&1
    Graphics support ->
+
if [ -f /usr/bin/layman ]; then
        [*] Support for frame buffer devices  --->
+
echo >> $log
            [*] Enable firmware EDID
+
echo "*** running layman -S" >> $log
            Console display driver support ->
+
/usr/bin/layman -S --nocolor >> $log 2>&1
                [*] Video mode selection support
+
fi
                [*] Video mode handling helpers
+
            Frame buffer hardware drivers
+
            [*] Userspace VESA VGA graphics support
+
 
</pre>}}
 
</pre>}}
  
Build the kernel, do not install the kernel and modules. Note, that you can choose uvesafb as module, unlike vesa.
+
== Purge unused distfiles ==
 +
Distfiles may take up a lot of space on disk, and if you do not clean them from time to time it may become an issue. There are many ways to clean them.  
  
== Klibc ==
+
* Remove distfiles which wasn't accessed in last 90 days. ('''WARNING''': It will not work if distfiles are on filesystem with '''noatime''' option. You may want think about '''relatime''').
 
+
Next, we emerge {{Package|dev-libs/klibc}}:
+
 
<console>
 
<console>
###i## emerge klibc
+
###i## nano /etc/cron.daily/distfiles-auto-purge.sh
 +
#!bin/bash
 +
find /usr/portage/distfiles -maxdepth 1 -type f -atime +90 -exec rm {}
 
</console>
 
</console>
This step is necessary because klibc has to be compiled against a kernel that includes uvesafb. You need to do it only once.
+
Alternative is using <tt>eclean</tt> purge utility for distfiles and binary packages, it is part of <tt>app-portage/gentoolkit</tt> package.
 
+
Let's say we want to purge distfiles in <tt>/usr/portage/distfiles</tt>
== v86d ==
+
{{Package|sys-apps/v86d}} is the userspace helper that runs x86 code in emulated environment. Uvesafb will not work without v86d. Now, we emerge <code>v86d</code>:
+
 
<console>
 
<console>
###i## emerge v86d
+
###i## eclean-dist -i
 
</console>
 
</console>
 
+
This command will prompt for each distfile and ask user's confirmation (can be slow). Example of advanced usage, let's clean all distfiles except for installed packages (exact version), those which are less than one month old, bigger than 50MB, or fetch-restricted:
== Back to kernel configuration ==
+
Reconfigure the kernel:
+
{{Kernelop
+
| <br> |<pre>
+
General Setup->
+
(*)Initial RAM filesystem and RAM disk (initramfs/initrd) support
+
</pre>}}
+
Rebuild the kernel: make and install it, install the modules
+
 
+
=Bootloader configuration=
+
add <code>video=uvesafb:1440x900-32,mtrr:3,ywrap</code> (or similar) to your kernel command line, like in example <code>boot.conf</code>
+
 
+
{{File
+
|/etc/boot.conf|<pre>
+
boot {
+
        generate grub
+
        default "Funtoo Linux uvesafb"
+
        timeout 3
+
}
+
  "Funtoo Linux uvesafb" {
+
        kernel bzImage-uvesafb[-v]
+
        params += video=uvesafb:1440x900-32,mtrr:3,ywrap
+
}
+
</pre>}}
+
 
+
Then run:
+
 
<console>
 
<console>
###i## boot-update
+
###i## eclean-dist -d -t1m -s50M -f
</console>  
+
</console>
and then run:  
+
Cron lovers :)
 +
clean packages in the safest mode, and then distfiles in deep mode but protecting files less than a week old, every sunday at 1am:
 
<console>
 
<console>
###i## reboot
+
###i## 0 1 * * sun  eclean -C -q packages ; eclean -C -q -d -t1w distfiles
 
</console>
 
</console>
and enjoy uvesafb!
 
  
  
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Revision as of 23:38, 14 January 2014

Keep Portage Tree Up-To-Date

Even if you're not doing a full update every day, you should sync the portage tree and overlays regularly. It will reduce the time that you need to sync tree before a system upgrade. Also, if you just want to install something, it will be installed with latest deps so you will not waste time on upgrading it later. Here is an example script to upgrade portage and overlay every day. Edit /etc/cron.daily/autosync.sh with your favorite text editor:

#!/bin/bash
log="/var/log/autosync.log"
if [ ! -f $log ]; then
	touch $log
	chmod 600 $log
	chown root:root $log
fi

echo >> $log
echo "*** autosync started! ($(date +'%d-%m-%Y %H:%M:%S'))" >> $log
echo "*** running emerge --sync" >> $log
emerge -q --sync >> $log 2>&1
if [ -f /usr/bin/layman ]; then
	echo >> $log
	echo "*** running layman -S" >> $log
	/usr/bin/layman -S --nocolor >> $log 2>&1
fi

Purge unused distfiles

Distfiles may take up a lot of space on disk, and if you do not clean them from time to time it may become an issue. There are many ways to clean them.

  • Remove distfiles which wasn't accessed in last 90 days. (WARNING: It will not work if distfiles are on filesystem with noatime option. You may want think about relatime).
# nano /etc/cron.daily/distfiles-auto-purge.sh 
#!bin/bash
find /usr/portage/distfiles -maxdepth 1 -type f -atime +90 -exec rm {} 

Alternative is using eclean purge utility for distfiles and binary packages, it is part of app-portage/gentoolkit package. Let's say we want to purge distfiles in /usr/portage/distfiles

# eclean-dist -i 

This command will prompt for each distfile and ask user's confirmation (can be slow). Example of advanced usage, let's clean all distfiles except for installed packages (exact version), those which are less than one month old, bigger than 50MB, or fetch-restricted:

# eclean-dist -d -t1m -s50M -f

Cron lovers :) clean packages in the safest mode, and then distfiles in deep mode but protecting files less than a week old, every sunday at 1am:

# 0 1 * * sun   eclean -C -q packages ; eclean -C -q -d -t1w distfiles