zigford.org

About | Links | Scripts
Sharing linux/windows scripts and tips

Live on 64-bit Raspberry Pi 4 with Gentoo

August 15, 2019 — Jesse Harris

I recently wrote that the site is now hosted from the raspberry pi 4.

Read more...

Converting VHS and DV to Modern Formats - Part 1

May 26, 2019 — Jesse Harris

Over the past 10 years I've been meaning to convert my family's VHS tapes to a modern format. Originally that would have been DVD, but as it seems that DVD and Blu-Ray would have a limited lifespan, I've opted to go directly to modern encoding formats.

Read more...

Snaps on Gentoo - The saga continues

February 10, 2019 — Jesse Harris

A while ago I posted about Snaps on Gentoo, about why and how to get it working. Sometime after that post, snaps stopped working and I didn't have the time to investigate.

Until last week that is.

Read more...

Gentoo local overlay

September 18, 2018 — Jesse Harris

I find myself having to create a local overlay to test/develop a new ebuild without affecting my main system from time to time. I usually fire up a clean kvm Gentoo guest to start working on, but I've usually forgotten the proceedure

This is a quick instruction on a straight-forward local overlay

  1. Create the local path tree where the overlay will reside:

    mkdir -p /usr/local/portage/overlay/{metadata,profiles}
    
  2. Create the layout.conf file and repo_name file

    cd /usr/local/portage/overlay
    echo "masters = gentoo" > metadata/layout.conf
    echo  "$(hostname)" > profiles/repo_name
    
  3. Create a repos.conf file:

    cat <<EOF>/etc/portage/repos.conf/$(hostname).conf
    [$(hostname)]
    location = /usr/local/portage/overlay
    auto-sync = no
    priority = 10
    EOF
    

done.

Now you can begin to populate the local repo with custom ebuilds. I usually do this and then upload my new ebuild to my github repository.

See also:

repos.conf, Custom Repository

Tags: gentoo, portage-overlay

Snaps on Gentoo

August 12, 2018 — Jesse Harris

Update

The instructions to get snaps working on gentoo here are outdated. See my current post Snaps on Gentoo - The saga continues

Why?

Many will think it is heresy to put binary packages on a Gentoo system let alone a package system which encourages binary packages to come with their own set of shared libraries.

While I tend to agree, the practicality of sticking to this arrangement can be difficult for a couple of cases. Here are a few I can think of:

  • Source not available
  • No binary package or source ebuild for Gentoo
  • ebuild takes too long to compile

In the case of ebuilds taking too long (eg. chromium), I have a limited budget and can't really afford to leave my power hungry desktop on 24/7 to keep chromium builds up-to-date.

