0

What is the right way to use two profiles in Gentoo? Should I simply add the absolute path of the two profiles (e.g. the profile paths of systemd and hardened) to /etc/portage/make.profiles/parent? E.g. like so?:

/etc/portage/make.profiles/parent
    ../../../base
    ../../../default/linux
    ../../../arch/amd64
    ..
    /usr/portage/profiles/hardened/linux
    /usr/portage/profiles/targets/systemd

Or do I need to create a custom overlay profile and include that somehow to portage?

(Installing Gentoo the first time and I'm sort of stuck on the profiles thing, because I want to use both systemd's and hardened profile.)

2 Answers 2

0

Profiles can not be combined or merged. They are built by the maintainers to establish the implementation of the system.

The lack of the existing profile you're looking for means that it doesn't exist. Considering that hardened profiles are more strict and controlled, it is likely that the systemd profile doesn't fit these requirements.

The bottom line is that you should select the option that suits you the most. If you tried to adapt a hardened profile to your personal preferences, it wouldn't be hardened anymore.

2
  • I agree that you can't merge all profiles, but I think there's nothing bad about merging systemd and hardened. Using a merged profile is convenient, because you don't need to apply all systemd adjustments manually.
    – fremon
    Commented Dec 10, 2016 at 21:58
  • You can do that but you are also making a much less reliable profile than the default which has been tested on multiple systems. If you need systemd, take a profile that already has it unless you want an unmaintainable and possibly unreliable installation. Commented Dec 11, 2016 at 3:31
0

To use two profiles create a local repository (see https://wiki.gentoo.org/wiki/Overlay/Local_overlay) and create a new profile in there. In your new profile simply import both systemd and hardened profile. /usr/portage/profiles/targets/systemd /usr/portage/profiles/hardened/linux/amd64

Example script by a fellow Gentoo user showing all necessary steps:

    #!/bin/bash
    mkdir -p /etc/portage/repos.conf /var/lib/overlay/local/metadata /var/lib/overlay/local/profiles/hardened/linux/amd64/systemd
    printf "[local]\nlocation = /var/lib/overlay/local\nmasters = gentoo\npriority = 100\nauto-sync = no\n" > /etc/portage/repos.conf/local.conf
    echo "masters = gentoo" > /var/lib/overlay/local/metadata/layout.conf
    echo "local" > /var/lib/overlay/local/profiles/repo_name
    printf "amd64\t\thardened/linux/amd64/systemd\t\t\t\tstable\n" > /var/lib/overlay/local/profiles/profiles.desc
    echo "5" > /var/lib/overlay/local/profiles/hardened/linux/amd64/systemd/eapi
    printf "/usr/portage/profiles/hardened/linux/amd64\n/usr/portage/profiles/targets/systemd\n" > /var/lib/overlay/local/profiles/hardened/linux/amd64/systemd/parent

Now you can select your custom profile from eselect profile list.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .