R01 Devterm Changelog

[13.06.2024]

  • assembly, battery charge, power on
  • update the system
apt update && apt upgrade && apt auto-remove
  • fix the legacy keyring warning:
cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d
  • apt update && apt upgrade
  • manually update the last 2 remaining packages that were marked as “kept back”
  • disable startx running automatically on boot by commenting every line in ~/.bash_profile
  • ordered the Blackberry trackball to replace the one current installed, but by the look of things, not sure if it’s entirely needed. However, i’ve always wanted a Blackberry, so maybe this will satisfy the crave.
  • enabled ssh
systemctl enable sshd
  • update timezone
timedatectl set-timezone Europe/Prague
(find yours with timedatectl list-timezones)
  • disabled automatic login with:
rm -rf /etc/systemd/system/getty@tty.service.d
systemctl disable autologin@.service
systemctl enable getty@tty1
  • prompt visibility and some pretty colors & custom prompt (add to .bashrc)
    if you want to play with this yourself, this is the expanded github gist. i just needed the prompt to show up. funny how the prompt itself is just a weird I if you toy with the coloring a bit, you can see it. i always thought it was a solid block :slight_smile:
    Still a work in progress. Can’t believe i’m spending so much on a cursor thingie, but the cursor gets lost after trying to test nano/vim/emacs (where no cursor is visible) and when i return to the shell, the cursor disappears again, unless i run the escape code to show it again.
    This is a very cool article about cursors and experimenting with them.
  • i’ve changed the cursor_foreground_white and cursor_background_black and now it shows me that the cursor is just some character, but not the framebuffer console. it looks like a duck, it quacks like a duck, but it doesn’t seem like it’s a duck, and therefore i’m leaving it like this, to serve as a reminder that it’s not.

    That’s the Latin capital letter I (as in incredible) with circumflex

    Not entirely sure what’s up with that, but my prompt changed to the latin letter e with a reverse circumflex, without me changing anything except for the font size and a reboot.
##############
# pretty prompt and font colors
##############

#clear #for background artifacting

# set the default text color. this only works in tty (eg $TERM == "linux"), not pts (eg $TERM == "xterm")
setterm -background black -foreground white -store

cursor_style_full_block=16 # software cursor (non-blinking) # tried the others but nothing works except for this one in tty
cursor_background_black=0 # same color 0-15 and 128-infinity
cursor_background_white=112 # same color 112-127
cursor_foreground_default=0 # same color as the other terminal text
cursor_foreground_black=2

cursor_styles="\e[?${cursor_style_full_block};${cursor_foreground_default};${cursor_background_white};c" # only seems to work in tty

prompt_chars_normal=0
prompt_chars_bold=1
prompt_chars_underlined=4 # doesn't seem to work in tty
prompt_chars_blinking=5 # doesn't seem to work in tty
prompt_chars_reverse=7

prompt_reset=0

start_prompt_styles="\e[${prompt_chars_bold}m" # just use default background and foreground colors
end_prompt_styles="\e[${prompt_reset}m"

PS1="${start_prompt_styles}[\u@\h \W] \$${end_prompt_styles}${cursor_styles} "

##############
# end pretty prompt and font colors
##############

OR you can quick and dirty it like so (.bashrc):

echo -n -e '\e[?17;14;224c'
  • Default font size change: edit /etc/default/console-setup as recommended here
FONTSIZE="12x24"         ### <-- Magical setting for my eyes!

[todo]

  • a backlit keyboard would really be cool at night.
  • sometimes after a reboot, the screen stays black, until i long press the power button to turn it off and then back on again. it always works properly if i “shutdown -h now” and then power it back on.
  • cursor now visible in the terminal but not in any editors.
  • now i kinda want a blinking cursor.
  • console login seems to be oddly slow. like after typing the password. it takes a few good seconds to reach the prompt.
  • clone the sd and reflash it with the defaults - see how it looked in the beginning
  • upgrade keyboard firmware.
  • i hate systemd
2 Likes
  • some systemd magic to check process trees and switch from graphical to multi-user interface
## check trees and times
systemd-analyze critical-chain
## this one is even more detailed with the --fuzz parameter
systemd-analyze critical-chain --fuzz 1h
systemd-analyze blame

systemctl status
systemctl list-dependencies

## disable gdm
systemctl get-default
systemctl disable gdm3
systemctl set-default multi-user.target
systemctl get-default
  • a few things i don’t need
## disabling the sending of error reports
systemctl disable whoopsie.service
apt remove whoopsie whoopsie-preferences
apt purge whoopsie whoopsie-preferences

## disabling the unattended upgrades service because i take pleasure in seeing text scrolling by and doing the upgrades myself
systemctl disable unattended-upgrades.service

apt purge update-notifier-common
  • quick script to check battery level
[root@devterm-R01 ~] $ cat /sys/class/power_supply/axp20x-battery/capacity
13
[root@devterm-R01 ~] $ cat /sys/class/power_supply/axp20x-battery/health
Good
[root@devterm-R01 ~] $ cat /sys/class/power_supply/axp20x-battery/status
Charging
[root@devterm-R01 ~] $ cat  /sys/class/power_supply/axp20x-battery/type
Battery

  • i keep thinking i wanna disable all the printing services but everytime i wanna do it, i keep thinking i shouldn’t, even though i don’t really know what i’d like to print. :confused:
  • services temporarily disabled:
# printing
systemctl disable cups.service
systemctl disable cups-browsed
systemctl disable devterm-printer
systemctl disable devterm-socat.service

# audio
systemctl stop devterm-audio-patch.service
systemctl disable devterm-audio-patch.service

## no need for firewall for now
systemctl disable ufw

## getting rid of snapd
systemctl stop snapd
systemctl disable snapd
systemctl mask snapd
apt purge snapd -y
apt autoremove

## we don't need any jails
systemctl stop apparmor
systemctl disable apparmor
apt purge apparmor

## we are most likely not doing ubuntu commercial
systemctl disable ubuntu-advantage
apt remove ubuntu-advantage-tools
apt purge ubuntu-advantage-tools
apt autoremove
  • the fact that rebooting gets stuck at black screen is driving me insane still. the weird thing is when i type “reboot”, when the screen should light up a little, i hear this click instead and it stays black.
## we probably don't need cloud-init either
apt purge cloud-init cloud-guest-utils
rm -rf /etc/cloud
apt purge unattended-upgrades
rm -rf /var/log/unattended-upgrades

## no need for this (network based RNG from pollinate servers)
systemctl stop pollinate.service
systemctl disable pollinate.service
apt remove pollinate
apt purge pollinate

## this doesn't need to run as a service
systemctl disable rsync.service
systemctl stop rsync.service

## do not want
apt remove apport apport-symptoms
apt purge apport apport-symptoms

## disabling firmware update but keeping it for later
systemctl stop fwupd fwupd-refresh fwupd-refresh.timer
systemctl disable fwupd fwupd-refresh fwupd-refresh.timer

## i'm terrible at reading manuals
systemctl disable man-db
systemctl disable man-db.timer
## view init driver
ps  -p 1  -o comm=

## Let NetworkManager handle network connectivity
systemctl disable networkd-dispatcher
systemctl disable systemd-networkd
systemctl disable systemd-resolved
systemctl mask networkd-dispatcher
systemctl mask systemd-networkd
systemctl mask systemd-resolved
systemctl daemon-reload


## Let go of timesync for now
systemctl disable systemd-timesyncd.service

## re-enable if needed for remote/network file-systems like SMB/CIFS, SSHFS, NFS and so on
systemctl disable remote-fs.target
systemctl mask remote-fs.target

## we're not doing containers
systemctl disable lxd-agent.service
systemctl mask lxd-agent.service

## we're not doing iscsi yet
systemctl disable open-iscsi.service
systemctl disable iscsid.socket

## not a huge fan of lvm
systemctl disable lvm2-lvmpolld.socket

## i guess motd is not necessary
systemctl disable motd-news.timer

## i mean we don't need these
systemctl disable mdmonitor-oneshot.timer
systemctl disable mdcheck_start.timer
systemctl disable mdcheck_continue.timer
  • not the cursor i was looking for, but this enables functionality.
add **vt.cur_default=0xF00058** to **/etc/default/u-boot** like this:
U_BOOT_PARAMETERS="earlyprintk=sunxi-uart,0x02500000 clk_ignore_unused initcall_debug=0 console=ttyS0,115200 console=tty0 cma=8M LANG=en_US.UTF-8 fbcon=rotate:1 vt.cur_default=0xF00058"

then run: **u-boot-update** and reboot

Alright i guess my qualms right now lie with this line. Maybe i am misunderstanding things, so anyone that knows more, feel free to correct me.

/sbin/agetty -o -p -- \u --keep-baud 115200,57600,38400,9600 ttyS0 vt220

i’m kinda not sure why the tty0 is taken, nor by what. i been trying to grep for vt220 in /etc and in /lib and can’t find anything.

As far as i understand, the framebuffer console is what i am looking into having, and yet, by default, i think i’m put in a virtual terminal, because in u-boot i was able to get a cursor to show up by doing vt.cur_default=0xF00058.

i probably need sleep and it will all sort itself out tomorrow or in the coming days, but so far it seems clean.

Also everybody seems to be going out of their way to get the blinking cursor to stop, and i’m trying to get back to the blinking cursor, which doesn’t make things easy :))))

So i guess as far as cursor goes, what i want is the hardware cursor, which is always blinking.

This thread / topic! What a nice write up @katmai

Keep at it and hopefully I’ll have some time to dive in and assist your thoughts! Again kudos on this thread and know this is extremely helpful and that I want to contribute back too!

TY TY TY

Nice writeup, the more riscv64 here the better :slight_smile:

for the time being that’ll have to do. i can’t think of anything else at the moment other than the things i’ve already mentioned, but those may come later.

if you just wanna slap the image straight up on a sdcard, it’s easy to do so:

wget https://www.bioget.com/image.card
dd if=image.card of=/dev/mmcblk0 bs=512

add |pv if you wanna see things moving while you wait

1 Like
  • fix for DNS resolution broken after taking off systemd-resolvd
## fix resolv.conf
# stop NetworkManager from updating resolv.conf
cat >> /etc/NetworkManager/conf.d/90-dns-none.conf << EOF
[main]
dns=none
EOF
# google cloudflare and quad9
rm -rf /etc/resolv.conf
cat >> /etc/resolv.conf << EOF
nameserver 8.8.8.8
nameserver 9.9.9.9
nameserver 1.1.1.1
EOF
systemctl reload NetworkManager
NetworkManager --print-config |grep dns
# ^^ this should say "none"
## if i disable the getty service, i don't get tty1 but i can access tty2/3/4 via the fn+ctrl+alt+2/3/4 keys
systemctl disable getty@tty1
systemctl mask getty@tty1
systemctl disable keyboard-setup.service
systemctl mask keyboard-setup.service

## don't need systemd watching over the login
## however this leaves us without tty2/3/4
## however we can have tty2/3/4 by enabling them via getty:
## systemctl enable getty@tty2.service
systemctl disable systemd-logind.service
systemctl mask systemd-logind.service

## i don't need fonts and keymap to be loaded (now we're fast)
systemctl disable console-setup.service

## leave the entropy pool alone (you can always use rng-tools if needed)
systemctl disable systemd-random-seed.service
systemctl mask systemd-random-seed.service

it’s time to make a choice.

## i've left out the systemd-logind 
## enabled tty1 and tty2
systemctl disable systemd-logind.service
systemctl mask systemd-logind.service
systemctl enable getty@tty1
systemctl enable getty@tty2
  • i guess i’m done. anything more beyond this is probably going around in circles.
  • small ssh changes - /etc/ssh/sshd_config
## i wanna be able to login as root and changed the ssh port so i don't get hogged by scanners
Port 6457
PermitRootLogin yes
  • bringing back timesync
systemctl enable --now systemd-timesyncd.service

You might want to enforce only SSH keys for such authentication over SSH

nah. whoever wants to login with pw or ssh keys should be able to do so.

  • i messed up on a kernel rebuild and i sort of broke the image. which made me load the OS clean.
    however i noticed that on the default OS, the “reboot” command works properly in the way that it’s not getting stuck anymore and i have to get it going by long pressing the power button and then back on, so i am assuming that it has to do with either apt upgrade or one of the other tweaks i made. so i’ll start over and see which breaks what.

  • bla. it seems that one of the packages updated during installing updates messes the reboot stuff up.

  • back to square one - starting a bit more sensibly this time.

  • bla - i been sitting here like a madman rebooting a clean install with no modifications over and over again, and it does get stuck every once in a while. so the apt updates weren’t the culprit.

i went ahead and consolidated everything. It can be run by anyone on a freshly flashed R01.
It’s more elegant this way.
You can check the code here: GitHub - katmai/r01: Modifications for the ClockworkPi DevTerm R01

Highlights:

  • added fan control.
  • bigger font.
  • less ape on disabling services.
  • ability to wind back to how it all was.
  • all snappy.
git clone https://github.com/katmai/r01.git && cd r01 && make all

i think i’m pretty much done. boot time is fast, you still have the graphical interface should you choose to play with, i added the 2D accelerator and you can use r01.stopx from another tty to stop it.

1 Like

It’s as clean as i can get it, without breaking anything.

11.841s systemd-resolved.service
11.401s dev-mmcblk0p4.device
 9.971s systemd-timesyncd.service
 6.547s systemd-random-seed.service
 6.365s networkd-dispatcher.service
 3.489s systemd-networkd.service
 3.015s user@1001.service
 3.000s systemd-logind.service
 2.488s systemd-udev-trigger.service
 2.281s keyboard-setup.service
 2.146s systemd-journal-flush.service
 2.022s ssh.service
 1.834s NetworkManager.service
 1.743s alsa-restore.service
 1.578s sys-kernel-debug.mount
 1.572s systemd-journald.service
 1.419s systemd-udevd.service
 1.418s kmod-static-nodes.service
 1.308s modprobe@configfs.service
 1.233s modprobe@drm.service
 1.079s systemd-tmpfiles-setup.service
 1.055s modprobe@fuse.service
  888ms systemd-modules-load.service
  828ms console-setup.service
  795ms finalrd.service
  778ms systemd-remount-fs.service
  748ms gdm3.service
  707ms plymouth-read-write.service
  670ms systemd-backlight@backlight:backlight@0.service
  649ms wpa_supplicant.service
  643ms rsyslog.service
  591ms systemd-rfkill.service
  590ms sys-fs-fuse-connections.mount
  578ms sys-kernel-config.mount
  456ms systemd-sysusers.service
  449ms systemd-sysctl.service
  357ms boot.mount
  303ms systemd-user-sessions.service
  248ms modprobe@efi_pstore.service
  242ms systemd-update-utmp.service
  240ms systemd-tmpfiles-setup-dev.service
  198ms plymouth-quit-wait.service
  148ms user-runtime-dir@1001.service
  139ms plymouth-quit.service
   97ms systemd-update-utmp-runlevel.service
   79ms setvtrgb.service
  487us blk-availability.service

Small update:

  • i let NetworkManager handle all network connectivity and added r01.tools which allows switching between text/graphical.
cd ~/r01 && git pull && make binaries && make notneeded