GNU/Linux

1. GNU/Linux   linux

ID: ab57dccf-c9f3-4347-b9d0-5731904f3d67
CREATED: <2025-02-09 Sun 13:33>

[2025-03-06 Thu 09:11] >> UNIX [2025-05-02 Fri 15:24] intro(1)

At this point, I don't really care what the non-believers think - if you are not running GNU/Linux as your daily driver, you are wrong. Of course I understand the need to run dedicated Windows and MacOS machines, when it is out of your control - say you have a Macbook or need to run it for %employer. No need to stress about that. But when you are given the opportunity - given a choice, you should pick whatever Linux-based OS suits your needs best.

1.1. User Commands

ID: 4e8a9455-f1ca-4654-8cfa-562735661d69
CREATED: <2025-05-02 Fri 15:25>

In order to start working, you'll probably first have to open a session. The program login(1) will wait for you to type your username and password, and after that, it will start a shell (command interpreter) for you. In case of a graphical login, you get a screen with menus or icons and a mouse click will start a shell in a window. See also xterm(1).

1.2. Libraries

ID: 3e6b5e34-4cf0-4289-afda-bea7c2a343dd
CREATED: <2025-02-14 Fri 22:11>

1.2.1. Ublk   fs

ID: 46fdde04-496d-45b4-a674-367edafb8054
CREATED: <2025-03-04 Tue 17:46>

[2025-06-21 Sat 22:48] Userspace block device driver (ublk driver) — The Linux Kernel documentation

# add device
ublk.loop add -f ublk-loop.img
# fmt
mkfs.xfs /dev/ublkb0
mount /dev/ublkb0 .stash/
# ...
umount .stash/

1.2.2. Tracing   test log

ID: 292a62ff-6d56-42e2-88fa-bd13ddbc2fb1
CREATED: <2025-03-04 Tue 17:48>

[2025-03-04 Tue 17:48] Linux Tracing Technologies — The Linux Kernel documentation

  1. strace
    ID: ef769379-7632-4c45-b933-1e3bfd858ea1
    CREATED: <2025-03-04 Tue 17:49>
    

    [2025-03-04 Tue 17:49] man [2025-03-04 Tue 17:50] strace

  2. perf
    ID: da34bba6-7ca1-4836-91d8-e16ae2a8fcb7
    CREATED: <2025-03-04 Tue 17:49>
    

    [2025-03-04 Tue 17:49] man [2025-03-04 Tue 17:50] brendangregg/perf-tools [2025-03-04 Tue 18:58] Linux perf Examples

  3. iostat
    ID: 7e8d965e-6b39-43bb-a69a-4747977b436f
    CREATED: <2025-03-04 Tue 18:59>
    

    [2025-03-04 Tue 18:59] man

  4. rv
    ID: d77d5ce5-2857-4c17-bcaf-c3eb32f93bcc
    CREATED: <2025-03-04 Tue 19:40>
    

    [2025-03-04 Tue 19:40] Runtime Verification — The Linux Kernel documentation

1.2.3. BPF   log

ID: 97d3d07c-e576-412b-a97a-2879efa998c5
CREATED: <2025-03-04 Tue 19:02>

[2025-03-04 Tue 19:02] BPF Documentation — The Linux Kernel documentation

  1. eBPF
    ID: cb4a79ea-64fa-4c3a-b4bf-f3f731bc04ad
    CREATED: <2025-03-04 Tue 19:03>
    

    [2025-03-04 Tue 19:03] Linux eBPF Tracing Tools

1.2.4. RTLA   test

ID: 378227a0-d265-4272-8013-73df72b5e49a
CREATED: <2025-03-04 Tue 19:06>

[2025-03-04 Tue 19:06] The realtime Linux analysis tool — The Linux Kernel documentation

1.2.5. ioctl

ID: 94f363d8-45a2-4d48-9e25-17b1ac50771a
CREATED: <2025-07-04 Fri 20:10>

1.2.6. Keyutils   crypto

ID: 5e859a3f-0c31-4796-85c6-7008b346f186
CREATED: <2025-02-14 Fri 22:12>

[2025-02-14 Fri 22:12] keyutils(7) - Linux manual page

1.2.7. spidev

