Difference between pages "Xfce" and "Portage Git Mirror"

(Difference between pages)
(About Xfce)
 
(Git-daemon configuration)
 
Line 1: Line 1:
== About Xfce ==
+
=Setting up local git mirror =
  
Xfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly.
+
This tutorial explains how to save bandwidth when several local computers need to pull updates from a single remote git repository.
  
Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.
+
== Use case ==
  
Another priority of Xfce is adhereance to standards, specifically those defined at [http://freedesktop.org/ freedesktop.org]. [http://www.xfce.org/about/ About XFCE]
+
This tutorial will be about hosting a local mirror of funtoo git based portage tree.
  
== Installation ==
+
Following terms should be adapted
  
Before emerging Xfce you need to:
+
<table border="1">
 +
<tr class="header">
 +
<th align="left">Terms</th>
 +
<th align="left">Definition</th>
 +
</tr>
 +
<tr class="odd">
 +
<td align="left">git.lan</td>
 +
<td align="left">The git-daemon local mirror host</td>
 +
</tr>
 +
<tr class="even">
 +
<td align="left">localhost</td>
 +
<td align="left">Any local host</td>
 +
</tr>
 +
<tr class="odd">
 +
<td align="left">nobody</td>
 +
<td align="left">Owner user of .git files</td>
 +
</tr>
 +
<tr class="even">
 +
<td align="left">/home/git-mirrors</td>
 +
<td align="left">Base path of git-daemon</td>
 +
</tr>
 +
</table>
  
* Check that you have enabled the USE flags necessary for a XFCE desktop environment. [[Funtoo_Linux_First_Steps#Changing_profile|Set your profile to "xfce" via mix-ins]], as follows:
+
== Local mirror ==
  
 +
=== Git-daemon configuration ===
 +
==== Prepare directories and get portage tree====
 
<console>
 
<console>
# ##i## eselect profile add funtoo/1.0/linux-gnu/mix-ins/xfce
+
###i## mkdir /home/git-mirrors
 +
###i## chown nobody /home/git-mirrors
 +
###i## su -s /bin/sh nobody
 +
$##bl## cd /home/git-mirrors
 +
$##bl## git clone --mirror --bare git://github.com/funtoo/ports-2012.git portage.git
 
</console>
 
</console>
 +
For a security reason we use a nobody user .
 +
==== git-daemon configuration====
 +
{{file|name=/etc/conf.d/git-daemon|desc=|body=
 +
GITDAEMON_OPTS=--syslog --verbose --enable=receive-pack --export-all
 +
GITDAEMON_OPTS=${GITDAEMON_OPTS} --base-path=/home/git-mirrors /home/git-mirrors
 +
GIT_USER=nobody
 +
GIT_GROUP=nobody
 +
}}
  
* Verify that you have [[Funtoo_Linux_First_Steps#X.Org|X.Org Server]] configured properly.
+
====Service configuration====
 
+
To start daemon with a mirror machine boot add <code>git-daemon</code> to OpenRC's default runlevel
We are now ready to install Xfce. Install the meta-package, which pulls in all of the components you need for a minimal Xfce installation:
+
 
+
 
<console>
 
<console>
# ##i##emerge xfce4-meta
+
###i## rc-update add git-daemon default
 
</console>
 
</console>
 
+
To make changes start immediately just run <code>rc</code>
== Running Xfce ==
+
 
+
There are several different ways to start Xfce:
+
 
+
* Editing the <tt>.xinitrc</tt> file in your user's home directory and using <tt>startx</tt> from a text console.
+
* Using a display manager (e.g. SLiM, GDM, and KDM).
+
* Configuring your shell profile to automatically start Xfce upon a successful login.
+
 
+
=== .xinitrc ===
+
 
+
The most common way to start the environment is to configure <tt>~/.xinitrc</tt> to launch an Xfce session. The proper way to launch Xfce from the terminal is by using <tt>startxfce4</tt> combined with <tt>ck-launch-session</tt>.
+
 
+
 
<console>
 
<console>
$ ##i##echo "exec startxfce4 --with-ck-launch" > ~/.xinitrc
+
###i## rc
 
</console>
 
</console>
  
Note that <tt>--with-ck-launch</tt> (from ConsoleKit) is required by Xfce for important tasks such as shutting down, suspending, and automatically mounting removable storage media. Some applications will not work properly without it. Therefore we need to add ConsoleKit to the <tt>default</tt> runlevel, executing the following command as root:
+
=== Pull from remote ===
  
<console>
+
Add the following to <code>/etc/cron.daily/funtoo-sync.sh</code>:
# ##i##rc-update add consolekit default
+
</console>
+
 
+
Finally, to start the graphical environment, run <tt>startx</tt> from a login shell:
+
<console>
+
$ ##i##startx
+
</console>
+
 
+
== Display Manager ==
+
 
+
A display manager is a program that manages sessions and acts as a login screen. Here's a short list of a few of the display managers available in Funtoo:
+
 
+
* XDM (<tt>x11-apps/xdm</tt>): X.Org's standard display manager.
+
 
+
* LightDM (<tt>x11-misc/lightdm</tt>): A lightweight, but highly configurable display manager.
+
 
+
* SLiM (<tt>x11-misc/slim</tt>): Simple Login Manager -- a lightweight display manager. Not very configurable.
+
 
+
Any of these would make a fine choice. After you've chosen which display manager to use, install it:
+
 
+
<console>
+
# ##i##emerge lightdm
+
</console>
+
 
+
All that's left to do now is to add the name of the display manager to <tt>/etc/conf.d/xdm</tt>, add the <tt>xdm</tt> service to the <tt>default</tt> runlevel, and start the service:
+
  
 
<pre>
 
<pre>
DISPLAYMANAGER="lightdm"
+
#!/bin/sh
 +
cd /home/git-mirrors/portage.git
 +
su nobody -s "/bin/sh" -c "git fetch --all"
 
</pre>
 
</pre>
  
<console>
+
== Cloning from local git-daemon ==
# ##i##rc-update add xdm default
+
# ##i##/etc/init.d/xdm start
+
</console>
+
 
+
==Power Group==
+
 
+
If you wish to be able to shutdown/reboot/suspend/hibernate using xfce4-logout-session then you will need to add yourself or the user to the power group by:
+
  
 +
Local clone from <code>git.lan</code>:
 
<console>
 
<console>
# ##i##gpasswd -a <username> power
+
###i## mv /usr/portage /usr/portage.old
 +
###i## git clone git://git.lan/portage.git /usr/portage
 +
###i## cd /usr/portage
 +
###i## git checkout funtoo.org
 
</console>
 
</console>
  
If the group does not exist then execute the following and try again:
+
[[Category:HOWTO]]
 
+
<console>
+
# ##i##groupadd power
+
</console>
+
 
+
Now you need to add the following to /usr/share/polkit-1/actions/org.freedesktop.upower.policy:
+
 
+
{{file|lang=xml|name=/usr/share/polkit-1/actions/org.freedesktop.upower.policy|desc=|body=
+
<?xml version="1.0" encoding="UTF-8"?>
+
<!DOCTYPE policyconfig PUBLIC
+
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
+
<policyconfig>
+
  <vendor>The UPower Project</vendor>
+
  <vendor_url>http://upower.freedesktop.org/</vendor_url>
+
  <icon_name>system-suspend</icon_name>
+
 
+
  <action id="org.freedesktop.upower.suspend">
+
    <description>Suspend the system</description>
+
    <description xml:lang="fr">Mettre le système en veille</description>
+
    <description xml:lang="it">Sospende il sistema</description>
+
    <description xml:lang="pl">Wstrzymanie systemu</description>
+
    <description xml:lang="sv">Försätt systemet i vänteläge</description>
+
    <message>Authentication is required to suspend the system</message>
+
    <message xml:lang="fr">Vous devez vous identifier pour mettre le système en veille</message>
+
    <message xml:lang="it">È richiesto autenticarsi per sospendere il sistema</message>
+
    <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby wstrzymać system</message>
+
    <message xml:lang="sv">Autentisering krävs för att försätta systemet i vänteläge</message>
+
    <defaults>
+
      <allow_any>yes</allow_any>
+
      <allow_inactive>no</allow_inactive>
+
      <allow_active>yes</allow_active>
+
    </defaults>
+
  </action>
+
 
+
  <action id="org.freedesktop.upower.hibernate">
+
    <description>Hibernate the system</description>
+
    <description xml:lang="fr">Mettre le système en hibernation</description>
+
    <description xml:lang="it">Iberna il sistema</description>
+
    <description xml:lang="pl">Hibernacja systemu</description>
+
    <description xml:lang="sv">Försätt systemet i viloläge</description>
+
    <message>Authentication is required to hibernate the system</message>
+
    <message xml:lang="fr">Vous devez vous identifier pour mettre le système en hibernation</message>
+
    <message xml:lang="it">È richiesto autenticarsi per ibernare il sistema</message>
+
    <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby zahibernować system</message>
+
    <message xml:lang="sv">Autentisering krävs för att försätta systemet i viloläge</message>
+
    <defaults>
+
      <allow_any>yes</allow_any>
+
      <allow_inactive>no</allow_inactive>
+
      <allow_active>yes</allow_active>
+
    </defaults>
+
  </action>
+
 
+
</policyconfig>
+
}}
+
 
+
and also add the following to /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy:
+
 
+
{{file|lang=xml|name=/usr/share/polkit-1/actions/org.freedesktop.consolekit.policy|desc= |body=
+
<?xml version="1.0" encoding="UTF-8"?>
+
<!DOCTYPE policyconfig PUBLIC
+
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
+
 
+
<!--
+
Policy definitions for ConsoleKit
+
-->
+
 
+
<policyconfig>
+
 
+
  <action id="org.freedesktop.consolekit.system.stop">
+
    <description>Stop the system</description>
+
    <message>System policy prevents stopping the system</message>
+
    <defaults>
+
      <allow_any>yes</allow_any>
+
      <allow_inactive>no</allow_inactive>
+
      <allow_active>yes</allow_active>
+
    </defaults>
+
  </action>
+
 
+
  <action id="org.freedesktop.consolekit.system.stop-multiple-users">
+
    <description>Stop the system when multiple users are logged in</description>
+
    <message>System policy prevents stopping the system when other users are logged in</message>
+
    <defaults>
+
      <allow_any>yes</allow_any>
+
      <allow_inactive>no</allow_inactive>
+
      <allow_active>yes</allow_active>
+
    </defaults>
+
  </action>
+
 
+
  <action id="org.freedesktop.consolekit.system.restart">
+
    <description>Restart the system</description>
+
    <message>System policy prevents restarting the system</message>
+
    <defaults>
+
      <allow_any>yes</allow_any>
+
      <allow_inactive>no</allow_inactive>
+
      <allow_active>yes</allow_active>
+
    </defaults>
+
  </action>
+
 
+
  <action id="org.freedesktop.consolekit.system.restart-multiple-users">
+
    <description>Restart the system when multiple users are logged in</description>
+
    <message>System policy prevents restarting the system when other users are logged in</message>
+
    <defaults>
+
      <allow_any>yes</allow_any>
+
      <allow_inactive>no</allow_inactive>
+
      <allow_active>yes</allow_active>
+
    </defaults>
+
  </action>
+
 
+
</policyconfig>
+
}}
+
 
+
[[Category:Desktop]]
+
[[Category:First Steps]]
+
[[Category:Official Documentation]]
+

Revision as of 11:28, December 13, 2014

Setting up local git mirror

This tutorial explains how to save bandwidth when several local computers need to pull updates from a single remote git repository.

Use case

This tutorial will be about hosting a local mirror of funtoo git based portage tree.

Following terms should be adapted

Terms Definition
git.lan The git-daemon local mirror host
localhost Any local host
nobody Owner user of .git files
/home/git-mirrors Base path of git-daemon

Local mirror

Git-daemon configuration

Prepare directories and get portage tree

# mkdir /home/git-mirrors
# chown nobody /home/git-mirrors
# su -s /bin/sh nobody
$ cd /home/git-mirrors
$ git clone --mirror --bare git://github.com/funtoo/ports-2012.git portage.git

For a security reason we use a nobody user .

git-daemon configuration

/etc/conf.d/git-daemon
GITDAEMON_OPTS=--syslog --verbose --enable=receive-pack --export-all
GITDAEMON_OPTS=${GITDAEMON_OPTS} --base-path=/home/git-mirrors /home/git-mirrors
GIT_USER=nobody
GIT_GROUP=nobody

Service configuration

To start daemon with a mirror machine boot add git-daemon to OpenRC's default runlevel

# rc-update add git-daemon default

To make changes start immediately just run rc

# rc

Pull from remote

Add the following to /etc/cron.daily/funtoo-sync.sh:

#!/bin/sh
cd /home/git-mirrors/portage.git
su nobody -s "/bin/sh" -c "git fetch --all"

Cloning from local git-daemon

Local clone from git.lan:

# mv /usr/portage /usr/portage.old
# git clone git://git.lan/portage.git /usr/portage
# cd /usr/portage
# git checkout funtoo.org