Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: Run GNOME 3.14 under OpenRC on Gentoo (no systemd!)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 409

PostPosted: Sun Nov 30, 2014 11:46 am    Post subject: HOWTO: Run GNOME 3.14 under OpenRC on Gentoo (no systemd!) Reply with quote

Warning - this project should be treated as a 'proof of concept' only - I am not a Gentoo dev, and you'll be going way off piste by trying this...

Hello,

like GNOME 3, but systemd not so much?

Then you might want to have a look at my funtoo-2-gentoo shim overlay on GitHub. The link is here (and includes a bootable live-USB image, so you can quickly try it out).

The shim lets you use Dantrell B.'s funtoo-gnome overlay within Gentoo, and thereby run GNOME 3.14 under OpenRC, rather than systemd ^-^

Dantrell's overlay?? What's that all about?

Dantrell's funtoo-gnome overlay is an officially supported component of the Funtoo distribution (a Gentoo spin-off by Gentoo's original chief architect, Daniel Robbins). It provides around 350 modified ebuilds, which patch the GNOME system (and a number of its key dependencies), so that it can run under OpenRC and consolekit. The user experience (modulo any hidden bugs!) is essentially identical to the 'stock' systemd-requiring variant. Previously, this overlay could not be used directly by Gentoo users, due to differences between Funtoo and Gentoo (modular profile USE flags, masked packages, missing ebuilds etc.)

And that's exactly where funtoo-2-gentoo comes in - it acts as a shim, provides a new profile (default/linux/amd64/13.0/desktop/gnome/funtoo), and sorts all this unpleasantness out for you.

Won't this take me a day or so to emerge?

As mentioned above, to help you evaluate this with minimum overhead, I've provided a complete, operational live-USB Gentoo image (download instructions here). (Be advised though, the compressed image is 978MiB, so you'll need a fast connection.)

You can write this to a USB key (>= 8GB), boot your PC with it, and try out Gentoo + GNOME 3.14.1 + OpenRC immediately, without affecting any existing system you may have installed on your machine's hard drive. The image has persistence, includes support for a reasonable set of graphics cards (Intel, Radeon, VirtualBox and NVIDIA/nouveau, plus vesa), and has its Portage tree etc. set up too, so you can emerge additional packages immediately (although you don't have to build anything extra, if you just want to try out GNOME - it's fully installed already for you). You can even use the live-USB as the basis to install a new system quickly (if you don't want to go through the lengthy GNOME package set emerge).

Where can I find out more?

Full instructions (for creating/using the live-USB, installing from the live-USB, and installing from source) are provided on the project's GitHub wiki.

Have fun ^-^

PS If a friendly Gentoo dev out there would like to 'adopt' this shim (or rewrite it completely!), I'd be very happy to transfer it over! (contact details are on the GitHub site)

PPS - contributors to the funtoo-gnome-overlay project (which this shim leverages, and where all the heavy lifting actually happens) are: Dantrell B., Daniel Robbins, Jean-Francis Roy and Oleg Vinichenko.
_________________
Regards,

sakaki
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sun Nov 30, 2014 12:27 pm    Post subject: Re: HOWTO: Run GNOME 3.14 under OpenRC on Gentoo (no systemd Reply with quote

Nice work Sakaki. :-)
Sakaki wrote:
Then you might want to have a look at my funtoo-2-gentoo shim overlay on GitHub. The link is here (and includes a bootable live-USB image, so you can quickly try it out).

The shim lets you use Dantrell B.'s funtoo-gnome overlay within Gentoo, and thereby run GNOME 3.14 under OpenRC, rather than systemd ^-^

Previously, this overlay could not be used directly by Gentoo users, due to differences between Funtoo and Gentoo (modular profile USE flags, masked packages, missing ebuilds etc.)

What are "modular profile USE flags" all about, and how did you sort that issue out?
Quote:
And that's exactly where funtoo-2-gentoo comes in - it acts as a shim, provides a new profile (default/linux/amd64/13.0/desktop/gnome/funtoo), and sorts all this unpleasantness out for you.

