[root tip] [How To] Mini guide to build Manjaro ISO

Build Manjaro ISO

Prerequisites

  1. lots of diskspace (skip this if your root is sufficiently large)
  2. installing the tools
  3. tools configuration
  4. building

Diskspace

You need a lot diskspace - 15-20G per iso you intend to build

The tools

Install the manjaro-tools needed for building an ISO

sudo pacman -Syu git manjaro-tools-iso-git

Configure tools

With the tools installed copy the default tools configuration to your home

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

Modify the tools configuration to point to your storage partition’s mount point - use your favorite editor to edit the file

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

Then use git to clone the iso profiles repo in your home

git clone https://gitlab.manjaro.org/profiles-and-settings/iso-profiles

Create a config file ~/.config/manjaro-tools/iso-profiles.conf with content

run_dir=/home/$USER/iso-profiles

Building

The building can be as simple as

buildiso -p kde

If you did not change the paths in manjaro-tools.conf the resulting xfce ISO is stored at

/var/cache/manjaro-tools/iso/manjaro/kde

Advanced Use

The ISO cake layers

Package Lists Configuration Files File system Overlays / Shadows
Packages-Mhwd mhwdfs.sfs
Packages-Live live-overlay livefs.sfs desktop
Packages-Desktop desktop-overlay desktopfs.sfs root
Packages-Root root-overlay rootfs.sfs

The desktop.sfs and rootfs.sfs is unpacked by the installer to make the final system.

Customising the desktop packages

Inside the iso-profiles folder - create a new folder to hold you custom profile (assuming you cloned the iso-profiles to your home)

cd ~/iso-profiles
mkdir custom

Copy the profile you want to use e.g. KDE Plasma

cp -R manjaro/kde custom/plasma

Edit the file ~/iso-profiles/custom/plasma/Packages-Desktop - add and remove packages as you see fit.

Sample Customised Packages-Desktop
adobe-source-sans-pro-fonts
alsa-firmware
alsa-utils
ark
avahi
bluedevil
breeze-gtk
dolphin
dolphin-plugins
ffmpeg
ffmpegthumbs                       # video thumbnails
firefox
grub-btrfs
grub-theme-manjaro
gwenview
htop
inxi
kate
kcalc
kde-gtk-config
kdegraphics-thumbnailers           # PDF and PS thumbnails
kdeplasma-addons
kfind
kgamma
khelpcenter
kimageformats                      # support for dds, xcf, exr, psd, and more image formats
kinfocenter
kio-extras
kmenuedit
konsole
kscreen
kscreenlocker
ksshaskpass
ksystemlog
kwallet-pam
kwalletmanager
kwayland-integration
kwin
kwrited
libcanberra
libdvdcss
libva-intel-driver
libva-mesa-driver
manjaro-alsa
manjaro-application-utility
manjaro-browser-settings
manjaro-gstreamer
manjaro-hello
manjaro-kde-settings
manjaro-modem
manjaro-pipewire
mesa-utils
mobile-broadband-provider-info
modemmanager
networkmanager
networkmanager-l2tp
networkmanager-openconnect
networkmanager-openvpn
networkmanager-vpnc
noto-fonts                         # default font
nss-mdns                           # NSS support for mDNS (optdepend for avahi)
ntp
numlockx
okular
openssh
p7zip                              # 7Z format support
pamac-cli
pamac-gtk3
papirus-icon-theme                 # manjaro-application-utility icons
perl-file-mimeinfo
phonon-qt6-vlc
plasma-browser-integration
plasma-desktop
plasma-nm
plasma-pa
plasma-systemmonitor               # plasma-meta, replaces ksysguard
plasma-thunderbolt
plasma-workspace                   # required by plasma-desktop, etc., replaces plasma-wayland-session
plymouth
plymouth-kcm
plymouth-theme-manjaro
power-profiles-daemon
powerdevil
qt6-imageformats                   # support for tiff, webp, and more image formats
qt6-virtualkeyboard                # required by plasma-workspace
samba
sddm
sddm-breath-theme
sddm-kcm
smbclient
smplayer
smplayer-skins
smplayer-themes
spectacle                          # screenshots
sshfs                              # remote filesystem browser
systemsettings
terminus-font
ttf-dejavu
ttf-hack
udiskie
udisks2
unarchiver                         # RAR format support
usb_modeswitch
xdg-desktop-portal-kde
xdg-user-dirs
xdg-utils
xf86-input-elographics
xf86-input-evdev
xf86-input-libinput
xf86-input-void

To build a minimal profile without multilib packages

buildiso -p plasma -b stable -k linux612 -n

The resulting ISO can be found in /var/cache/manjaro-tools/custom/plasma

That’s it - piece of :cake: - right?

Very Advanced Use

Build an ISO from current system

There is no GUI to create an ISO from current state.

Technically you can use buildiso so I have outlined the commands necessary

I recommend to test them as they are written from memory - flash memory - the kind of memory which is gone in a flash :slight_smile: - after you have tested them you create a script to do lifting for you.

Steps

1. Create a folder in the root filesystem to hold your system

sudo mkdir /mybuild

2. Set permissions on the folder

Setting your user as owner which automagically gives rw access

sudo chown $USER:$USER /mybuild

3. Clone the iso-profiles repo into /mybuild

git clone https://gitlab.manjaro.org/profiles-and-settings/iso-profiles /mybuild/iso-profiles

4. Create a folder to hold your build

mkdir /mybuild/iso-profiles/$USER

5. Copy the relevant profile-folder into mybuild

In this case it is Plasma - it would work for any edition - ensure a unique name the folder - it must be unambigious across iso-profiles subfolders

cp -R /mybuild/iso-profiles/manjaro/kde /mybuild/iso-profiles/$USER/my-kde

6. Clean up your system for orphans

pamac remove --orphans

7. Create a package list of your current system

Excluding custom packages

pacman -Qqen > ~/my-packages.txt

8. Create new filtered list

Use the comm utility comparing the two files ~/my-packages.txt and /rootfs-pkgs.txt and pipe the result to replace the my-kde profile’s Packages-Desktop file

comm -23 <(sort ~/my-packages.txt) <(cat /rootfs-pkgs.txt | cut -d' ' -f1 | sort) > /mybuild/iso-profiles/$USER/my-kde/Packages-Desktop

9. Create the folder to hold your personal settings

mkdir -p /mybuild/iso-profiles/$USER/my-kde/desktop-overlay/etc/skel

10. Copy the content of your home

Close all open applications - apps which may keep files open in relevant folders. E.g. browsers and mail clients.

Copy the content of your home into the desktop-overlay/etc/skel folder - make sure to be selective and remove unwanted files like Documents and Pictures and whatnot - watch out for hidden files and folders e.g. ~/.mozilla

cp -R $HOME/. /mybuild/iso-profiles/$USER/my-kde/desktop-overlay/etc/skel

11. Run buildiso

Use the -t target directory argument to place your build inside the /mybuild folder.

If you have used buildiso previously with another profile-root you need to edit the file ~/.config/manjaro-tools/iso-profiles.conf to point to the folder /mybuild/iso-profiles

buildiso -p my-kde -t /mybuild

The size of the final ISO will be reflected by the packagelist and the size of your $HOME folder

More reading


More info can be found at the wiki - including how to include your own web based package repository

7 Likes

This is not a support thread.

If you have questions please create a new topic - link to this.

1 Like