Slarm64 on Pinebook [Slackware Arm - 64 bit]
#1
Hello,
 
     While the rest of the world may have moved on to the Pinebook Pro, I personally still love my Pinebook 1080P.  Yes, it is a bit quirky, but not so quirky as to be unusable.  In fact, most of the quirks have simple workarounds that teach you about how Linux works, so I see it as a fun and interesting challenge.

     I have been making Slackware work on my Pinebook in one way or another since I first received it.  For a long time, I was using Anarsoul's ArchLinux with XFCE as the base, then I would strip everything out except /boot and /lib/modules and /lib/firmware.  Then I would copy over a root filesystem, and build it up from there.

   Wanting a newer kernel than 4.20.0 (despite the appeal of the number itself), and after many failed attempts to build my own kernel (these ARM devices sure can be tricky...), I finally reached out on LinuxQuestions.org, and got help from sndwvs there.  If you would like to follow that thread, here is the link:

https://www.linuxquestions.org/questions...175669005/

    The build script at gitlab is not currently working, but I can still build fresh images using a commit from a few weeks ago, details are on the link above.  If you are interested in following the build script development, that his happening here:

https://gitlab.com/sndwvs/slackware_arm_build_kit

   And if you would like to skip all of that and just grab the latest working image, you can find those here:

https://3space.xyz/pineslarm/

   I will put up a full image there soon, so that you do not have to do any downloading after installation to get a GUI desktop.  Stay tuned for that, it should be uploaded sometime this week.

   Note that this last link also contains a directory of the SlackBuilds that I have built for Slarm64.  Not all of them work, some I have built for testing purposes only.  Some might be outdated, sometimes I build a package, try it out, and never update it after that.  So, there are no guarantees here, I just provide them in case you want to use them instead of building them yourself.

   A build of note is LibreOffice with a single dependency (libfreehand), which I am currently building an update for, hopefully with no dependencies at all.

   FWIW, I am finding that this image with JWM as the window manager (see my builds above) is the snappiest and smoothest image I have ever tried on the pinebook, and I have tried all that I can find, including everything on the Wiki (even the BSDs).  Your mileage may vary.  And, "nostalgic" is not the word that I would use when referring to Slackware-current.  Yes, you can go retro with it, but it is just a base to build from, so I see it as basically the same thing as Anarsoul's ArchLinux without systemd and easier to build your own packages on, more or less.  This only has to be as "nostalgic" as you want it to be.

   Oh, and I believe this script supports Pinebook-Pro as well, but since I do not have one of those, I cannot comment on how that one is working.

   One last note:  I do not think that Slarm64 has received the official blessing from either Pat Volkerding or Stuart Winter, so I do not think this is "official" Slackware in that sense. But nothing has been added beyond boot files and kernel modules needed to make the Pinebook work.  This is a true Slackware experience on the Pinebook, regardless if it has been Blessed By "Bob" ™ or not.

Enjoy.
  Reply
#2
Kudos! Subscribing to the thread to get some time to test this.

Enviado desde mi ONEPLUS A5010 mediante Tapatalk
  Reply