ID: 93c4f02f-2b00-4741-98e4-f427530f4875
CREATED: <2025-07-04 Fri 20:02>

1.2.8. Netlink

ID: 25cc1e3f-60f0-401a-a8b6-ac8d5670233d
CREATED: <2025-03-04 Tue 19:14>

[2025-03-04 Tue 19:14] Introduction to Netlink — The Linux Kernel documentation [2025-03-04 Tue 19:14] Netlink Handbook — The Linux Kernel documentation

1.3. Kernel

ID: caed860f-fcef-43a2-b080-94b01352cd43
CREATED: <2025-02-16 Sun 20:12>

[2025-02-16 Sun 20:12] Unreliable Guide To Hacking The Linux Kernel — The Linux Kernel documentation [2025-02-16 Sun 20:12] The Linux Kernel documentation — The Linux Kernel documentation

1.3.1. Kbuild

ID: 43020c04-f96f-4992-ad56-0bbfd4e55321
CREATED: <2025-06-22 Sun 00:11>

[2025-06-22 Sun 00:13] linux/Documentation/kbuild/kbuild.rst [2025-06-22 Sun 00:15] Kbuild — The Linux Kernel documentation

  1. Kconfig
    ID: dae51fae-66d9-4737-9971-999d3f94eadc
    CREATED: <2025-06-22 Sun 00:12>
    

    [2025-06-22 Sun 00:15] Kconfig Language — The Linux Kernel documentation

1.3.2. Devices

ID: ad25b130-d832-4109-84ad-7cb9900ed227
CREATED: <2025-01-17 Fri 19:15>

/dev In Linux, everything is a file.

dev contains special device files - usually block or character device.

major, minor = category, device 0, 5

mknod - create special device files

redhat hints

  1. udev
    ID: bb85c1ce-9a29-4771-b6cf-5f22823ca600
    CREATED: <2025-06-22 Sun 00:16>
    

    [2025-06-22 Sun 00:16] wiki [2025-06-22 Sun 00:17] man

    1. systemd-udevd.service
      ID: 0dcb6857-91e1-4319-ad00-97c742604593
      CREATED: <2025-06-22 Sun 00:18>
      

      [2025-06-22 Sun 00:19] man [2025-06-22 Sun 00:21] -> systemd

  2. utils
    ID: f8ce343e-c866-4fff-8e39-2da32a59d56e
    CREATED: <2025-02-06 Thu 19:16>
    
    dd if=/dev/zero of=myfile bs=1M count=32
    losetup --show -f myfile
    ls -al /dev/loop0
    losetup -d /dev/loop0 #teardown
    
    echo "sup dude" > /dev/loop0
    dd if=/dev/loop0 -bs=1
    dd if=/dev/nvme0 of=/dev/null progress=true
    #pacman -S hdparm
    hdparm -T /dev/nvme0
    
    modprobe scsi_debug add_host=5 max_luns=10 num_tgts=2 dev_size_mb=16
    

    sparsefiles: create with C, dd, or truncate

    truncate --help
    

    test mkfs.btrfs on 10T dummy block device

    dd if=/dev/zero of=/tmp/bb1 bs=1 count=1 seek=10T
    du -sh /tmp/bb1
    losetup --show -f /tmp/bb1
    mkfs.btrfs /dev/loop0
    

    diagnostics

    iostat # pacman -S sysstat
    blktrace # paru -S blktrace
    iotop # pacman -S iotop
    

    bcc/ trace: Who/which process is executing specific functions against block devices?

    bcc/biosnoop: Which process is accessing the block device, how many bytes are accessed, which latency for answering the requests?

    at the kernel level besides BPF we got kmods and DKMS,

    compression/de-duplication can be done via VDO kernel mod

    https://en.wikipedia.org/wiki/Dynamic_Kernel_Module_Support

  3. Frame Buffer Device
    ID: 639e5d85-e143-421d-86be-9bc291bc2f8b
    CREATED: <2025-01-17 Fri 19:15>
    

    [2025-01-17 Fri 19:15] The Frame Buffer Device — The Linux Kernel documentation

    /dev/fb*

    • used by fbgrab/fbcat program
  4. Userspace Block Device
    ID: d58cb494-ce43-49cc-859b-aa6a518ac314
    CREATED: <2025-02-14 Fri 22:11>
    

    [2025-02-06 Thu 19:10] Userspace block device driver (ublk driver)

    ublk https://github.com/ming1/ubdsrv

  5. Input Devices
    ID: ea9bb3f9-3607-4be2-82f8-e9b3381a0524
    CREATED: <2025-02-27 Thu 18:51>
    

    [2025-02-27 Thu 18:51] evdev - Wikipedia [2025-02-27 Thu 18:51] kernel.org input.txt