It's great for unstable, which is precisely how things come into Gentoo.

I'm a bit concerned about the suppress-underlay and suppress-underlay-shim mask files, which say:
Code:
# Ensure gentoo repo doesn't override funtoo-gnome on version bump
and:
Code:
# Ensure gentoo repo doesn't override funtoo-2-gentoo on version bump
as they look like they're going to require continuous maintenance.

Hmm "best-visible" calc would appear to require it; just wondering if some of the newer layout.conf fanciness doesn't cover this use-case. (anyone?)
Back to top
View user's profile Send private message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 409

PostPosted: Sun Nov 30, 2014 2:02 pm    Post subject: Re: HOWTO: Run GNOME 3.14 under OpenRC on Gentoo (no systemd Reply with quote

steveL wrote:
What are "modular profile USE flags" all about, and how did you sort that issue out?


I was referring to Funtoo's profile system, which lets you choose multiple 'flavors' and 'mix-ins' (some of which are auto-selected) to create your net profile. See this link.

Basically I aggregated the various package.use files required for a baseline GNOME install on Funtoo (top-level, core flavor, workstation flavor, audio mix-in, console-extras mix-in, dvd mix-in, gnome mix-in, media mix-in, print mix-in, and X mix-in, but omitting arch) in package.use (as a folder in the new profile target), and did a similar thing for the make.defaults (although I had to put that in a single file, Portage doesn't seem to let you have make.defaults as a folder in an overlay). Then I used the parent file to inherit from Gentoo's (non-systemd) gnome profile too (since we need most of that stuff, and it is pretty common across {Fun,Gen}too).

As to the suppress-underlay/suppress-underlay-shim masks, they are autogenerated via the following simple script (not very elegant I'm afraid, haven't got round to cleaning it up yet, but here it is):
Code:

#!/bin/bash
# (c) 2014 sakaki
# GPL-3+ NO WARRANTY

# create mask set for funtoo-gnome overlay
# ensures all packages supplied in overlay do NOT get supplied by the underlay
# it would be nicer to use a ::repo tag here, but this is not allowed
# in profiles
# TODO use bash fn, clean up sort field ref, maybe rewrite in Python or something sane...

SOURCE_OVERLAY="${HOME}/repos/funtoo-gnome-overlay"
SHIM_OVERLAY="${HOME}/repos/funtoo-2-gentoo"
SOURCE_MASK="${SHIM_OVERLAY}/profiles/targets/funtoo/package.mask/suppress-underlay"
SHIM_MASK="${SHIM_OVERLAY}/profiles/targets/funtoo/package.mask/suppress-underlay-shim"
echo "Creating mask to prevent underlay hijack..."
echo "# Ensure gentoo repo doesn't override funtoo-gnome on version bump" > "${SOURCE_MASK}"
for x in $(find "${SOURCE_OVERLAY}" -name '*.ebuild' | sed "s@$SOURCE_OVERLAY/@@"); do
    HEAD="${x%-[[:digit:]]*}"
    HEAD="$(cut -d '/' -f 1,3 <<< "${HEAD}")"
    SUB=$(echo "${x%-[[:digit:]]*}")
    VER="$(sed "s@${SUB}-@@" <<< "${x}" | sed "s@.ebuild@@")"
    SLOT="$(equery list -o -F '$slot' ${HEAD}-${VER})"
    MSLOT="$(cut -d '/' -f 1 <<< "${SLOT}")" # only interested in major slot here
    echo "${HEAD} ${MSLOT} ${VER}"
done | sort -V -r | awk '{ print $3 " " $1 " " $2  }' | uniq --skip-fields=1 |\
    awk '{ print ">" $2 "-" $1 ":" $3 }' | sort >> "${SOURCE_MASK}"
echo "Done; mask set written to ${SOURCE_MASK}"

# do again for our own stuff
echo "Creating mask to prevent underlay hijack (of shim)..."
echo "# Ensure gentoo repo doesn't override funtoo-2-gentoo on version bump" > "${SHIM_MASK}"
for x in $(find "${SHIM_OVERLAY}" -name '*.ebuild' | sed "s@$SHIM_OVERLAY/@@"); do
    HEAD="${x%-[[:digit:]]*}"
    HEAD="$(cut -d '/' -f 1,3 <<< "${HEAD}")"
    SUB=$(echo "${x%-[[:digit:]]*}")
    VER="$(sed "s@${SUB}-@@" <<< "${x}" | sed "s@.ebuild@@")"
    SLOT="$(equery list -o -F '$slot' ${HEAD}-${VER})"
    MSLOT="$(cut -d '/' -f 1 <<< "${SLOT}")" # only interested in major slot here
    echo "${HEAD} ${MSLOT} ${VER}"
done | sort -V -r | awk '{ print $3 " " $1 " " $2  }' | uniq --skip-fields=1 |\
    awk '{ print ">" $2 "-" $1 ":" $3 }' | sort >> "${SHIM_MASK}"
echo "Done; mask set written to ${SHIM_MASK}"


This is run by a hook when I push either my fork of funtoo-gnome, or funtoo-2-gentoo, to GitHub.
_________________
Regards,

sakaki
Back to top
View user's profile Send private message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 409

PostPosted: Tue Dec 02, 2014 6:03 pm    Post subject: Reply with quote

Thanks to everyone who tried out my GNOME 3.14.1 / OpenRC live-USB image (or installed from source), and emailed me feedback ^-^

Two points have come up a few times, so I'll quickly summarize them here for future users:

1) I can't play MP4 files! / youtube doesn't work!

The image provides GNOME 3.14.1 in its 'default' state (which is what you end up with if you follow the install-from-source instructions too). However, just as for the systemd-variant, baseline GNOME has an issue with a missing H264 codec, so you won't be able to play .mp4 files in Totem, watch youtube videos in Web, etc. until you install one.

To fix this, simply open a terminal in GNOME, get root and issue:
Code:
# emerge --ask --verbose media-plugins/gst-plugins-libav

Once complete, restart Totem/Web, and you should be good to go! (I should probably have included this in the image, sorry about that! >< )

2) You say the image includes VirtualBox video drivers, but how do I get it running in VirtualBox?

If you want to run the image in VBox (as opposed to booting it directly on your PC, which of course you can do too), it's relatively straightforward (and you don't even need a USB key, if you go this route!).

First, download the compressed image, genome.img.xz, as described here. You can do this as your regular user (btw, the following assumes your user is in the disk and vboxusers groups; if not, please address that as root before proceeding, and then re-login as that regular user).

Next (as your regular user), decompress the image file:
Code:
user ~$ xzcat genome.img.xz > genome.img


Now create a VBox disk wrapper for this (with modern versions of VirtualBox (mine is 4.3.20), there is no need to create a loopback device):
Code:
user ~$ VBoxManage internalcommands createrawvmdk -filename genome.vmdk -rawdisk genome.img
RAW host disk access VMDK file genome.vmdk created successfully.


You can now (still as your regular user) open the familiar VirtualBox manager GUI, and click on the "New" icon in the taskbar.
Call your new VM something like "Gentoo GNOME test", and the type ("Linux") and version ("Gentoo (64 bit)") should automatically be set for you in the dialog. Click "Next >"
Set the memory to something sensible (at least 2GB), and click "Next >"
Then, select "Use an existing virtual hard drive file", click on the little yellow folder icon beside it, and navigate to the "genome.vmdk" file you just created; then click "Open", then "Create".
Your base VM is now ready to go. Choose any other options you like, and when ready, click the "Start" icon in the taskbar, and your VM should start up, as if it were a PC with the USB key inserted!

After this, just follow the rest of the standard instructions. Persistence etc. should still work.

Hope that helps!
_________________
Regards,