#3
Flashed SD card and now I have a slackware pinebook Smile It feels very different than any other distro out there, I guess if you can write a quick guide/getting started with slackware for pinebook user it would be nice (I'm talking about configuring wireless, desktop, etc.)
I've looked into https://docs.slackware.com/ and I have my wireless working meanwhile.

Thanks!
  Reply
#4
(03-16-2020, 08:24 AM)KRT Wrote: This is a true Slackware experience on the Pinebook, regardless if it has been Blessed By "Bob" ™ or not.

Enjoy.


Thanks for sharing your experiences and your script. I prefer slackware,  and I'm gonna try out armed freenix64-current, which doesn't formally exist, but it's close enough description for what I'm hoping will be successful on a test pinebook pro that arrived today from the mid-january dispatch!
  Reply
#5
(03-17-2020, 04:22 AM)e-minguez Wrote: Flashed SD card and now I have a slackware pinebook Smile It feels very different than any other distro out there, I guess if you can write a quick guide/getting started with slackware for pinebook user it would be nice (I'm talking about configuring wireless, desktop, etc.)
I've looked into https://docs.slackware.com/ and I have my wireless working meanwhile.

Thanks!

Great!  I am glad it is working for others, that is good news.

Yes, I can share my quickstart tips.  I will write up something soon.  I will share some Slackware general tips, plus some Pinebook specific scripts and such.

I just finished compiling a standalone LibreOffice package (no dependencies at all).  This one in particular has embedded database support because, much to my surprise, the Firebird module built successfully on ARM for the first time since I have been building this package.  This is very cool.

If anyone wants to check these out, here are the links:

https://3space.xyz/pineslarm/packages/Li...hldwlr.tgz

https://3space.xyz/pineslarm/packages/Li...hldwlr.md5

Next I will write a quick-start guide and create a full-install SD card image, so that you get a full GUI desktop without having to download anything.  I will get that up in a few days.  In the mean time, I have been scrambling with real life stuff, you know...

Big Grin

(03-18-2020, 01:25 AM)globaltree Wrote:
(03-16-2020, 08:24 AM)KRT Wrote: This is a true Slackware experience on the Pinebook, regardless if it has been Blessed By "Bob" ™ or not.

Enjoy.


Thanks for sharing your experiences and your script. I prefer slackware,  and I'm gonna try out armed freenix64-current, which doesn't formally exist, but it's close enough description for what I'm hoping will be successful on a test pinebook pro that arrived today from the mid-january dispatch!

Ah, yes, Freenix is my other main daily distro!  I already blacklist the non-free packages (except for Mozilla Firefox, I need that for work actually, no other browser will do for some stuff) before I do a full installation on this Slarm64 image.  The blacklist is fairly short, since some of the non-free stuff has been removed from -current since 14.2 came out.  Here is my blacklist, FYI:


Code:
#Freenix.net non-free packagelist
getty-ps
amp
unarj
ipw2100-fw
ipw2200-fw
mozilla-thunderbird
zd1211-firmware
bluez-firmware
xfractint
xgames
xv
font-bh-ttf
font-bh-type1

arj is a good replacement for unarj, and there is an arj package in my build repository.

getty-ps is totally unneccessary, since agetty does the same thing.

the firmware is obviously not needed, that is x86 stuff.

I use claws-mail, no need for Thunderbird.

I never used any of the other stuff anyway, so I don't miss it.

The only thing keeping this from being a fully free distro (once I have blacklisted the above packages) are the kernel and modules.  I do not think I can run linux-libre on here without losing wi-fi and bluetooth.  If you want to go fully free, I guess you can get some libre dongles at the expense of one or more USB ports.  I might in fact try to build a kernel for this using the linux-libre source, just to see if it builds.  That is another experiment to try.

Cool
  Reply
#6
That's my plan.  PBP arrived with debian already on it; the debian config was in /proc/config.gz.  As soon as rsync finishes up downloading slackwarearm-current, I'll remove the blacklisted packages, get the libre-linux source, and try out this debian config.  Probably take a day and a night to compile though... tell you how it works tomorrow...
  Reply
#7
UPDATE:   After a few failed attempts, I have created an SD card image with the FULL Slarm64 installation on it (even the KDEI package set, international languages for KDE, which both of are usually skipped).  When unzipped, it is over 13GB.  So you need a minimum of a 16GB SD card for this one.

https://3space.xyz/pineslarm/slarm64-current-aarch64-full-rootfs-20200118-5.5.8-pinebook-build-20200313-1b181b.img.xz


https://3space.xyz/pineslarm/slarm64-cur...img.xz.md5


As for quick-start guides, I checked and this one covers most, if not all, of the Slackware basics:

https://docs.slackware.com/slackware:beginners_guide

In particular, the really important commands for this image that are not already part of a script are:

Code:
xwmconfig
Xfce is probably the safest bet, although KDE does work (I am not a fan nor user of KDE, so I cannot say more).

The other desktops are fun for lightweight experimentation.

I am personally using JWM built from slackbuilds.org.  More on that later.


Code:
iwconfig
This is supposedly for configuring the wireless network.  I must have never seen that.  I have never used that.  Maybe I have been doing it wrong all along.  I will have to try that one next time.

Code:
netconfig

I have always used this for both wired and wireless networks.  I select DHCP for wired networks, and NetworkManager when I want to use a GUI network manager to connect to a wireless network.  That has always worked for me.  YMMV, and the previous command might actually be better.  I am not sure.

The adduser script already is built into this image after you log in as root for the first time.  I have already set the mirror to my mirror, you are free to change it of course.  The rest is somewhat Pinebook-specific.

What I did was write the base image to an SD card, use gparted to grow the partition to fill the SD card, then I chrooted into the SD card, asked for a new DHCPD lease on wlan0, and then ran a full installation from there.  I did not update anything that was already installed, although some of them can be updated.  The reason for this is by doing it this way, I have not altered anything about the initial boot state.  Even though all the package sets have been installed, when you boot it it still boots as if for the first time, so you still generate fresh SSH keys, it grows the image  to fit your SD card (I shrank it back down a few GB's just to make sure it fit on any ~16GB card), and it prompts you to set up a non-root user.  Just like the base image does.  The only main difference is that the mirror has already been set and all package sets have been installed.  This way, I have changed as few defaults as possible.  I could have unset the mirror, but I figure since the images are being downloaded from my server, it kinda makes sense to have my server already set as the mirror.  That was just a choice I made.

I will use this image to go through and document all of the Pinebook-specific tweaks that make it work nicely.  For one, I know that the BT/WiFi power management needs to be adjusted.  Just about everything else works out of the box though.  My next post will document what I need to do to go from this image to a nicely configured system.  Stay tuned for that.
  Reply
#8
Alright, here we go... I was finally able to clear up some spare time in my crazy schedule to put together a slimmed down Xfce image.  I also ran through a typical setup process (including Pinebook specifics) and was able to jot down some notes this time.  

For starters, here is an SD card image that has X and Xfce, but I left out KDE and the Development package series, plus a few other things not needed on arm boards (such as Grub and LiLo).

https://3space.xyz/pineslarm/slarm64-cur...81b.img.xz

https://3space.xyz/pineslarm/slarm64-cur...img.xz.md5


After writing this out to an SD card, here are my notes:

boot....
wait....
the boot scripts resize the partition and do a few other first-boot things such as create fresh ssh keys.

watch messages for errors, eventually you wind up at a login prompt.

login, follow the script to create a new user.

Then, issue these commands:

Code:
passwd
change the root password

Code:
netconfig
it is recommended to use NetworkManager, but feel free to experiment here.

Code:
reboot
the easiest way to get changes to take, can also restart services


login as new user, then:

Code:
xwmconfig
choose xfce if you are feeling conservative, anything else if more daring


Code:
startx
set up Xfce however you like it.

Here is a quick screen brightness trick:

add to the panel the Power Manager plugin.  Through this you can conrtol screen brightness.  Script comes later.

connect to WiFi using the networkmanager-applet plugin in the taskbar.

open terminal


Code:
su

slackpkg update
slackpkg upgrade-all
slackpkg install-new


now you can add/remove packages/package sets as you see fit.

For example, I left out the Development package set "d" from the Xfce image.

install the entire Development package set using:

Code:
slackpkg install d 
(you can deselect specific packages too)

Best way to explore the packages is to look through PACKAGES.TXT

For other Slackware-specific issues, best to search on LQ or read the docs/man pages.

One of the nicest things about Slackware is the vanilla approach.  Most packages are as the author intended, so you can just read the help pages for that specific command or package from any upstream resource and it usually applies well.

~~~~~~~
 
Pinebook Specifics.....

WiFi power settings (from https://github.com/anarsoul/linux-build)

Code:
echo 'options 8723cs rtw_power_mgnt=0' >/etc/modprobe.d/8723cs.conf


Brightness script (from this forum somehwere, can't quite recall)

Code:
#permission fixes for lcd brighness script
/usr/local/bin/pinebook_lcd-brightness.sh -b &&
chown root:gpio /sys/class/backlight/backlight/actual_brightness /sys/class/backlight/backlight/max_brightness /sys/class/backlight/backlight/brightness &&
chmod 664 /sys/class/backlight/backlight/actual_brightness /sys/class/backlight/backlight/max_brightness /sys/class/backlight/backlight/brightness &&

 Those just set the stage.  I put that in my rc.local (more on that later).  Then you can run this script:


Code:
#!/bin/bash

# Helper script for Pinebook mean to be used in conjunction with xbindkeys
# Written 2017 Peter Feerick, GPLv3 licensed.
#
# Documentation for this script on GitHub
# https://github.com/pfeerick/pine64-scripts/wiki/Pinebook-LCD-Brightness-script

# Switch paths to twiddle depending on whether sunxidrm active or not
if [ -d /sys/module/sunxidrm ]; then
 ACTUAL_BRIGHTNESS_PATH="/sys/devices/platform/sunxi-drm/backlight/lcd0/actual_brightness"
 MAX_BRIGHTNESS_PATH="/sys/devices/platform/sunxi-drm/backlight/lcd0/max_brightness"
 BRIGHTNESS_PATH="/sys/class/backlight/lcd0/brightness"
else
 ACTUAL_BRIGHTNESS_PATH="/sys/class/backlight/backlight/actual_brightness"
 MAX_BRIGHTNESS_PATH="/sys/class/backlight/backlight/max_brightness"
 BRIGHTNESS_PATH="/sys/class/backlight/backlight/brightness"
fi

# Check if required access permissions are available...
if [ ! -r ${ACTUAL_BRIGHTNESS_PATH} ] || [ ! -r ${MAX_BRIGHTNESS_PATH} ] ||  [ ! -w ${BRIGHTNESS_PATH} ]; then
 echo "This script doesn't have the necessary permissions to read or change the LCD brightness!"
 echo "Changes to permisisons or running as a root user is required."
 exit 1
fi

MINIMUM_BRIGHTNESS=1
MAXIMUM_BRIGHTNESS=$(<${MAX_BRIGHTNESS_PATH})
ACTUAL_BRIGHTNESS=$(<${ACTUAL_BRIGHTNESS_PATH})

while getopts ":i:d:s:vb" opt; do
 case $opt in
   i)
     NEW_BRIGHTNESS=$((ACTUAL_BRIGHTNESS + $OPTARG))
     echo "Increase the LCD backlight brightness by $OPTARG to $NEW_BRIGHTNESS"
     ;;
   d)
     NEW_BRIGHTNESS=$((ACTUAL_BRIGHTNESS - $OPTARG))
     echo "Decrease the LCD backlight brightness by $OPTARG to $NEW_BRIGHTNESS"
     ;;
   s)
     NEW_BRIGHTNESS=$OPTARG
     echo "Set the lcd backlight brightness to $OPTARG" >&2
     ;;
   v)
     echo "Minimum brightness: $MINIMUM_BRIGHTNESS, Maximum: $MAXIMUM_BRIGHTNESS"
     ;;
   b)
     chown root:gpio ${ACTUAL_BRIGHTNESS_PATH} ${MAX_BRIGHTNESS_PATH} ${BRIGHTNESS_PATH}
     chmod 664 ${ACTUAL_BRIGHTNESS_PATH} ${MAX_BRIGHTNESS_PATH} ${BRIGHTNESS_PATH}
     exit 0
     ;;
   \?)
     echo "Invalid option: -$OPTARG" >&2
     exit 1
     ;;
   :)
     echo "Option -$OPTARG requires an argument." >&2
     exit 1
     ;;
 esac
done

#no arguments, display current value only
if [ $# -eq 0 ]; then
   echo "Current backlight brightness: $ACTUAL_BRIGHTNESS"
   exit 0
fi

#if we've gotten this far, sanity check setting and apply
if [ ! -z ${NEW_BRIGHTNESS} ]; then
 if [[ ${NEW_BRIGHTNESS} != ?(-)+([0-9]) ]]; then
   echo "Integer input expected. '$NEW_BRIGHTNESS' is NOT an integer!"
   exit 1
 fi

 if [ ${NEW_BRIGHTNESS} -lt ${MINIMUM_BRIGHTNESS} ]; then
    echo "Below mimimum brightness threshold"
    exit 1
 fi

 if [ ${NEW_BRIGHTNESS} -gt ${MAXIMUM_BRIGHTNESS} ]; then
   echo "Above maximum brightness threshold"
   exit 1
 fi

 echo  ${NEW_BRIGHTNESS} > ${BRIGHTNESS_PATH}
fi

 as such, to increase or decrease brightness (and bind these to key combinations eventually):

To increase:
Code:
./pinebook_lcd-brightness.sh -i 1

To decrease:
Code:
./pinebook_lcd-brightness.sh -d 1


The internal speakers are muted by default.  You can unmute them using alsmixer, or just run:

Code:
/usr/bin/amixer -c 0 set 'DAC Mixer AIF1 DA0' unmute

That is another good one for the rc.local script.

I think that is about it for Pinebook fixes.  If I think of anything I left out, I will make another post.

If you want to write your SD image to the eMMC:

-----

installation on a eMMC (for pinebook)
   Flash the image to micro SD, then copy the .img file to micro SD filesystem.
   Power up the board with micro SD and login.
   Run below command for flashing to eMMC module
       >>dd if=slarm64-current-*-base-rootfs-*-build-*.img of=/dev/mmcblk2 bs=1M
           example : dd if=slarm64-current-*-xfce-rootfs-*-build-*.img of=/dev/mmcblk2 bs=1M
       then edit 2 files in eMMC module:
       >> mount /dev/mmcblk2p1 /media
       >> echo "rootdev=/dev/mmcblk2p1" >> /media/boot/uEnv.txt
       >> sed -i 's:mmcblk1p1:mmcblk2p1:' /media/etc/fstab
   After done, power off board and remove micro SD. Then bootup with only eMMC module.

~~~~~~~~~~~

Building packages:

I suggest using sbopkg, but other tools are available.

Then you can build most of what is available at SlackBuilds.org

You need to use Ponce's repo for -current:

https://github.com/Ponce/slackbuilds/wik...ith-sbopkg

most work as-is, only a few need tweaking, we can talk about specific scripts in other threads or posts.

Here is a directory of my builds, most of which work (some are experimental)

https://3space.xyz/pineslarm/packages/

Packages of note:

LibreOffice
JWM
SMPlayer
mpv
etc....

~~~ 

By this point you are deep into the rabbit hole.

Here is my rc.local, just to show you what gets run at every boot:


Code:
#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

#permission fixes for lcd brighness script
/usr/local/bin/pinebook_lcd-brightness.sh -b &&
chown root:gpio /sys/class/backlight/backlight/actual_brightness /sys/class/backlight/backlight/max_brightness /sys/class/backlight/backlight/brightness &&
chmod 664 /sys/class/backlight/backlight/actual_brightness /sys/class/backlight/backlight/max_brightness /sys/class/backlight/backlight/brightness &&

## Turn up the lights
echo 8 >/sys/class/backlight/backlight/brightness &&

## NTP works better after a restart
/etc/rc.d/rc.ntpd restart &&

# Unmute internal speakers
/usr/bin/amixer -c 0 set 'DAC Mixer AIF1 DA0' unmute &

# enable kernel polling for proper autodetection of removable devices
echo 5000 > /sys/module/block/parameters/events_dfl_poll_msecs

exit 0



Custom personal tweaks:  I turn off some of the daemons that I do not use (experimental, some of these might be needed):

rc.cgmanager
rc.cgproxy
rc.consolekit
rc.cpufreq
rc.inet1
rc.mcelog
rc.nfsd
rc.rpc
rc.samba
rc.wireless

these are all located at /etc/rc.d/, and to turn them off you just make them non-executable.

Now I can boot to a graphical desktop (in my case, JWM) and connect to the Internet while using less than 150MB of RAM.  Nice.

Have fun....
  Reply
#9
Kudos to the explanation! It worth a new try in my pinebook, thanks!
  Reply
#10
I recently had to run through this entire process again from scratch after installing a new eMMC module in my Pinebook (now at 128GB, yay!).  I ran into a few gotchas that I thought were worth sharing here.

1)  For some reason, ca-certificates does not get installed correctly into the rootfs, even if it is the latest version.  Reinstalling it re-runs the install scripts and fixes whatever is broken about ca-certificates after first boot.  Before this, you cannot connect to https:// sites.  So, one of the first steps after updating the package list would be to:

Code:
slackpkg reinstall ca-certificates

I am not sure what else from the rootfs is broken like this, so I just re-install everything before installing any new packages.  This is easiest done in the base image, because there is less to reinstall.  Anything that got installed in the chroot environment of the base rootfs would not have this problem.  The only package I have noticed a problem with is ca-certificates, but there may be others, but they would be restricted to what comes with the base rootfs image.

Code:
slackpkg reinstall slarm64

If you have anything you know was installed on top of the base rootfs (you can usually tell by the timestamps), that would not need to be reinstalled.

Code:
ls -lt /var/log/packages/

This is just some quirk about how the base image is built.  I will let the author of the build script know about it, he may already in fact.

2)  The LCD brightness script needs a group to be set for it to work.  The details are at the URL listed in the comments:

https://github.com/pfeerick/pine64-scrip...ess-script

Note that the command in Slackware is not addgroup, but groupadd:

Code:
groupadd gpio

The rest of the instructions at that link work as written.  And the rest of my instructions above also work as written if you apply these two extra steps.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  DietPi OS for Pinebook MichaIng 3 6,937 03-11-2024, 05:02 PM
Last Post: oxoocoffee
  Broke pinebook GUI, what to do, fix or install new? acruhl 2 1,546 07-13-2023, 05:43 PM
Last Post: acruhl
  Orignal PineBook jwp1000 1 1,164 07-10-2023, 07:44 AM
Last Post: tophneal
  Pinebook no longer boots rjtanner 12 5,653 04-13-2023, 01:09 PM
Last Post: tophneal
  Stock Debian on original Pinebook moonwalkers 1 3,750 01-29-2022, 10:37 PM
Last Post: cel
  Write image to eMMC - Pinebook 11.6" irongarment 4 4,700 01-04-2022, 09:22 PM
Last Post: irongarment
  E: The repository 'http://pinebook.kde.org.uk bionic Release' no longer has a Release pixelpaperyarn 3 5,918 05-07-2021, 10:20 AM
Last Post: tophneal
  pinebook.kde.org.uk no longer has release file?? supermassive 1 4,217 01-20-2021, 11:18 AM
Last Post: tophneal
Question Ran apt update on my Pinebook.. ford442 0 3,128 12-25-2020, 04:40 PM
Last Post: ford442
Information Manjaro ARM for Pinebook erchache2000 88 127,782 11-29-2020, 04:36 PM
Last Post: Mr.Fermer

Forum Jump:


Users browsing this thread: 14 Guest(s)