1.3.3. Systems

ID: 1f728d2c-edf1-4502-9560-d0a6c45d5df8
CREATED: <2025-02-27 Thu 19:38>

[2025-02-27 Thu 19:43] syscalls(2) - Linux manual page [2025-02-27 Thu 19:44] System Calls — The Linux Kernel documentation [2025-02-27 Thu 19:46] linux/arch/x86/entry/syscalls/syscall_64.tbl

  1. Core
    ID: c670fcee-f9b1-4acd-ab32-3b795748b544
    CREATED: <2025-03-07 Fri 15:35>
    

    [2025-03-07 Fri 15:35] Core Subsystems

  2. Storage
    ID: f28b16e2-97e5-4575-a3d6-941efeb8942d
    CREATED: <2025-03-07 Fri 15:36>
    

    [2025-03-07 Fri 15:36] Storage interfaces

    1. Filesystem   fs
      ID: 1f938c20-8d8e-460c-8fb7-f4afaac432cc
      CREATED: <2025-02-22 Sat 19:04>
      

      [2025-02-22 Sat 19:04] Filesystem Hierarchy Standard - Wikipedia

  3. ACPI   hw
    ID: ac0ae4dd-21d4-4b45-9751-a102a48f30e6
    CREATED: <2025-03-04 Tue 19:16>
    

    [2025-03-04 Tue 19:16] ACP - Wikipedia [2025-03-04 Tue 19:16] ACPI Support — The Linux Kernel documentation

    Advanced Configuration and Power Interface

  4. SPI
    ID: cde3ff32-1ad9-43ab-9ac7-05efd3f88490
    CREATED: <2025-03-04 Tue 19:20>
    

    [2025-03-04 Tue 19:20] Serial Peripheral Interface (SPI) — The Linux Kernel documentation

  5. DFL   hw
    ID: 5499a81e-1c6e-48d5-b906-9d2155afc562
    CREATED: <2025-03-04 Tue 19:19>
    

    [2025-03-04 Tue 19:19] FPGA Device Feature List (DFL) Framework Overview — The Linux Kernel documentation

  6. Networking   net
    ID: 8ed2735d-d259-4a78-8891-ded98f857846
    CREATED: <2025-03-07 Fri 15:31>
    
    1. NAPI
      ID: 883daf4b-7084-4356-ab2d-877a8af2cd45
      CREATED: <2025-03-07 Fri 15:31>
      

      [2025-03-07 Fri 15:31] NAPI — The Linux Kernel documentation

  7. Human Interfaces
    ID: 19f3c5da-0f20-4eca-b142-7fc71095ca18
    CREATED: <2025-03-07 Fri 15:38>
    

    [2025-03-07 Fri 15:39] Human Interfaces

    1. Frame Buffer
      ID: 0c37073d-0322-410b-8258-00ffd8215eaa
      CREATED: <2025-03-07 Fri 15:38>
      

      [2025-03-07 Fri 15:40] Frame Buffer

  8. IO   io
    ID: 9d49d145-2c94-4d6f-a4e1-5016df6cbedc
    CREATED: <2025-02-27 Thu 19:39>
    

    Input/Output operations

    1. epoll
      ID: 74367b29-6a50-4eb4-ac6b-1c1b96dabd89
      CREATED: <2025-02-27 Thu 19:39>
      

      [2025-02-27 Thu 19:42] epoll(7) - Linux manual page

    2. io_uring
      ID: 92c2a9aa-6584-470e-977a-3547bca79414
      CREATED: <2025-02-27 Thu 19:39>
      

      [2025-02-27 Thu 19:40] io_uring is not an event system · blog · despair labs [2025-02-27 Thu 19:40] GitHub - noteflakes/awesome-io_uring: Awesome io_uring [2025-02-27 Thu 19:40] Zero Copy Rx with io_uring [2025-02-27 Thu 19:41] io_uring(7) - Linux manual page [2025-02-27 Thu 19:41] Missing Manuals - io_uring worker pool [2025-02-27 Thu 19:42] Lord of the io_uring

    3. poll
      ID: d43311bf-7f5f-4d21-aad8-4b35548813b5
      CREATED: <2025-02-27 Thu 19:43>
      

      [2025-02-27 Thu 19:43] poll(2) - Linux manual page

