Build KDE Minimal

From Manjaro Linux
Jump to: navigation, search

Prerequisites

Before we begin. You need Kernel linux49 or newer. It is highly recommended to run Manjaro-Tools from the latest version of Manjaro Distribution.

Install manjaro-tools

To get started you need to install the needed packages. This document is based on v0.15 of manjaro-tools.

sudo pacman -S manjaro-tools

You will have the possibility of choosing which packages you will include but for the best result - go with default.

  • manjaro-tools-base
  • manjaro-tools-iso
  • manjaro-tools-pkg
  • manjaro-tools-yaml
  • manjaro-iso-profiles-community
  • manjaro-iso-profiles-official
  • sonar-iso-profiles

You can go on from here but you probably want to modify a profile or create your own.

To do so you must be prepared to work as root using sudo for every command including editing and copying files. Working as root can be a bit annoying and prone to system-wide disaster so here is usable recipe for mimimizing the annoyance and risk of disaster.

Recipe for painless working with iso-profiles

With this recipe you will create iso-profile workspace in your home folder - but it could be created anywhere.

Copy manjaro-tools config folder to your home

cp -r /etc/manjaro-tools ~/.config

Symlink iso-profiles to your home folder

ln -s /usr/share/manjaro-tools/iso-profiles ~/ 

Convenient access to manjaro-tools.conf

Remember that the `iso-profiles` folder is symlinked so we actually create it under `/usr/share/manjaro-tools/iso-profiles` which is why sudo is needed.

sudo ln -s ~/.config/manjaro-tools/manjaro-tools.conf ~/iso-profiles

Create your own iso-profile

The nature of Manjaro-Tools dictates that two profiles with the same name cannot co-exist.

Create a folder for your spin

We create a new folder under the `iso-profiles` folder for it. Remember that the `iso-profiles` folder is symlinked so we actually create it under `/usr/share/manjaro-tools/iso-profiles` which is why sudo is needed to create the folder and modify permissions.

sudo mkdir ~/iso-profiles/my-spin-off

The `/usr/share/manjaro-tools/iso-profiles` folder is owned by root:root so to get write access to our new spin-off folder we need to change the permissions for that folder

sudo chmod o+w ~/iso-profiles/my-spin-off

The above line is an improvement to the previous which was `chmod 0777 ~/iso-profiles/my-spin-off`. The improvement is that we do not grant unneeded permissions with this approach.

Copy the official KDE profile to your folder and rename on the fly

cp -r ~/iso-profiles/manjaro/kde/ ~/iso-profiles/my-spin-off/my-kde

Manjaro-Tools configuration

manjaro-tools.conf is the central configuration file for all tools which is part of manjaro-tools. Only edit the general and the "buildiso" part to not exceed the scope of this tutorial. If you are not sure what and how to edit it, do not edit it. You can always use arguments with the buildiso command later.

Customize manjaro-tools-conf

By default, the systemwide config file is installed in

/etc/manjaro-tools/manjaro-tools.conf

If you followed the recipe, a userconfig manjaro-tools.conf file is placed in your home directory here:

~/.config/manjaro-tools/manjaro-tools.conf

Easily accessible since we symlinked it to

~/iso-profiles/manjaro-tools.conf

If the user-config is present, manjaro-tools/buildiso will load the user-config values, however, if variables have been set in the system-wide config file, these values take precedence over the user-config. Best practice is to leave the system-wide file untouched. By default it is commented and shows just initialization values done in code.

The default manjaro-tools.conf can be viewed by unfolding this block

######################################################
################ manjaro-tools.conf ##################
######################################################

# default target branch
# target_branch=stable

# default taget arch: auto detect
# target_arch=$(uname -m)

# cache dir where buildpkg, buildtree cache packages/pkgbuild, builiso iso files
# cache_dir=/var/cache/manjaro-tools

# build dir where buildpkg or buildiso chroots are created
# chroots_dir=/var/lib/manjaro-tools

