Note:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Creating Your Own Overlay"

From Funtoo
Jump to navigation Jump to search
m (add portage category and priority value)
Line 1: Line 1:
This page intends to get your local overlay going, show how to revision bump a package.
This page intends to get your local overlay going.
==Using overlay with Funtoo's kits system==
For the overlays we will use a minor change for the main meta-repo described in Funtoo kits: https://github.com/funtoo/meta-repo/blob/master/README.rst


We will use /var/overlay as primary location directory. This directory can be located anywhere, below is an example location.
{{console|body=
{{console|body=###i## mkdir /var/overlay}}
###i## install -d /var/git
###i## cd /var/git
###i## git clone https://github.com/funtoo/meta-repo.git
###i## cd meta-repo
###i## git submodule init
###i## git submodule update
###i## rm /usr/share/portage/config/repos.conf
###i## ln -s /var/git/meta-repo/repos.conf/funtoo /etc/portage/repos.conf
###i## chown -R portage:portage /var/git/meta-repo
}}
In above shown commands we created the "funtoo" symlink to the regular portage tree. This allows to add any configuration files of any names you prefer for any custom repositories you like, such as overlays, and will not interfere with the meta-repo.


Clone the [http://git.funtoo.org/skeleton-overlay skeleton overlay] from github. Change the repository's name from ''skeleton'' to a name as it will appear when emerging.
==Creating the overlay==
We will use <code>/var/git/overlay</code> as primary location directory for the overlay. The location can be anywhere on your system, below is an example location tied with <code>/var/git/</code>, is where regular tree located too.


{{console|body=###i## cd /var/overlay
{{console|body=
###i## git clone http://git.funtoo.org/skeleton-overlay/ local && cd local
###i## mkdir /var/git/overlay
###i## echo "myoverlayname" > /var/overlay/local/profiles/repo_name
}}
###i## echo "masters = gentoo" >> /var/overlay/local/metadata/layout.conf}}


{{file|name=/etc/portage/repos.conf/local.conf|lang=|desc=Add your overlay to portage|body=
Clone the [http://git.funtoo.org/skeleton-overlay skeleton overlay] from github. Change the repository's name from ''skeleton'' to a name as it will appear when emerging. Here we use <code>myoverlayname</code> as an example, choose your name accordingly.
 
{{console|body=###i## cd /var/git/overlay
###i## git clone http://git.funtoo.org/skeleton-overlay.git
###i## mv skeleton-overlay myoverlayname
}}
 
==Configure the overlay==
We will enable portage settings required for the overlay to be functional.
{{console|body=
###i## echo "myoverlayname" > /var/git/overlay/myoverlayname/profiles/repo_name
###i## echo "masters = core-kit" >> /var/git/overlay/myoverlayname/metadata/layout.conf}}
 
{{file|name=/etc/portage/repos.conf/myoverlayname.conf|lang=|desc=Add your overlay to portage|body=
[myoverlayname]
[myoverlayname]
location = /var/overlay/local
location = /var/git/overlay/myoverlayname
masters = gentoo
masters = core-kit
auto-sync = no
auto-sync = no
priority = 10
priority = 10
}}
}}


{{tip|The <code>priority</code> key is needed to ensure, that your overlay has higher priority as the kit's overlays, which are default priority 1 }}
{{tip|The <code>priority</code> key is needed to ensure, that your overlay has higher priority to the kit's overlays, which are default priority 1}}
 
Insert portage structure category & package directories.  For example,  I want to fix apparmor to include the very latest source, you would <code>mkdir -p /var/overlay/local/sys-apps/apparmor</code> then copy the old ebuild you found online (or on your computer) to the directory.  {{f|/var/overlay/local/sys-apps/apparmor/apparmor-2.8.4.ebuild}} is where the old ebuild would sit.  Copy it to the latest upstream version number.  {{c|cp apparmor-2.8.4.ebuild apparmor-2.9.2.ebuild}} then run the ebuild manifest file.
 
{{console|body=###i## mkdir -p /var/overlay/local/app-category/package-name
###i## mv package-oldversion.ebuild /var/overlay/local/app-category/package-name/package-oldversion.ebuild
###i## cp /var/overlay/local/app-category/package-name/package-oldversion.ebuild /var/overlay/local/app-category/package-name/package-newversion.ebuild
###i## ebuild *.ebuild manifest}}
 
for init files, patches etc:
example{{c|/var/overlay/local/sys-apps/apparmor/files/apparmor-init}}
{{console|body=###i## mkdir /var/overlay/local/app-category/package-name/files
###i## nano /var/overlay/local/app-category/package-name/files/package-init}}


You're ready to emerge the new version, you don't need to sync, you can make minor changes, then emerge, and if it breaks again you can make more minor changes, and emerge again.
This would be starting point for your own overlay. You're ready to add new ebuilds that are not present in portage tree or fix the ebuilds from portage tree you are no satisfied with, updating of old versions or removing of new ebuild versions.


[[Category:Portage]]
[[Category:Portage]]

Revision as of 05:25, August 31, 2017

This page intends to get your local overlay going.

Using overlay with Funtoo's kits system

For the overlays we will use a minor change for the main meta-repo described in Funtoo kits: https://github.com/funtoo/meta-repo/blob/master/README.rst

root # install -d /var/git
root # cd /var/git
root # git clone https://github.com/funtoo/meta-repo.git
root # cd meta-repo
root # git submodule init
root # git submodule update
root # rm /usr/share/portage/config/repos.conf
root # ln -s /var/git/meta-repo/repos.conf/funtoo /etc/portage/repos.conf
root # chown -R portage:portage /var/git/meta-repo

In above shown commands we created the "funtoo" symlink to the regular portage tree. This allows to add any configuration files of any names you prefer for any custom repositories you like, such as overlays, and will not interfere with the meta-repo.

Creating the overlay

We will use /var/git/overlay as primary location directory for the overlay. The location can be anywhere on your system, below is an example location tied with /var/git/, is where regular tree located too.

root # mkdir /var/git/overlay

Clone the skeleton overlay from github. Change the repository's name from skeleton to a name as it will appear when emerging. Here we use myoverlayname as an example, choose your name accordingly.

root # cd /var/git/overlay
root # git clone http://git.funtoo.org/skeleton-overlay.git
root # mv skeleton-overlay myoverlayname

Configure the overlay

We will enable portage settings required for the overlay to be functional.

root # echo "myoverlayname" > /var/git/overlay/myoverlayname/profiles/repo_name
root # echo "masters = core-kit" >> /var/git/overlay/myoverlayname/metadata/layout.conf
   /etc/portage/repos.conf/myoverlayname.conf - Add your overlay to portage
[myoverlayname]
location = /var/git/overlay/myoverlayname
masters = core-kit
auto-sync = no
priority = 10
   Tip

The priority key is needed to ensure, that your overlay has higher priority to the kit's overlays, which are default priority 1

This would be starting point for your own overlay. You're ready to add new ebuilds that are not present in portage tree or fix the ebuilds from portage tree you are no satisfied with, updating of old versions or removing of new ebuild versions.