1.4. Community

ID: d494d0ab-53ee-4c01-8276-638351d86368
CREATED: <2025-03-11 Tue 21:46>

1.4.1. UAPI Group

ID: 1196e1fc-7d87-430d-9b68-c5a8a240b82e
CREATED: <2025-03-11 Tue 21:46>

[2025-03-11 Tue 21:46] The Linux Userspace API (UAPI) Group | The Linux Userspace API Group

The Linux Userspace API Group

1.5. Distros

ID: 34966e81-ab92-4b85-b11e-073784261db5
CREATED: <2025-02-22 Sat 19:31>

[2025-02-22 Sat 19:31] List of Linux distributions - Wikipedia

Linux Distributions

1.5.1. Fedora

ID: c9fdd74c-0eb2-4d8f-bc22-0cf40996f186
CREATED: <2025-02-22 Sat 19:32>

[2025-02-22 Sat 19:32] Fedora Linux | The Fedora Project

  • RHEL is based on Fedora
    • RH has influence over roadmap

1.5.2. bootc

ID: 101c2239-6e98-4899-b552-17e8ae9c55c8
CREATED: <2025-04-16 Wed 18:52>

[2025-04-16 Wed 18:52] Fedora/CentOS bootc Documentation :: Fedora Docs [2025-04-16 Wed 18:55] bootc-dev

  1. CoreOS
    ID: ca6795ee-4b2c-4ec3-9bdc-f6be67c2f1ec
    CREATED: <2025-02-22 Sat 19:32>
    AKA: FCOS
    PROPERTIES: :header-args :export both :eval no-export :session coreos :async t
    

    [2025-02-22 Sat 19:32] Fedora CoreOS Documentation

    • Configuring Users
    • CoreOS Installer

      cargo install coreos-installer
      
    • core
    • Ignition documentation
    • Provisioning Fedora CoreOS on QEMU
      • requires ignition config file
      • should provide ssh key for core user
      • fetch the qcow2 image

        # stream = stable,testing,next
        coreos-installer download -s $stream -p qemu -f qcow2.xz --decompress -C ~/.stash/scratch/
        
        /home/ellis/.stash/scratch/fedora-coreos-41.20250215.3.0-qemu.x86_64.qcow2
        
      • setup a new vm

        IGNITION_CONFIG=$config
        IMAGE=$image
        # for x86/aarch64:
        IGNITION_DEVICE_ARG="-fw_cfg name=opt/com.coreos/config,file=${IGNITION_CONFIG}"
        
        # for s390x/ppc64le:
        IGNITION_DEVICE_ARG="-drive file=${IGNITION_CONFIG},if=none,format=raw,readonly=on,id=ignition -device virtio-blk,serial=ignition,drive=ignition"
        
        qemu-system-x86_64 -m 2048 -cpu host -nographic -snapshot \
          -drive "if=virtio,file=${IMAGE}" ${IGNITION_DEVICE_ARG} \
          -nic user,model=virtio,hostfwd=tcp::2222-:22
        
      • launch it

        qemu-img create -f qcow2 -F qcow2 -b "${IMAGE}" my-fcos-vm.qcow2
        qemu-system-x86_64 -m 2048 -cpu host -nographic \
          -drive if=virtio,file=my-fcos-vm.qcow2 ${IGNITION_DEVICE_ARG} \
          -nic user,model=virtio,hostfwd=tcp::2222-:22
        
  2. IoT
    ID: 79c00d69-0624-4e85-a237-79e73e612dca
    CREATED: <2025-02-22 Sat 19:34>
    

    [2025-02-22 Sat 19:34] Fedora IoT Documentation