# log dir where log files are created
# log_dir='/var/log/manjaro-tools'

# custom build mirror server
# build_mirror=http://mirror.netzspielplatz.de/manjaro/packages

################ buildtree ###############

# manjaro package tree
# repo_tree=('core' 'extra' 'community' 'multilib' 'openrc')

# host_tree=https://github.com/manjaro

# default https seems slow; try this
# host_tree_abs=git://projects.archlinux.org/svntogit

################ buildpkg ################

# default pkg build list; name without .list extension
# build_list_pkg=default

################ buildiso ################

# default iso build list; name without .list extension
# build_list_iso=default

# the dist release; default: auto
# dist_release=17.0

# the branding; default: auto
# dist_branding="MJRO"

# possible values: openrc,systemd
# initsys="systemd"

# unset defaults to given value
# kernel="linux49"

# gpg key; leave empty or commented to skip sfs signing
# gpgkey=""

################ deployiso ################

# the server user
# account=[SetUser]

# the server project
# project="[SetProject]"

# set upload bandwidth limit in kB/s
# limit=100

# the torrent tracker urls, comma separated
# tracker_url='udp://mirror.strits.dk:6969'

# Piece size, 2^n
# piece_size=21

# iso mirrors
# iso_mirrors=('heanet' 'jaist' 'netcologne' 'iweb' 'kent')

ISO profile

The iso-profile holds all settings for a specific build of the Manjaro Linux system

ISO profile overview

I will continue, assuming you used the above recipe. Now open your filemanager and navigate to

~/iso-profiles/my-spin-off/my-kde

Let's take a closer look at the KDE profile folder:

 ~/iso-profiles/my-spin-off/my-kde
 ├── '''desktop-overlay'''
 │   └── etc
 │       ├── pam.d
 │       │   └── sddm
 │       ├── sddm.conf
 │       └── sysctl.d
 │           └── 50-max_user_watches.conf
 ├── live-overlay
 │   └── etc
 │       ├── default -> ../../../../shared/manjaro/live-overlay/etc/default
 │       ├── fstab -> ../../../../shared/manjaro/live-overlay/etc/fstab
 │       ├── issue -> ../../../../shared/manjaro/live-overlay/etc/issue
 │       ├── pam.d -> ../../../../shared/manjaro/live-overlay/etc/pam.d
 │       ├── skel
 │       └── xdg
 │           └── kdeglobals
 ├── '''Packages-Desktop'''
 ├── Packages-Live -> ../../shared/Packages-Live
 ├── Packages-Mhwd -> ../../shared/Packages-Mhwd
 ├── Packages-Root -> ../../shared/Packages-Root
 └── '''profile.conf'''
  • desktop-overlay: After every successful installation of your ISO the files and folders in here will get copied over.
  • live-overlay: Similar to desktop-overlay. Files and folders in here will only get copied over to the LiveCD of your ISO.
  • Packages-Desktop: This file contains packages for the ISO installation. All packages will also get installed on LiveCDs.
  • Packages-Live: This file contains packages, which will only get installed on the LiveCD.
  • Packages-Mhwd: This file contains Mhwd packages important to all Manjaro installations and LiveCDs.
  • Packages-Root: This file contains base packages important to all Manjaro installations and LiveCDs.
  • profile.conf contains basic settings for your ISO installation and LiveCD.

A file not listed above but could become useful if you want your own online repo is

  • user-repos.conf

The file does not exist but if created it will be merged with the `pacman.conf` on the resulting iso.

ATTENTION

Every file and folder in iso-profiles are readonly. Several files and folders are only symlinks to the shared ISO profile. Never change files or folders in the manjaro-tools iso-profiles.

  • Keep your changes to your folder my-spin-off and you're good.
  • All folders and files specific to your ISO are in bold. You can change them to your liking.
  • It is good practice to - never change the shared profile - instead delete the symlink in your ISO profile and copy from the shared folder.

Modifying an ISO profile

The most common places to tweak and customize an ISO profile are the 1 folder and 2 files bolded above: desktop-overlay, profile.conf, Packages-Desktop:

The desktop-overlay folder

The desktop-overlay folder looks like this:

/manjaro-tools/iso-profiles/manjaro/kde/desktop-overlay
├── desktop-overlay
│   └── etc
│       ├── pam.d
│       │   └── sddm
│       ├── sddm.conf
│       └── sysctl.d
│           └── 50-max_user_watches.conf

After the ISO has been successfully installed all files and folder in desktop-overlay folder get copied over to the installed system. This includes settings/config files but also themes and backgrounds/pictures.

You can customize it by creating a skel-folder in the etc-folder

The profile.conf file

This config file contains setting options. All default settings are commented. If you want to change them, uncomment them (remove the # symbol in front) and change it.

The following settings are noteworthy:

  • initsys= lets you choose between systemd and OpenRC. This setting is associated with the >systemd and >openrc flags in your package lists.
  • multilib= setting belongs to the >multilib flag in your package lists. multilib will install basic 32bit libraries on 64bit systems. This increases compatibility for 32bit applications on 64bit systems.
  • displaymanager= sets the display / login manager your system uses. You need to list your display manager in your package list, too.
  • nonfree_xorg= refers to proprietary graphics drivers.
  • plymouth_boot= lets you activate Plymouth (the graphics displayed during boot). Do not forget the plymouth package in your package list.
  • pxe_boot= activates PXE boot on your system.
  • netinstall= activates an additional package selection in calamares. These packages will be downloaded and installed during the installation of the ISO (besides the packages in Packages-Desktop and Packages-Xfce). The list of packages gets chosen from this Github repository according to your ISO profile. Look for a file called packages-systemd.yaml.
  • chrootcfg=: If both netinstall=true and chrootcfg=true are set, the ISO will become a pure net install. This means that no packages from Packages-Desktop, Packages-Desktop, Packages-Mhwd, and Packages-Root will get installed during ISO installation. Only packages present in this Github repository in a file called chrootcfg-systemd.yaml will get installed. Calamares offers a comfortable selection screen, where all packages (to be installed on your system) can be selected.
  • kernel= lets you set the installed kernel. Do not include any kernels in your package list! This setting is all you need.
  • enable_systemd= let's you set systemd services, which get started on the installed system (and with a similar setting on the livecd). A similar setting is available for OpenRC.

This is about creating a minimal KDE iso file. To do so we change an entry in the profile.conf file. Find the section

 # use extra packages as defined in pkglist to activate a full profile
 # extra="false"
 extra="true"

and change

 extra="false"

but since extra as default is disabled you can comment the line

 # extra="true"

You can change several default options to your liking

 hostname=
 username=
 password=

The default profile.conf can be viewed by unfolding this block

##########################################
###### use this file in the profile ######
##########################################

# use multilib packages; x86_64 only
# multilib="true"

displaymanager="sddm"

# Set to false to disable autologin in the livecd
# autologin="true"

# nonfree mhwd drivers
# nonfree_mhwd="true"

# use pxe boot; initcpio hook
pxe_boot="false"

# use extra packages as defined in pkglist to activate a full profile
# extra="false"
extra="true"

################ install ################

# unset defaults to given value
# efi_boot_loader="grub"

# configure calamares for netinstall
# netinstall="false"

# configure calamares to use chrootcfg instead of unpackfs
# chrootcfg="false"

# use geoip for localization
# geoip='true'

# unset defaults to given values
# names must match systemd service names
enable_systemd=('avahi-daemon' 'bluetooth' 'cronie' 'ModemManager' 'NetworkManager' 'org.cups.cupsd' 'tlp' 'tlp-sleep')
disable_systemd=('pacman-init')

# unset defaults to given values,
# names must match openrc service names
# enable_openrc=('acpid' 'bluetooth' 'cgmanager' 'consolekit' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
# disable_openrc=()

# the same workgroup name if samba is used
# smb_workgroup=""

################# livecd #################

# unset defaults to given value
# hostname="manjaro"

# unset defaults to given value
# username="manjaro"

# unset defaults to given value
# password="manjaro"

# the login shell
# defaults to bash
# login_shell=/bin/bash

# unset defaults to given values
# addgroups="video,audio,power,disk,storage,optical,network,lp,scanner,wheel"

# unset defaults to given values
# names must match systemd service names
# services in enable_systemd array don't need to be listed here
# enable_systemd_live=('manjaro-live' 'mhwd-live' 'pacman-init' 'mirrors-live')

# unset defaults to given values,
# names must match openrc service names
# services in enable_openrc array don't need to be listed here
# enable_openrc_live=('manjaro-live' 'mhwd-live' 'pacman-init' 'mirrors-live')

The Packages-Desktop file

Whenever you see greater-than followed by a keyword like

 >extra

It indicates a condition and the following package or set of packages is installed if the condition is true

 >openrc
 >systemd
 >multilib
 >extra
 >basic

The default Desktop-Packages file for KDE can be viewed by unfolding this block

## Network
>systemd avahi
>openrc avahi-openrc
>systemd networkmanager
>openrc networkmanager-openrc
>openrc networkmanager-consolekit
networkmanager-openconnect
networkmanager-openvpn
networkmanager-pptp
networkmanager-vpnc
networkmanager-dispatcher-ntpd
nss-mdns # NSS support for mDNS (optdepend for avahi)
>systemd ntp
>openrc ntp-openrc
mobile-broadband-provider-info
modemmanager
>systemd openresolv
>systemd openssh
>openrc openssh-openrc
samba

## Libraries for Sound/Audio/Video
alsa-firmware
>systemd alsa-utils
>openrc alsa-utils-openrc
ffmpeg
gst-libav
gst-plugins-bad
gst-plugins-base
gst-plugins-good
gst-plugins-ugly
libcanberra
>multilib lib32-libcanberra
libcanberra-pulse
>multilib lib32-libcanberra-pulse
libcanberra-gstreamer
libdvdcss
manjaro-alsa
manjaro-pulse
>extra phonon-qt4-gstreamer
phonon-qt5-gstreamer
pulseaudio-bluetooth
pulseaudio-ctl
pulseaudio-zeroconf

## Connect Packages
android-tools
android-udev
gvfs
gvfs-afc
gvfs-gphoto2
gvfs-mtp
gvfs-nfs
gvfs-smb
kamera
mtpfs
udiskie
udisks2

## AUR Support/Development
# Missing base-devel packages
autoconf
automake
binutils
bison
fakeroot
flex
gcc
>multilib gcc-multilib
libtool
m4
make
patch
pkg-config
>multilib lib32-flex
# Extra packages for AUR support
>extra git
>extra patchutils
>extra subversion
yaourt

## Fonts
# cantarell-fonts        # Installed as gnome-themes-standard dependency
noto-fonts               # default font
# noto-fonts-cjk         # big package, ~76 mb compressed
>extra noto-fonts-emoji
>extra terminus-font
>extra ttf-bitstream-vera
# ttf-dejavu             # Installed as gnome-themes-standard dependency
# ttf-hack               # Installed as plasma-integration dependency
>extra ttf-inconsolata
>extra ttf-indic-otf
>extra ttf-liberation
>extra ttf-droid

## Games
>extra steam-manjaro

## Package management
octopi
octopi-notifier-frameworks
octopi-cachecleaner
octopi-repoeditor

## Java
>extra jdk8-openjdk
>extra jre8-openjdk-headless
>extra jre8-openjdk

## Printing
>extra cups
>extra cups-pdf
>extra cups-pk-helper
>extra ghostscript
>extra gsfonts
>extra gtk3-print-backends
>extra hplip
>extra splix

## Optional dependencies for hplip
>extra pyqt5-common # For hplip
>extra python-pillow # For hplip
>extra python-pip # For hplip
>extra python-pyqt5  # For hplip gui
>extra python-reportlab # For hplip

## Display manager
>systemd sddm
>openrc sddm-consolekit
sddm-kcm

## Plasma5
bluedevil
kde-gtk-config
kdeplasma-addons
kgamma5
kinfocenter
kmenuedit
kscreen
kscreenlocker
ksshaskpass
ksysguard
kwallet-pam
kwayland-integration
kwin
qt5-virtualkeyboard  # Virtual keyboard support for kwin-wayland
kwrited
milou
plasma-desktop
plasma-nm
plasma-pa
plasma-workspace
>extra plasma-workspace-wallpapers
powerdevil
systemsettings
user-manager

## Themes QT/GTK/SDDM
breeze
>extra breeze-kde4
breeze-gtk
gnome-icon-theme
gnome-themes-standard
gtk-theme-breath
>extra gtk-theme-maia
>extra oxygen
>extra oxygen-kde4
>extra oxygen-icons
plasma5-themes-breath  # Default
>extra plasma5-themes-maia
sddm-breath-theme  # Default
>extra sddm-maia-theme

## Better systray/notifications support
>extra sni-qt  # A Qt plugin that enables tray icons in qt4 applications

## KDE Applications
ark
>extra digikam
dolphin
dolphin-plugins
>extra filelight
>extra k3b
kate
kcalc
>extra keditbookmarks
kfind
kdeconnect
okular
>extra kdenetwork-kget
kdenetwork-filesharing
>extra kdenlive
kde-servicemenus-rootactions
khelpcenter
kio-extras
>extra kleopatra
konsole
konversation
ksystemlog
kwalletmanager
kwrite
gwenview
partitionmanager
>extra print-manager
>extra skanlite
spectacle

## Optional dependencies for ark
p7zip  # 7Z format support
unrar  # RAR format support
unzip  # ZIP format support
zip    # ZIP compression support

## Optional dependency for digikam
>extra kipi-plugins  # more tools and plugins

## Optional dependencies for dolphin
kdegraphics-thumbnailers  # PDF and PS thumbnails
ffmpegthumbs              # video thumbnails
ruby                      # installing new service menus with GHNS

## Optional dependencies for gwenview
kimageformats     # support for dds, xcf, exr, psd, and more image formats
qt5-imageformats  # support for tiff, webp, and more image formats

## Optional dependencies for k3b
>extra cdparanoia    # for cd ripping support
>extra cdrdao        # for disk-at-once (DAO) mode support
>extra dvd+rw-tools  # for dvd burning support
>extra emovix        # for bootable multimedia cd/dvd support
>extra transcode     # for advanced mpeg conversion support
>extra vcdimager     # for vcd burning support

## Optional dependencies for kaccounts-integration
kaccounts-providers

## Optional dependencies for kdeconnect
sshfs  # remote filesystem browser

## Optional dependencies for kdenlive
>extra cdrtools         # for creation of DVD ISO images
>extra dvdauthor        # for creation of DVD
>extra dvgrab           # for firewire capture
>extra recordmydesktop  # for screen capture
>extra xine-ui          # for DVD preview
>extra movit            # for GPU video processing

## Optional dependencies for okular
poppler-data  # encoding data to display PDF documents containing CJK characters

## Optional dependencies for print-manager
>extra system-config-printer  # auto-detect the printer driver
>extra python-pysmbc          # SMB browser support

## Applications
>extra cantata
dmidecode # for inxi -m output
htop
imagewriter
>extra inkscape
inxi
>extra krita
>extra firefox-kde
>basic qupzilla
>extra flashplugin
>extra libreoffice-still
manjaro-hello
manjaro-settings-manager-kcm
manjaro-settings-manager-knotifier
powertop
>extra qbittorrent
screenfetch
>systemd systemd-kcm
>extra thunderbird-kde
vlc-nightly
yakuake

## Optional dependencis for cantata
>extra mpd       # playback
>extra perl-uri  # dynamic playlist

## Documentation
manjaro-documentation

## Settings packages
>extra manjaro-kde-settings
>basic manjaro-kde-minimal-settings
manjaro-browser-settings

## Xorg Input Drivers
xf86-input-elographics
xf86-input-evdev
xf86-input-keyboard
xf86-input-libinput
xf86-input-mouse
xf86-input-void

## Xorg Server and Graphics
xorg-server
xorg-server-utils
xorg-twm
xorg-utils
xorg-xinit
mesa-demos
>multilib lib32-mesa-demos

## Desktop Utils
perl-file-mimeinfo
xdg-user-dirs
xdg-utils
xdg-su

## Misc
>openrc consolekit-openrc
>openrc displaymanager-openrc
>openrc pm-utils
>openrc cgmanager-openrc
manjaro-hotfixes

This file contains a list of packages, which will get installed on your installed ISO (KDE) and the LiveCD (the packages in Packages-Live file only get installled on the live ISO). This is a package list with KDE specific packages (and packages you like to add to your custom Manjaro ISO) of multiple package lists in your ISO profile. The other package lists are more generic.

You can add or remove package names from this list as you like. You do not need to worry about dependencies when adding package names, just make sure the package name is spelled correctly and the package is available in the Manjaro repositories.

  • # marks a comment. The rest of the line after the # symbol gets ignored.
  • >i686 is a flag and marks a package, which will only get installed on the 32bit version of your ISO (KDE).
  • >x86_64 is also a flag and marks a package, which will only get installed on the 64bit version of your ISO (KDE).

Adding AUR packages

If you want to add AUR packages to your ISO, you need to create a online repository.

Add a file in your profile dir named user-repos.conf

 [custom]
 SigLevel = Optional TrustAll
 Server = file:///home/custompkgs

Buildiso with AUR packages: Using buildpkg

Build your ISO

Build your ISO with the following command - assuming you tagged along with the recipe:

 buildiso -p my-kde

You need to specify the name of your ISO profile after the -p argument. In this case, it is my-kde.

If the build process fails with an error, start it again.

ATTENTION: The build process needs at least 10-20 minutes to complete or much longer when you are using HDDs, slow CPUs, or large ISOs.

When the build process finishes successfully, the ISO file and the package list will appear in this folder:

 /var/cache/manjaro-tools/iso/my-spin-off/my-kde/your-branding/

Buildiso CLI

You can use arguments with the buildiso command for more build options:

 buildiso -p my-kde -a i686 -b stable
  • -a let's you build for other architectures. Here, it builds a 32bit ISO image on a 64bit host system. You can also set this in your manjaro-tools.conf file.
  • -b let's you specify the branch. You can also set this in your manjaro-tools.conf file.

You can find other examples of builds using different arguments for buildiso here.

Cleaning your hard drive

After a successful or failed build, you can get rid of most data (the "raw" ISO with all downloaded packages) by deleting this folder:

 sudo rm -r /var/lib/manjaro-tools/buildiso/

To clean your system of packages files of packages not installed on your system (this includes all the package files downloaded for your custom ISO):

 paccache -ruk0

You can also manually look into

 /var/cache/manjaro-tools/

and delete folders or files to your liking. If you want to delete all ISO images, package lists, and cached Xorg packages do:

 sudo rm -r /var/cache/manjaro-tools/

Please remember that all these packages and files are saved for your convenience. If you clean your system like suggested above, you have to download all packages and build all images again the next time you want to build your own Manjaro ISO.

Further Reading

Forum post about this wiki article

Tutorials for manjaro-tools and buildiso

It is also possible to ask questions on IRC:

  • Server: irc.freenode.net
  • Channel: #manjaro