I’ve just started experimenting with the Wayland compositor Hyprland and wanted to use my favorite wallpaper manager, Variety. Unfortunately, Variety does not support Hyprland out of the box. However, it’s easy to make it work also on Wayland.
I’m going to use Arch Linux in this blog post.
First of all, you must install “swaybg”, a wallpaper tool for Wayland compositors, and “variety”:
1
sudo pacman-Sswaybg variety
Now, start variety and do the first-time configuration. Currently, trying to change the wallpaper will not work.
Variety creates the directory “~/.config/variety/scripts”. Edit the file “set_wallpaper” inside that directory and search for the block starting like this:
Shell
1
if[[-n$SWAYSOCK]];then
Change it like that (you could also remove the part about SWAYSOCK if you want or if you don’t plan to use “sway” at all):
This relies on the XDG_CURRENT_DESKTOP environment variable to be set accordingly, which should be like that automatically; you might want to check that:
1
2
echo$XDG_CURRENT_DESKTOP
Hyprland
Restart Variety, and now you can change the wallpaper!
This is a follow-up to the article Installing Arch Linux on a PineBook Pro (external storage); differently from the previous post, this one is based on more automatic mechanisms, so it will be easier to copy and paste commands once a few variables have been correctly and carefully set. Moreover, in this post, I’ll install KDE instead of GNOME. Finally, we’ll use BTRFS for the main partition, instead of EXT4.
This post will describe my experience installing Arch Linux on a PineBook Pro on external storage (a micro SD card in this example). Thus, the Manjaro default installation on the eMMC will not be touched. You should use a fast card, or the overall experience will be extremely slow.
First, install the official Arch Linux ARM distribution; this will not be enough to have many hardware parts working (e.g., WiFi, battery management, and sound).
Then, add the repositories with kernels and drivers for the PineBook Pro.
The first part must be performed from an existing Linux installation on the PineBook Pro. I will use the Manjaro installation that comes with the PineBook Pro. The second part will be performed on the installed Arch Linux system on an external drive (a USB stick in this example). Since after the Arch Linux installation, the WiFi is not working, for this part, you need to connect to the wired network, e.g., with an ethernet USB adapter.
I insert my SD card, which is /dev/sda. (Use “lsblk” to detect that.) By the way, typically, an SD card should be detected with a device name of the shape “/dev/mmcblkX”, but in this example, the SD card is inserted in a USB adapter, so its device name has the typical shape “/dev/sdX”.
From now on, I’m using this device. In your case, the device name might be different.
From now on, all the instructions are executed as “root” from a terminal window; thus, I first run:
1
sudo su -
I will do the following steps in a directory of the root’s home:
1
2
3
cd
mkdir pbp-install
cd pbp-install
We need to download and extract the latest release of Tow-Boot for the Pinebook Pro from https://github.com/Tow-Boot/Tow-Boot/releases. At the time of writing, the latest one is “2021.10-005”:
Now we flash Tow-Boot to /dev/sda (replace this with the device you are using).
Remember: this will wipe all the contents of the specified device. Moreover, make sure you specify the correct device, or you might overwrite the eMMC of the computer.
To make things easily reproducible and minimize the chances of specifying the wrong device name (which is extremely dangerous), I will use environment variables:
1
export DEVICE_NAME="/dev/sda"
The process creates the partition table for the device, with the first partition for Tow-Boot. This first partition must not be modified further. As you see in a minute, we skip the first partition when we further partition the disk.
The instructions must be followed strictly concerning, at least, the very first partition (the boot partition) that will be created, which must NOT touch the one created in the previous step. Then, after creating the boot partition, I’ll do things slightly differently: I will create a SWAP partition (not contemplated in the above instructions; The PineBook Pro has only 4 Gb of RAM, and it is likely to exhaust it, so it’s better to have a SWAP partition to avoid system hangs. Then, I’ll create the root partition.
These are the essential contents of my terminal where I follow the above-mentioned instructions (since I had already used this USB stick for some experiments before writing this blog post, fdisk detects an existing ext4 signature). Remember, though, that I created a SWAP partition that was not described in the above-mentioned instructions:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Welcome to fdisk (util-linux 2.38.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
GPT PMBR size mismatch (26657 != 249737215) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Command (m for help): p
Disk /dev/sda: 119.08 GiB, 127865454592 bytes, 249737216 sectors
Disk identifier: E0CA6E57-39B2-4482-9838-21E2785CD93D
Device Start End Sectors Size Type
/dev/sda1 64 24639 24576 12M unknown
/dev/sda2 26624 550911 524288 256M Linux filesystem
/dev/sda3 550912 17328127 16777216 8G Linux swap
/dev/sda4 17328128 249735167 232407040 110.8G Linux filesystem
Filesystem/RAID signature on partition 3 will be wiped.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
Now I format the boot, the swap, and the root partitions. I will use EXT4 for the boot partition and BTRFS for the root partition.
Again, to increase reproducibility and avoid possible mistakes, I’m going to define additional environment variables, based on the one I have already created above, to refer to the 3Â partitions:
1
2
3
export BOOT_PARTITION="${DEVICE_NAME}2"
export SWAP_PARTITION="${DEVICE_NAME}3"
export ROOT_PARTITION="${DEVICE_NAME}4"
It’s worthwhile to double-check that all the environment variables refer to the right partitions:
1
2
3
4
5
set|grep _PARTITION
BOOT_PARTITION=/dev/sda2
ROOT_PARTITION=/dev/sda4
SWAP_PARTITION=/dev/sda3
Remember that I’m using the environment variables set above:
1
2
3
mkfs.ext4 ${BOOT_PARTITION}
mkfs.btrfs -f ${ROOT_PARTITION}
mkswap ${SWAP_PARTITION}
Now we mount the root partition to create the BTRFS subvolumes, following a standard scheme, and we unmount it:
1
2
3
4
5
6
7
8
9
mount ${ROOT_PARTITION} /mnt
btrfs su cr /mnt/@
btrfs su cr /mnt/@home
btrfs su cr /mnt/@cache
btrfs su cr /mnt/@log
btrfs su cr /mnt/@tmp
umount /mnt
Now we have to mount all the subvolumes to the corresponding directories (the “-m” flag creates the mounting subdirectory if it does not exist); I’m enabling BTRFS compression (by default, the compression level for zstd will be 3):
1
2
3
4
5
mount -o subvol=/@,defaults,noatime,compress=zstd ${ROOT_PARTITION} /mnt
mount -o subvol=/@home,defaults,noatime,compress=zstd -m ${ROOT_PARTITION} /mnt/home
mount -o subvol=/@cache,defaults,noatime,compress=zstd -m ${ROOT_PARTITION} /mnt/var/cache
mount -o subvol=/@log,defaults,noatime,compress=zstd -m ${ROOT_PARTITION} /mnt/var/log
mount -o subvol=/@tmp,defaults,noatime,compress=zstd -m ${ROOT_PARTITION} /mnt/var/tmp
Then, we mount the boot partition on “/mnt/boot” (again, by creating that):
1
mount -m ${BOOT_PARTITION} /mnt/boot
Let’s verify that the layout of the destination filesystem is as expected:
1
2
3
4
5
6
7
8
9
10
tree /mnt/
/mnt/
├── boot
│  └── lost+found
├── home
└── var
├── cache
├── log
└── tmp
Now, we download the tarball for the rootfs of our USB stick installation. The instructions are once again taken from the link mentioned above, and they also include the verification of the contents of the downloaded archive:
Now, we must create the “/etc/fstab” on the mounted partition. To do that, we need to know the UUID of the two partitions by using “blkid”. You need to take note of the UUID from the output (which will be completely different according to the used external device):
We create the file “/etc/fstab” in “/mnt” according to the BTRFS subvolumes and to the other two partitions. This can be done by running the following command, which relies on the values of the 3 environment variables that we have just created:
Note that we must specify “rootflags=subvol=@” because the “/” of is on the subvolume “@”. Otherwise, the system can boot, but then nothing else will work.
We can now unmount the filesystems
1
2
umount /mnt/boot
umount -R /mnt
And we can reboot into the (hopefully) installed Arch Linux on the USB stick to finish a few operations. Remember that we need a wired connection for the next steps.
Upon rebooting, you should see the two entries (if you let the timeout expire, it will automatically boot the first entry):
After we get to the prompt, we can log in with “root” and password “root” (needless to say: change the password immediately).
Let’s connect a network cable (you need a USB adapter for that), and after a few seconds, we should be online. We verify that with “ifconfig”, which should show the assigned IP address for “eth0”.
Since there’s no DE yet, I suggest you keep following the official web pages (and this blog post) by connecting to the PineBook Pro via SSH so that it will be easy to copy and paste commands into the terminal window of another computer. Moreover, when logged into the PineBook Pro directly, you will see lots of logging information directly on the console (I guess this could be prevented by passing specific options to the kernel, but we’ll install a DE later, so I don’t care about that much). The SSH server is already up and running in the PineBook Pro installed system, so once we know the IP address from the output of “ifconfig”, we can connect via SSH. However, root access via SSH is disabled, so we must connect with the other predefined account “alarm” and password “alarm” (again, you might want to change this password right away):
1
ssh alarm@<ip address>
Once we’re logged in since “sudo” is not yet configured, we switch to root:
What follows are my own instructions I usually run when installing Arch.
In particular, I configure time, network time synchronization, and timezone (Italy, in my case):
1
2
3
4
5
timedatectl set-timezone Europe/Rome
timedatectl set-ntp on
hwclock --systohc
The next step is required for doing gnome-terminal work (and it’s also part of the Arch standard installation instructions):
Edit “/etc/locale.gen” and uncomment “en_US.UTF-8 UTF-8” and other needed locales.
Generate the locales by running:
1
locale-gen
Edit the “/etc/locale.conf” file, and set the LANG variable accordingly, for example, for the UTF-8 local above:
1
LANG=en_US.UTF-8
We could run a first system upgrade
1
pacman-Syu
I don’t know if that’s strictly required because we’ll add the additional repository for the PineBook Pro in a minute. However, just in case, it might be better to update the system.
Let’s reboot and verify that everything still works.
NOTE: By the way, I noted that if I want to boot from the USB stick, it’s better to use the right-hand side USB port (which is USB 2) instead of the left-hand side port (USB 3). Otherwise, the system seems to ignore the system on the USB stick and boots directly to the installed Manjaro system.
Second part
As mentioned above, I suggest connecting to the PineBook Pro via SSH. In any case, what follows must be executed as “root” (“su -“).
Let’s now add the repositories with kernels and drivers specific to PineBook Pro.
Note that this project also provides a way to install Arch Linux directly with these repositories, with a procedure similar to the one in the first part. I prefer to install official Arch Linux first and then add the additional repositories, though.
And let’s install the packages specific to the PineBook Pro (note that we’re going to install the Linux kernel patched by Manjaro for the PineBook Pro):
It’s about 680 Mb of packages to install, so please be patient.
Now, I enable the primary services (the login manager, the NetworkManager to select a network from KDE, and the profile daemon for switching between power profiles, e.g., “Balanced” and “Powersave”):
The graphical SDDM login manager should greet us this time, allowing us to get into KDE and select a WiFi connection.
NOTE: I always hear a strange noise when the login manager or the KDE DE starts. It also happens with the pre-installed Manjaro. It must be the sound card that gets activated…
IMPORTANT NOTE: Upon rebooting, the WiFi does not always work (it looks like the WiFi card is not seen at all); that also happens with Manjaro. The only solution is to shut down the computer (i.e., NOT simply rebooting it) and boot it again.
Here’s the KDE About dialog:
And of course, once installed, let’s run “neofetch”:
That’s all for now!
In a future blog post, I’ll describe my customizations to KDE (installed programs and configurations).
In a previous post, I reported the procedure for installing Arch Linux. The procedure is basically the one shown in the official Arch Wiki.
After a few manual steps, this post will show my installation script for automatically installing Arch Linux. I took inspiration from https://github.com/ChrisTitusTech/ArchTitus, but, differently from that project, my script is NOT meant to be reusable. The script is heavily tailored to my needs. I describe it in this post in case it might inspire others to follow a similar approach 🙂
I’ll describe the script by demonstrating its use for installing Arch Linux on a virtual machine (VirtualBox). However, I use the script for my computers. Also, for real computers, I perform the installation via SSH from another computer for the same reasons I have already explained.
The virtual machine preparation is the same as in my previous post, so I’ll start from the already configured machine.
I start the virtual machine with the Arch ISO mounted:
Inside the live environment, the SSH server is already up and running. However, since we’ll connect with the root account (the only one present), we must give the root account a password. By default, it’s empty, and SSH will not allow you to log in with a blank password. Choose a password. This password is temporary; if you’re in a trusted local network, you can choose an easy one.
Then, I connect to the virtual machine via SSH.
1
ssh-p2522root@127.0.0.1
From now on, I’ll insert all the commands from a local terminal connected to the virtual machine.
Initial manual steps
First, I ensure the system clock is accurate by enabling network synchronization NTP:
1
timedatectl set-ntp true
Then, I partition the disk according to my needs. My script heavily relies on this partitioning scheme consisting of four partitions:
the one for booting in UEFI mode, formatted as FAT32, 300Mb (it should be enough for UEFI, but if unsure, go on with 512Mb)
a swap partition, 20Gb (I have 16Gb, and if I want to enable hibernation, i.e., suspend to disk, that should be enough)
a partition meant to host common data that I want to share among several Linux installations on the same machine (maybe I’ll blog about that in the future), formatted as EXT4, 30Gb
the root partition, formatted as BTRFS, the rest of the disk
To do that, I’m using cfdisk, a textual partition manager, which I find easy to use. In the virtual machine, the disk is “/dev/sda”:
The partitions must be manually formatted:
1
2
3
4
mkfs.fat-F32/dev/sda1
mkswap/dev/sda2
mkfs.ext4/dev/sda3
mkfs.btrfs/dev/sda4
Sometimes, I have problems with the keyring, so I first run the following commands that ensure the keyring is up-to-date:
1
2
3
4
killall gpg-agent
rm-rf/etc/pacman.d/gnupg
pacman-key--init
pacman-key--populate archlinux
I’m going to clone the installation script from GitHub, so I need to install “git”:
1
pacman-Sy git
And now, I’m ready to use the installation script.
Running the installation script
First, I clone the installation script from GitHub:
The script has no parameter but relies on a few crucial environment variables to set appropriately. The first four variables refer to the partitions I created above. The last one is the name for the machine (in this example, it will be “arch-gnome”):
1
2
3
4
5
export EFI_PARTITION=/dev/sda1
export SWAP_PARTITION=/dev/sda2
export DATA_PARTITION=/dev/sda3
export ROOT_PARTITION=/dev/sda4
export INST_HOSTNAME=arch-gnome
The script will check that all these variables are set. However, it does not check whether the specified partitions are correct, so I always double-check the environment variables.
And now, let’s run it:
1
./install.sh
The script will do all the Arch Linux installation steps. These automatic steps correspond to the ones I showed in my previous post, where I ran them manually.
When the script finishes (it takes a few minutes), I have to perform a few additional manual operations before rebooting. I’ll detail these latter manual operations at the end of the post. In the next section, I’ll describe the script’s parts.
The installation script(s)
As I anticipated, the script actually consists of several scripts.
Note that the installation logs are saved in the “bettini” user’s home directory (the last run script will create the user). These can be inspected later.
The main script calls the other scripts.
We have the script for checking that all the needed environment variables are set (00_check.sh):
Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
set-x#echo on
echo-ne"
Check variables
"
if[[-z${EFI_PARTITION+y}]];then
echo"EFI_PARTITION is not defined"
exit1
else
echo"EFI_PARTITION ${EFI_PARTITION}"
fi
if[[-z${SWAP_PARTITION+y}]];then
echo"SWAP_PARTITION is not defined"
exit1
else
echo"SWAP_PARTITION ${SWAP_PARTITION}"
fi
if[[-z${ROOT_PARTITION+y}]];then
echo"ROOT_PARTITION is not defined"
exit1
else
echo"ROOT_PARTITION ${ROOT_PARTITION}"
fi
if[[-z${DATA_PARTITION+y}]];then
echo"DATA_PARTITION is not defined"
exit1
else
echo"DATA_PARTITION ${DATA_PARTITION}"
fi
if[[-z${INST_HOSTNAME+y}]];then
echo"INST_HOSTNAME is not defined"
exit1
else
echo"INST_HOSTNAME ${INST_HOSTNAME}"
fi
The script 01_mount-partitions.sh mounts the partitions and, for the main BTRFS partition, also creates the BTRFS subvolumes:
Note the use of the environment variable INST_HOSTNAME for creating the file /etc/hosts. I’m using en_US.UTF-8 for the language, but other local configurations are for Italy.
The script 05_bootloader.sh configures and installs GRUB. It also configures GRUB for the “mem_sleep_default” parameter (for suspend) and for hibernation; in that respect, it also configures mkinitcpio accordingly (note the “resume” hook):
Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
set-x#echo on
set-eo pipefail
# This is meant to be executed with arch-chroot /mnt
As you see, most of the steps are performed by the script! 🙂
I can restart the system (in this example, the virtual machine) and enjoy the installed Arch!
That’s another reason why I love Arch Linux so much: the installation can be easily scripted!
It took me some time to finalize all the scripts, but using a virtual machine, especially with snapshots, wasn’t that hard. I encourage you to bake your installation script. It’ll be fun 🙂
By the way, before existing chroot and rebooting, I usually run my Ansible playbook for installing other programs (either KDE or GNOME) and configure the system and user according to my needs. I’ll blog about such a playbook in the future.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.