1.5.3. Arch Linux

ID: 6ef3fb84-6805-46f7-ad13-8929a023b43c
CREATED: <2025-02-22 Sat 19:39>

[2025-02-22 Sat 19:40] Arch Linux [2025-06-08 Sun 19:28] -> Pacman

  • Arch (btw)
  • jack of all trades master of none
    • still, what I use for my daily driver since 2016
  • rolling release OS, relatively stable even when running bleeding edge
  • obviously there are harder setups to manage, but I find manually installing Arch from scratch to be a good stat check for system devs.
  • High quality Wiki
  1. Archiso
    ID: 06ee60a3-9a98-40d2-893b-39ce992fc0dc
    CREATED: <2025-06-08 Sun 19:23>
    

    [2025-06-08 Sun 19:23] archiso - ArchWiki

    • supports cloud-init service
    • sshd on by default
  2. ABS
    ID: 03215632-83da-48c0-9f36-df72a9e956b5
    CREATED: <2025-07-09 Wed 17:04>
    AKA: Arch build system
    

    [2025-07-09 Wed 17:05] Arch build system - ArchWiki

    The Arch build system (ABS) is a system for building and packaging software from source code. While pacman is the specialized Arch tool for binary package management, the Arch build system is a collection of tools for compiling source into installable .pkg.tar.zst packages.

    The Arch build system can be compared to ports for *BSD, which automates the process of building software from source code. The system uses a port to download, unpack, patch, compile, and install the given software. A port is merely a small directory on the user's computer, named after the corresponding software to be installed, that contains a few files with the instructions for building and installing the software from source. This makes installing software as simple as typing make or make install clean within the port's directory.

    The Arch build system is based on a similar concept. It comprises a collection of git repositories for every package available in Arch Linux. Each repository contains a PKGBUILD file (and sometimes other files), and does not contain the software source nor binary. By running makepkg inside a directory, the software sources are downloaded, the software is compiled, and then packaged within the build directory. Then you can use pacman to install the package.

  3. Pacman
    ID: 8bbcda66-0611-42a8-9f99-10d1cd7d82e2
    CREATED: <2025-07-09 Wed 17:06>
    

    [2025-07-09 Wed 17:06] pacman - ArchWiki

1.5.4. Ubuntu

ID: 5d1223c7-0ded-44b9-b494-3a3593a2fe02
CREATED: <2025-02-22 Sat 19:39>

[2025-02-22 Sat 19:41] Enterprise Open Source and Linux | Ubuntu

1.5.5. Debian

ID: f03769bc-abf2-4f58-809f-b672c66120f3
CREATED: <2025-02-22 Sat 19:39>

[2025-02-22 Sat 19:41] Debian – The Universal Operating System

1.5.6. Alpine

ID: 4e717401-7b7b-4ce6-83c7-6f8420e01b93
CREATED: <2025-02-22 Sat 19:40>

[2025-02-22 Sat 19:41] Alpine Linux

1.5.7. Adélie

ID: b54a3fef-192f-4767-bec2-c10058e69a89
CREATED: <2025-03-04 Tue 15:27>

[2025-03-04 Tue 15:27] Adélie Linux | Welcome

1.5.8. Gentoo

ID: 5cbe7ad4-008a-4ed7-889d-e7ec5663dfd1
CREATED: <2025-02-22 Sat 19:40>

[2025-02-22 Sat 19:42] Gentoo Linux

1.5.9. Slackware

ID: 21e5a881-54d0-410e-b48a-f32ee26ef90d
CREATED: <2025-02-22 Sat 19:43>

[2025-02-22 Sat 19:43] The Slackware Linux Project

2. Plan 9

ID: 3c707aa1-be3a-4258-bcd8-195216e658b5
CREATED: <2025-03-06 Thu 09:11>

:EDGES: [2025-03-06 Thu 09:12] Plan 9 from Bell Labs [2025-03-06 Thu 09:12] Plan 9 — The Documents (Volume 2)

3. OpenBSD

ID: 82110e71-748d-4dd6-ba91-22a6a41df76c
CREATED: <2025-06-22 Sun 14:56>

[2025-06-22 Sun 14:56] OpenBSD