Here are a quick list of software that I use which fall into one of these categories:

  • Citrix Reciever
  • Powershell (Available as source, but no ebuild and I haven't had the time to try write one myself)
  • Minecraft (Gaming with the kids)
  • Discord (Chatting with games)
  • Chromium (Primarily a firefox user, but have some trouble with getting it to see and work with Citrix)

With my excuses for putting snap's on Gentoo out of the way, here is how I've got it working for my systems.

Overlay

There are a few overlay's for Gentoo out there. Even an official one maintained (or as the case may be, unmaintained) by zyga from Canonical. I tried that one, and many of the forks with no such luck.

After googling around I stumbled on a thread on snapcraft.io and a post from user jamesb192 about the progress on their snapd overlay.

JamesB192 overlay works, but it doesn't have an overlay.xml file for adding with layman. To overcome this, I've hosted one on my site here. You can add this to your system using overlay like this:

        echo app-portage/layman git >> /etc/portage/package.use/layman
        emerge app-portage/layman
        layman -o http://jesseharrisit.com/overlay.xml -f -a gentoo-zigford

Now that you have the overlay installed should be able to emerge snapd like so:

        emerge app-emulation/snapd

Note - You may need to adjust your kernel config and the ebuild is pretty good at highlighting which options need to be set.

Issues

During my testing of snaps on Gentoo, I've come across a couple of issues that either have been solved or could be solved in the ebuild

  1. snap packages only install and run as root (This was solved by setting suid on /usr/lib64/snapd/snap-confine, and solved in ebuild 2.34)
  2. /var/lib/snapd not created (manually mkdir the directory)

Final thoughts.

Snap packages feel like a great augmentation for Gentoo. It allows me to keep using Gentoo as a daily driver and augment some of it's missing packages with packages from more popular distros.

Tags: gentoo, snaps, overlay

Downgrade Gentoo from testing to stable

August 05, 2018 — Jesse Harris

At some point in my main Gentoo boxes life I added the ~amd64 keyword into my make.conf. I don't remeber why I did this, but I can't think of a reason I need my entire install to be bleeding edge.

I did some googling around on the best approach to achieve this and from what I read on forums, having a bunch of testing packages downgrade to stable is not such a good idea.

One reason might be that per app config files are usually only designed to be backward compatible, not forward compatible.

At any rate, the idea is to gather a list of currently installed testing packages and add them to package.keywords for their current version.

With this method, eventually those packages will become stable.

The method I used is basically from the sabayon wiki with a few tweaks.

  1. First, edit make.conf ACCEPT_KEYWORDS to:

    ACCEPT_KEYWORDS=amd64
    
  2. Now use equery, sed and grep to construct a new packge.keywords

    equery -C -N list -F '=$cpv $mask2' '*' | \
        grep \~ | sed 's/\[~amd64 keyword\]/~amd64/' > \
        /etc/portage/package.keywords/testpackages
    

    Basically I added '-C' to remove colours and grep

  3. Examine testpackages for sanity, and then test with a world upgrade.

    emerge --ask --update --newuse --deep --with-bdeps=y @world
    
    
    These are the packages that would be merged, in order:
    
    
    Calculating dependencies... done!
    
    
    Nothing to merge; quitting.
    

Tags: gentoo, portage

Using the latest vim on Gentoo

May 22, 2018 — Jesse Harris

Most people (including myself until recently), think of Gentoo as a bleeding edge source distribution. This is pretty far from accurate as most packages marked stable are quite out of date. And even if you decide to accept all unstable packages by adding:

        ACCEPT_KEYWORKS="~amd64"

to your make.conf file, you will likely be a bit disappointed when you can't get the latest gnome bits.

As my last post indicated, I'm a bit of a vim user and I want to have the latest vim on all my machines (Windows at work, WSL/Ubuntu 18.04 on the Windows box, and Gentoo at home). To that end, here is the simple thing you need to do to get the latest Vim on Gentoo:

Overview

  1. Add a special keyword to vim's ACCEPT_KEYWORDS var
  2. Unmerge existing vim
  3. emerge the new vim

Keywords

Newer versions of portage allow /etc/portage/package.keywords to be a directory with simple files so that you can seperate files for seperate packages. Now, lets check if it is a file or dir and convert it if it is a directory.

    cd /etc/portage
    if test -f package.keywords; then
        mv package.keywords keywords
        mkdir package.keywords
        mv keywords package.keywords/
    fi

And now, lets use the special keyword for the vim package which will allow ebuilds from github

    echo app-editors/vim "**" > package.keywords/vim
    echo app-editors/gvim "**" >> package.keywords/vim
    echo app-editors/vim-core "**" >> package.keywords/vim

Unmerge existing vim

    emerge --unmerge app-editors/vim app-editors/gvim

Merge the new vim

    emerge app-editors/vim app-editors/gvim

Final thoughts.

This is the way I did it, but thinking about it now, it may be unnessecary to unmerge vim. You could probably get away with running emerge --update vim gvim

Tags: gentoo, vim, git, ebuild

Burning a DVD Video on Gentoo

May 15, 2018 — Jesse Harris

Quick note for my future self

Overview

  1. Convert media to dvd compatible format
  2. Author DVD title
  3. Author DVD Table of Contents
  4. Convert DVD folder to ISO
  5. (Optional) Loopback mount ISO and test.
  6. Burn ISO to DVD

Packages Required

media-video/ffmpeg
media-video/dvdauthor
app-cdr/dvd+rw-tools

Commands

Start by using ffmpeg to convert the media to a dvd compatible format:

        ffmpeg -i Big\ Buck\ Bunny.mp4 -target pal-dvd BigBuckBunny.mpg

Now use dvdauthor to author a title

        dvdauthor -t -o dvd --video=pal -f BigBuckBunny.mpg

Add a table of contents

        dvdauthor -T -o dvd

Create the ISO file

        mkisofs -dvd-video -o BigBuckBunny.iso dvd/

(Optional) Mount to a loopback for testing

        mkdir mount
        mount -o loop BigBuckBunny.iso mount/

Play the video using VLC or some other tool to check it, then unmount

        umount mount/

Burn to a disc

        growisofs -dvd-compat -Z /dev/sr0=BigBuckBunny.iso

Credit to andrew.46 over at the ubuntuforums

Tags: burn-a-dvd, gentoo, ffmpeg, linux