sakaki
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Wed Dec 03, 2014 11:34 pm    Post subject: Re: HOWTO: Run GNOME 3.14 under OpenRC on Gentoo (no systemd Reply with quote

Sakaki wrote:
I was referring to Funtoo's profile system, which lets you choose multiple 'flavors' and 'mix-ins' (some of which are auto-selected) to create your net profile. See this link.

Basically I aggregated the various package.use files required..

Ah OK, yeah I know about those. Nice work. :-)
Quote:
As to the suppress-underlay/suppress-underlay-shim masks, they are autogenerated via the following simple script (not very elegant I'm afraid, haven't got round to cleaning it up yet, but here it is)

So maintenance isn't an issue, fair enough. You really need to join #bash but in this case I think you should also explore eix. I'm fairly certain it's got something that'll be of use here, though I'd have to ask mv for specifics.

Hopefully he'll check in soon, if he's not too busy with work.

As-is your version code is a bit dodgy, but there's no point learning how to do it in bash, which is quite complex, when you can let a custom-tool do everything, much more quickly.
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Thu Dec 04, 2014 1:13 pm    Post subject: Reply with quote

funtoo's downstream from gentoo. our portage is like 1 user pulling a gentoo sync and redistributed with patches and tweaks... they dont want the sync over writing the tweaks and patches.
Back to top
View user's profile Send private message
Sakaki
Guru
Guru


Joined: 21 May 2014
Posts: 409

PostPosted: Thu Dec 04, 2014 7:27 pm    Post subject: Re: HOWTO: Run GNOME 3.14 under OpenRC on Gentoo (no systemd Reply with quote

steveL wrote:
You really need to join #bash but in this case I think you should also explore eix. I'm fairly certain it's got something that'll be of use here, though I'd have to ask mv for specifics.

Hopefully he'll check in soon, if he's not too busy with work.

As-is your version code is a bit dodgy, but there's no point learning how to do it in bash, which is quite complex, when you can let a custom-tool do everything, much more quickly.


Thanks for the hint to dig around eix! I use it day-to-day for routine package queries, but hadn't thought of using it in this context.

So, assuming /etc/portage/package.mask is a directory, and that the script runs in the same ACCEPT_KEYWORDS context etc. as the target system, I can rewrite my little mask-generator as follows:

Code:
#!/bin/bash
# (c) 2014 sakaki
# GPL-3+ NO WARRANTY

create_underlay_mask() {
    # pass repo name as first param

    # ensure main repo is temporarily ignored...
    echo "*/*::gentoo" > /etc/portage/package.mask/temp-gentoo-mask
    # now get eix to create the underlay mask
    EIX_LIMIT=0 PRINT_COUNT_ALWAYS=never SLOTTEDMASK="><category>/<name>-<version>:<slot>\n" \
        eix --in-overlay "${1}" --format "<bestslotversions*:SLOTTEDMASK>" | grep "^>" | sort
    # lastly, unmask main repo again, or we'll break everything!
    rm -f /etc/portage/package.mask/temp-gentoo-mask
}

SOURCE_MASK="${HOME}/repos/funtoo-2-gentoo/profiles/targets/funtoo/package.mask/suppress-underlay"
SHIM_MASK="${HOME}/repos/funtoo-2-gentoo/profiles/targets/funtoo/package.mask/suppress-underlay-shim"

eix-update
echo "# Ensure gentoo repo doesn't override funtoo-gnome on version bump" > "${SOURCE_MASK}"
create_underlay_mask "funtoo-gnome" >> "${SOURCE_MASK}"
echo "# Ensure gentoo repo doesn't override funtoo-2-gentoo on version bump" > "${SHIM_MASK}"
create_underlay_mask "funtoo-2-gentoo" >> "${SHIM_MASK}"


(updated post to show final working version of script)

As you say, it's very fast, but the need to temporarily mask "*/*::gentoo" while invoking eix concerns me a bit... maybe there's some option in eix that I'm missing here? (If you don't mask ::gentoo, and there is a version of package a/b in the underlay which trumps those in your overlay, that version will be chosen by eix as 'best' for a/b and end up in the underlay mask file, which defeats the whole point of the exercise.)

PS just for the record, my released bash scripts (buildkernel, for example) are usually a tiny bit better formed than the cobbled-together fragment I posted earlier /><
_________________
Regards,

sakaki
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum