runit openrc gentoo

I decided to have another go at runit, this time on my gentoo.

I had been thinking about this, since I noticed this on

tmux mouse scroll

I keep running into this issue, as tmux changed it's mouse behaviour. To make it work again, add the following code snippet into your ~/.tmux.conf

set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M

and reload the changed tmux configuration
$ tmux source ~/.tmux.conf

git Gentoo Portage repos on GitHub

git me! The gentoo repos are on github2, and I've just discovered them.. mysteriously hidden in the World Wide Web ;)

There is a post on the gentoo forums from 2015, re git/github saying:
Although some developers wrongly still recommend plain rsync-update method, you should never do that, since it is fundamentally insecure (emerge-webrsync is signed by a machine key, but still better). 

You should instead start to sync via git (best do that from github, unless you want to break our infra server).

The Monolithic Cabals

A few decades ago, there was a great big flame war called the Monolithic vs Microkernel debate[1], between Andrew Tanenbaum (minix) and Linus Torvalds (linux). It is said that the debate was won by Linus, and that is why #linux became more popular.

I am a fan of Microkernels. But I am even more a fan of Open Source. I believe that is the sole reason Linux became popular, not because people loved a monolithic architecture. Folks embraced it because it was #opensource.

A Digital Beep

When you don't have a Speaker/Bell, or you can't make quite make it sound, and you want a beep!

i3 wm

I've been hearing about i3 Window Manager for a while now, and had been waiting to have a go. I finally did.

I love all the features listed on the homepage, particularly:
"Don’t be bloated, don’t be fancy (simple borders are the most decoration we want to have)."

As for me, I disable or hide the titlebars and even the borders :)

softvol boost increase alsa volume

One thing I liked with pulseaudio was increasing the volume to more than 100%. Although audiophiles may disagree, I need to increase the volume beyond 100% so I could hear some movies with low sound particularly voice dialogues.

I missed that feature in alsa. It turns out that this is built-in. Not many know about this, and those who do have issues configuring alsa softvol.

After trawling through much www research, this is what works for me. All one needs is a properly configured ~/.asoundrc file.

$ cat ~/.asoundrc
defaults.pcm.!card 0
defaults.pcm.!device 0
defaults.pcm.!ctl 0

pcm.!default {
    type asym
    playback.pcm "plug:softvol"
    capture.pcm "plug:dsnoop"
}
pcm.softvol {
    type softvol
    slave.pcm "dmix"
    control { name "PCM"; card 0; }
    #max_dB 32.0
    max_dB 20.0
    min_dB -5.0
}

Note that this uses PCM as your volume slider. So config your volume hotkeys (or triggers) to manipulate PCM, rather than Master. Set your Master level to 100% or whatever max suitable, and increase/decrease PCM for audio volume.

gentoo portage

ref: http://wiki.gentoo.org/wiki/portage

Gentoo is Portage. Portage is Gentoo.

Getting portage settings right is vitally important. It's not the end of the world, if you don't. But you sure will expend a lot of your time staring at the matrix flowing past, as you compile everything yet again one more time..

dash system & login shell

dash is more efficient than bash in all respects, except perhaps for interactive use. and i always replace system default, root, and login shells to dash.

gentoo second install x86 btrfs debian

Now that my Gentoo Phase 2 has been put on hold for the near future, I have to satisfy this itch to install gentoo on my main laptop. Having it on my primary rig, would allow me to use it more often than pulling out my backup system.

My blind first attempt, at a gentoo install, gave me a lot of confidence in the gentoo community. This second attempt substantially lessens the time/aggro I spent previously installing gentoo.

gentoo phase 2

My first attempt boosted confidence in gentoo (and it's community) beyond expectation. So much that the debian to gentoo transition continues to gather pace.

In all my systems, I have always replaced the full fledged (bloatware?) tools with minimal busybox, wherever I could. Busybox is stable, and fulfils all my requirements rather nicely. This led me to voidlinux which has that same ethos in it's core. It is a great booster that gentoo could satisfy me on this count too.

debian boot kernel panic

Debian kernel or initramfs seems to have intermittent kernel panic at boot time. I have had these on & off over many kernels/upgrades. Many times, this problem seems to go away after a few hours or days. Till then, I dual-boot one of my other systems.

How to WiFi: wpa_supplicant + systemd

I don't prefer systemd, but sometimes you can't avoid demandware. Below is my how to wifi with systemd. This method now works with all distros

wpa_supplicant dhcpcd systemd debian

The leanest cleanest way to connect to wpa/2 networks is wpa_supplicant. Optional wpa_gui provides a GUI and System Tray icon, if need be. All other applications are bloat, building additional layers and too complexity. Goodbye Gnome/NetworkManager!

Since moving to systemd chasing the gnome dragons, the debian ecosystem has broken down. Many debian ways of doing things have since become invalid

Installing Gentoo: multiple gentoo installs & maintenance

so my question is about the most efficient way to gentoo all these above computers, perhaps from one of my computers, and (sync??) transfer update all the others. i think i will probably use the same profile & flags on all computers, to keep it simpler.

tar backup restore

identify and mount directories/devices for backup sources and targets, i.e.
-- backup, which directory
-- backup, to which file, located where

tar - tape archiver
http://gnu.org/software/tar/manual
$ tar --help
some useful options
$ man tar
-c, --create
create a new archive

-t, --list
list the contents of an archive

-x, --extract, --get
extract files from an archive

-a, --auto-compress
use archive suffix to determine the compression program

-f, --file=ARCHIVE
use  archive file or device ARCHIVE

--numeric-owner
always use numbers for user/group names

--owner=NAME
Force NAME as owner for added files.

--one-file-system 
stay in local file system when creating archive

-p, --preserve-permissions, --same-permissions
extract information about file permissions (default for superuser)

--show-defaults
show tar defaults

--ignore-failed-read
Do not exit with nonzero on unreadable files.

-v, --verbose
verbosely list files processed

--xattrs
enable extended attributes support

backup
descend into directory, and tar current directory avoiding absolute pathname risks
$ cd {backup-directory}
$ sudo tar --ignore-failed-read --one-file-system --numeric-owner --xattrs -capf /mnt/backup/{backup-filename}.tar.xz .

restore
descend into target directory, and untar
$ cd {target-directory}
$ sudo tar --one-file-system --numeric-owner --xattrs -xapf /mnt/backup/{backup-filename}.tar.xz

combine tar with netcat to backup/restore across the network, significantly more efficient as the same system is not reading/writing at the same time, unless you are on a slow network.

gentoo kernel compile

I seem to be doing this so often that I need a ready reference. So here's a post :)

This sound device does not have any controls

I have no sound, on my recent gentoo install.

LXQT Mixer wouldn't open. I don't even get any error/warning messages. This is not good.

So I try alsamixer.

$ alsamixer
...
This sound device does not have any controls.

Installing Gentoo: su permission denied

i can't seem to su. i know i'm typing the correct passwords.

$ su anotheruser
Password: 
su: Permission denied

basically su would allow you to become that user, if you knew that user password. simple.

sudo to become that user without knowing that user password.. sounds strange? but there are many use cases where this is very handy.

i've been using a combination of the two above, all along. till now..

gentoo install x86 btrfs

this as a quick start guide to the much longer and more comprehensive gentoo handbook. but please understand what i have done, and not blindly copy. you should definitely read the gentoo install handbook a few times before even attempting an install.

Installing Gentoo: .keep files

what are all these .keep files littered all over the filesystem? they all seem to be empty. if they are not needed, can i delete them?

Installing Gentoo: too much diskspace used

how can i reduce the clutter? my main aim in moving to gentoo was to have and maintain a stable, lean & clean system.

Installing Gentoo: how to list all installed packages

So many ways to list all installed packages. This topic is like a ready reference.

Installing Gentoo: dependency hell?

I have always been a minimalist.. Bigger is not always better. Efficiency is the key.

This particular post helped get a better understanding of Portage, the heart of Gentoo.

Installing Gentoo: emerge-webrsync first run errors

Update: I have now migrated to git sync, as suggested by Buffoon.

Gentoo Chat: noob coming over

Just like life, seemingly unimportant things that we do, later on prove to be make or break incidents.

My first post in Gentoo Forums, while installing for the first time. I didn't expect much when I posted this, but later proved to be a life-saver to my Gentoo life. If not for these initial posts and these lovely folks, I probably might not have continued on with Gentoo.

gentoo first attempt

i finally decided to jump in, and created another btrfs partition for gentoo with two subvolumes. with btrfs i don't have anything on the root subvolume.

i really didn't expect an install to drag on for so long. i don't like to give up part-way, unless i feel it is a lost investment.. and i was losing it! i would have, but for some kindly folks on the gentoo forum. the gentoo forum is one of the most responsive and helpful forums i have been in.

multiboot btrfs subvolumes

this idea has been knocking around in my head for a while. i want to document it, while it is still there and to flush it out later..

i usually multiboot, and have several operating systems on the same disk. my currently laptop has about dozen+ partitions. each os is fully contained within a partition, including the bootloader on pbr. mbr is clean.

debian to gentoo

as debian builds more & more complexity/layers obscuring internals from users, i get more & more disillusioned by the current crop of debian decision-makers. jessie, the current debian stable seems no longer stable, and an unstable init at it's core.

wheezy is/was the last stable version gone oldstable now. oldstable is expected to be even more stable than stable. but recent updates have littered wheezy with systemd and ubuntu garbage including upstart. even oldstable has had more than a few days downtime recently, due to buggy updates. sad debian :(

bios acpi dsdt

bios: basic input/output system
acpi: advanced configuration power interface
dsdt: differentiated system description table
wheezy32: debian wheezy 32bit
arch32: arch 32bit

toshiba bios seem to be one of the most notorious and worst broken. do not choose toshiba for anything but windows, and even with that be careful. dodgy bios implementations are like broken foundations to build your home, if you want to live there yourself!

identify

so how do you identify, if your bios is broken/buggy? check kernel logs:
$ dmesg -l err
toshiba_acpi: Error reading LCD brightness
indicates direction of problems. this error points towards a buggy implementation of acpi by toshiba.

$ dmesg | grep DSDT
ACPI: DSDT 0x00000000B7CEF000 095BA (v01 TOSINV TOSINV00 00000001 MSFT 01000013)
TOSHIBA Satellite detected - force copy of DSDT to local memory
ACPI: Forced DSDT copy: length 0x095BA copied locally, original unmapped
ACPI: EC: Look up EC in DSDT
indicates that bios data is (used as original, forced) not overidden.
msft indicates that toshiba bios is specific to microsoft, particular to a windows version.
poor strategy, unless they were paid-off by microsoft.

confirm

how do you confirm whether bios provided data is usable? decompile & recompile.
a successful recompile, no errors/warnings indicates a good bios! and this has nothing to do with any operating system.

we need iasl, for this purpose.

$ apt-cache show iasl
Description: Intel ASL compiler/decompiler
 iASL compiles ASL (ACPI Source Language) into AML (ACPI Machine
 Language). This AML is suitable for inclusion as a DSDT in system
 firmware. It also can disassemble AML, for debugging purposes.
Homepage: http://acpica.org
# apt-get install iasl
$ iasl -h

$ cd /tmp
$ sudo cat /sys/firmware/acpi/tables/DSDT >dsdt.dat
$ iasl -d dsdt.dat
$ iasl -tc dsdt.dsl
the first command reads the dsdt data. do it as root.
the second command decompiles this .dat into .dsl
the third command attempts to compile, thereby generating the errors/warnings we are looking for.

i see this on wheezy32
$ iasl -tc dsdt.dsl
Intel ACPI Component Architecture
ASL Optimizing Compiler version 20100528 [Jul  2 2010]
Copyright (c) 2000 - 2010 Intel Corporation
Supports ACPI Specification Revision 4.0a

dsdt.dsl  3401:                     0x00000000,         // Length
Error    4122 -                              ^ Invalid combination of Length and Min/Max fixed flags

dsdt.dsl  3408:                     0x00000000,         // Length
Error    4122 -                              ^ Invalid combination of Length and Min/Max fixed flags

dsdt.dsl  7148:                         Name (_PLD, Buffer (0x10)
Error    4080 -          Invalid object type for reserved name ^  (found BUFFER, requires Package)

dsdt.dsl  7165:                         Name (_PLD, Buffer (0x10)
Error    4080 -          Invalid object type for reserved name ^  (found BUFFER, requires Package)

dsdt.dsl  7214:                         Name (_PLD, Buffer (0x10)
Error    4080 -          Invalid object type for reserved name ^  (found BUFFER, requires Package)

dsdt.dsl  7231:                         Name (_PLD, Buffer (0x10)
Error    4080 -          Invalid object type for reserved name ^  (found BUFFER, requires Package)

dsdt.dsl  7275:                         Name (_PLD, Buffer (0x10)
Error    4080 -          Invalid object type for reserved name ^  (found BUFFER, requires Package)

dsdt.dsl  7489:                         Name (_PLD, Buffer (0x10)
Error    4080 -          Invalid object type for reserved name ^  (found BUFFER, requires Package)

dsdt.dsl  7506:                         Name (_PLD, Buffer (0x10)
Error    4080 -          Invalid object type for reserved name ^  (found BUFFER, requires Package)

dsdt.dsl  7523:                         Name (_PLD, Buffer (0x10)
Error    4080 -          Invalid object type for reserved name ^  (found BUFFER, requires Package)

dsdt.dsl  7540:                         Name (_PLD, Buffer (0x10)
Error    4080 -          Invalid object type for reserved name ^  (found BUFFER, requires Package)

dsdt.dsl  7557:                         Name (_PLD, Buffer (0x10)
Error    4080 -          Invalid object type for reserved name ^  (found BUFFER, requires Package)

dsdt.dsl  8873:                     Method (_GTM, 0, NotSerialized)
Warning  1088 -                                ^ Not all control paths return a value (_GTM)

dsdt.dsl  8873:                     Method (_GTM, 0, NotSerialized)
Warning  1081 -                                ^ Reserved method must return a value (Buffer required for _GTM)

dsdt.dsl  9033:                         Method (_GTF, 0, NotSerialized)
Warning  1088 -                                    ^ Not all control paths return a value (_GTF)

dsdt.dsl  9033:                         Method (_GTF, 0, NotSerialized)
Warning  1081 -                                    ^ Reserved method must return a value (Buffer required for _GTF)

dsdt.dsl  9101:                         Method (_GTF, 0, NotSerialized)
Warning  1088 -                                    ^ Not all control paths return a value (_GTF)

dsdt.dsl  9101:                         Method (_GTF, 0, NotSerialized)
Warning  1081 -                                    ^ Reserved method must return a value (Buffer required for _GTF)

dsdt.dsl  9174:                     Method (_GTM, 0, NotSerialized)
Warning  1088 -                                ^ Not all control paths return a value (_GTM)

dsdt.dsl  9174:                     Method (_GTM, 0, NotSerialized)
Warning  1081 -                                ^ Reserved method must return a value (Buffer required for _GTM)

dsdt.dsl  9334:                         Method (_GTF, 0, NotSerialized)
Warning  1088 -                                    ^ Not all control paths return a value (_GTF)

dsdt.dsl  9334:                         Method (_GTF, 0, NotSerialized)
Warning  1081 -                                    ^ Reserved method must return a value (Buffer required for _GTF)

dsdt.dsl  9402:                         Method (_GTF, 0, NotSerialized)
Warning  1088 -                                    ^ Not all control paths return a value (_GTF)

dsdt.dsl  9402:                         Method (_GTF, 0, NotSerialized)
Warning  1081 -                                    ^ Reserved method must return a value (Buffer required for _GTF)

dsdt.dsl  9507:                     Method (_GTM, 0, NotSerialized)
Warning  1088 -                                ^ Not all control paths return a value (_GTM)

dsdt.dsl  9507:                     Method (_GTM, 0, NotSerialized)
Warning  1081 -                                ^ Reserved method must return a value (Buffer required for _GTM)

dsdt.dsl  9667:                         Method (_GTF, 0, NotSerialized)
Warning  1088 -                                    ^ Not all control paths return a value (_GTF)

dsdt.dsl  9667:                         Method (_GTF, 0, NotSerialized)
Warning  1081 -                                    ^ Reserved method must return a value (Buffer required for _GTF)

dsdt.dsl  9735:                         Method (_GTF, 0, NotSerialized)
Warning  1088 -                                    ^ Not all control paths return a value (_GTF)

dsdt.dsl  9735:                         Method (_GTF, 0, NotSerialized)
Warning  1081 -                                    ^ Reserved method must return a value (Buffer required for _GTF)

dsdt.dsl  9808:                     Method (_GTM, 0, NotSerialized)
Warning  1088 -                                ^ Not all control paths return a value (_GTM)

dsdt.dsl  9808:                     Method (_GTM, 0, NotSerialized)
Warning  1081 -                                ^ Reserved method must return a value (Buffer required for _GTM)

dsdt.dsl  9968:                         Method (_GTF, 0, NotSerialized)
Warning  1088 -                                    ^ Not all control paths return a value (_GTF)

dsdt.dsl  9968:                         Method (_GTF, 0, NotSerialized)
Warning  1081 -                                    ^ Reserved method must return a value (Buffer required for _GTF)

dsdt.dsl 10036:                         Method (_GTF, 0, NotSerialized)
Warning  1088 -                                    ^ Not all control paths return a value (_GTF)

dsdt.dsl 10036:                         Method (_GTF, 0, NotSerialized)
Warning  1081 -                                    ^ Reserved method must return a value (Buffer required for _GTF)

ASL Input:  dsdt.dsl - 10111 lines, 370896 bytes, 4450 keywords
Compilation complete. 12 Errors, 24 Warnings, 0 Remarks, 37 Optimizations

12 errors, 24 warnings, i.e. not good!
i get the same results on arch32 too.. so don't go blaming wheezy32!

most viewed