Manjaro Difference between revisions of "Build Manjaro ISOs with buildiso"

Difference between revisions of "Build Manjaro ISOs with buildiso"

From Manjaro
imported>Excalibur1234
imported>Excalibur1234
Line 59: Line 59:
=ISO profile=
=ISO profile=


You can adjust everything you want to change in your ISO (add packages or other files, adjust settings, etc.) in your profile folder located here:
Your <code>manjaro-tools-iso-profiles</code> folder contains these ISO profiles:
 
cinnamon/
enlightenment/
gnome/
kde/
kde5/
kde-minimal/
kde-openrc/
lxde/
lxqt/
lxqt-openrc/
mate/
net/
netbook/
net-openrc/
openbox/
pantheon/
shared/
sysmenu/
xfce/
xfce-minimal/
xfce-openrc/
README.md
 
The <code>shared</code> ISO profile is special, because it contains common files for all Manjaro ISO profiles (unless the profile creators explicitly used their own customized files)
 
 
Let's take a closer look at the XFCE profile folder:
 
'''xfce-overlay'''
isolinux -> ../shared/isolinux/
mkinitcpio.conf -> ../shared/mkinitcpio.conf
overlay -> ../shared/overlay/
overlay-livecd -> ../shared/overlay-livecd/
Packages -> ../shared/Packages-Systemd
Packages-Livecd -> ../shared/Packages-Livecd-Systemd
'''Packages-Xfce'''
Packages-Xorg -> ../shared/Packages-Xorg
'''profile.conf'''
 
* ''xfce-overlay'': After every successful installation of your ISO (XFCE) the files and folders in here will get copied over.
* ''isolinux'': Contains files important for booting your ISO. This includes isolinux.cfg file to start syslinux bootloader.
* ''mkinitcpio.conf'' holds the information of all needed kernel modules.
* ''overlay'': Similar to ''xfce-overlay'', but it contains files and folders important to all Manjaro installations and LiveCDs.
* ''overlay-livecd'': Similar to ''xfce-overlay''. Files and folders in here will only get copied over to the LiveCD of your ISO.
* ''Packages'': This file contains base packages important to all Manjaro installations and LiveCDs.
* ''Packages-Livecd'': This file contains packages, which will only get installed on the LiveCD.
* ''Packages-Xfce'': This file contains packages specific to your ISO (XFCE).
* ''Packages-Xorg'': This file contains Xorg packages important to all Manjaro installations and LiveCDs.
* ''profile.conf'' contains basic settings for your installation and LiveCD.
 
As you have probably noticed, most files and folders are only symlinks to the <code>shared</code> ISO profile. It is good practice to never change files or folders in the <code>shared</code> ISO profile. If you ever want to change them, first copy them to your ISO profile folder and delete the symlink.
 
All
 
 
==Modifying a ISO profile==
 
 
 
You can adjust almost everything you want to change in your ISO (add packages or other files, adjust settings, etc.) in your profile folder located here:


  manjaro-tools-iso-profiles/openbox/
  manjaro-tools-iso-profiles/openbox/





Revision as of 14:36, 5 May 2015


This is a detailed tutorial aimed at beginners how to build Manjaro ISOs.

Manjaro Openbox edition is used as example throughout this tutorial, but there are many more pre-made Manjaro ISO profiles available: cinnamon, enlightenment, gnome, kde, kde5, lxde, lxqt, lxqt-openrc, mate, net, netbook, net-openrc, openbox, openbox-legacy, pekwm-openrc, xfce, xfce-minimal, and xfce-openbox-openrc.


Prerequisites

manjaro-tools-iso-profiles is needed for pre-built Manjaro ISO profiles.

buildiso is needed to build an image/ISO from these profiles. Before March 2015, it used to be part of the manjaroiso package, but now it is integrated into manjaro-tools.

Please make sure you always use the absolute latest manjaro-tools and manjaro-tools-iso-profiles packages available in order to minimize the chance of random or unexplained bugs.


Install manjaro-tools

buildiso has often bugs introduced my new upstream package changes, therefore it is recommended to install the absolute latest version with the most recent bug fixes. A relatively easy way is to install manjaro-tools from the unstable repositories of Manjaro. Alternatively, you can download and build manjaro-tools from GitHub directly.


If you are using the unstable repositories already:

sudo pacman -S manjaro-tools


If you do not use the unstable repositories, you need to install manjaro-tools from the unstable repositories manually:

Please keep in mind that you need to update/re-install this package every time a new version gets released.

Go to this Manjaro mirror in your web browser:

http://mirror.netzspielplatz.de/manjaro/packages/unstable/community/

Choose your architecture and search for the manjaro-tools package and remember its complete name (especially the version number).

Then, use your architecture and the name to install manjaro-tools directly, e.g. with this command:

sudo pacman -U http://mirror.netzspielplatz.de/manjaro/packages/unstable/community/x86_64/manjaro-tools-0.9.6.2-1-any.pkg.tar.xz


Install manjaro-tools-iso-profiles

Clone manjaro-tools-iso-profiles profiles from GitHub (this requires the git package to be installed on your system). Open your terminal in your home directory (or any other directory you want) and type:

git clone https://github.com/manjaro/manjaro-tools-iso-profiles.git


Update manjaro-tools-iso-profiles

Whenever you want to update the manjaro-tools-iso-profiles directory with the latest files from GitHub, execute these commands:

cd manjaro-tools-iso-profiles
git pull origin master


ISO profile

Your manjaro-tools-iso-profiles folder contains these ISO profiles:

cinnamon/
enlightenment/
gnome/
kde/
kde5/
kde-minimal/
kde-openrc/ 
lxde/ 
lxqt/
lxqt-openrc/
mate/
net/
netbook/
net-openrc/
openbox/
pantheon/
shared/
sysmenu/
xfce/
xfce-minimal/
xfce-openrc/
README.md

The shared ISO profile is special, because it contains common files for all Manjaro ISO profiles (unless the profile creators explicitly used their own customized files)


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

xfce-overlay
isolinux -> ../shared/isolinux/
mkinitcpio.conf -> ../shared/mkinitcpio.conf
overlay -> ../shared/overlay/
overlay-livecd -> ../shared/overlay-livecd/
Packages -> ../shared/Packages-Systemd
Packages-Livecd -> ../shared/Packages-Livecd-Systemd
Packages-Xfce
Packages-Xorg -> ../shared/Packages-Xorg
profile.conf
  • xfce-overlay: After every successful installation of your ISO (XFCE) the files and folders in here will get copied over.
  • isolinux: Contains files important for booting your ISO. This includes isolinux.cfg file to start syslinux bootloader.
  • mkinitcpio.conf holds the information of all needed kernel modules.
  • overlay: Similar to xfce-overlay, but it contains files and folders important to all Manjaro installations and LiveCDs.
  • overlay-livecd: Similar to xfce-overlay. Files and folders in here will only get copied over to the LiveCD of your ISO.
  • Packages: This file contains base packages important to all Manjaro installations and LiveCDs.
  • Packages-Livecd: This file contains packages, which will only get installed on the LiveCD.
  • Packages-Xfce: This file contains packages specific to your ISO (XFCE).
  • Packages-Xorg: This file contains Xorg packages important to all Manjaro installations and LiveCDs.
  • profile.conf contains basic settings for your installation and LiveCD.

As you have probably noticed, most files and folders are only symlinks to the shared ISO profile. It is good practice to never change files or folders in the shared ISO profile. If you ever want to change them, first copy them to your ISO profile folder and delete the symlink.

All


Modifying a ISO profile

You can adjust almost everything you want to change in your ISO (add packages or other files, adjust settings, etc.) in your profile folder located here:

manjaro-tools-iso-profiles/openbox/



If you want to know how the folder structure in your profile folder works, read:


When reading about manjaroiso (either in the link given above or in other places), please note the differences between the old manjaroiso and the new manjaro-tools. The most obvious are in your profile directory manjaro-tools-iso-profiles/openbox:

  • these files are not present anymore: isolinux, isomounts, syslinux
  • the options.conf file has completely changed and its new equivalent is called profile.conf
  • the pacman-i686.conf and pacman-x86_64.conf files have been renamed to pacman-default.conf and pacman-multilib.conf. They are no longer required.


If you want to add AUR packages to your ISO, you need to create a local repository and add it to the corresponding pacman-XXXXX.conf file. Read here how to do it for manjaroiso (keep the changes between manjaroiso and manajro-tools in mind): How to install AUR packages in ManjaroISO

manjaro-tools.conf

manjaro-tools.conf is the central configuration file for manjaro-tools/buildiso. 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.

By default, the systemwide config file is installed in

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

Additionally, a userconfig manjaro-tools.conf file can be placed in your home directory here:

~/.config/manjaro-tools.conf

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

Build your ISO

Navigate to the manjaro-tools-iso-profiles folder:

cd manjaro-tools-iso-profiles


Query the settings of buildiso and pretend to build your ISO with the -q argument. This also gives you a nice overview of what is going to happen:

sudo buildiso -p openbox -q

You need to specify the name of your ISO profile, too. In this case, it is openbox.

Then, start to build your ISO for real (just remove the -q argument):

sudo buildiso -p openbox


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

Attention: The build process needs at least 10 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/


Example:

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

sudo buildiso -p xfce-minimal -a i686 -b unstable -q
  • -a let's you build for other architectures. Here, it builds a 32bit ISO image on a 64bit host system.
  • -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 /opt/buildiso/openbox/


To clean your system of packages files downloaded only 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

When you have questions about buildiso, please search for answers in these forum subsections:


Here are some more tutorials of manjaro-tools:


Or ask on IRC:

Server: irc.freenode.net

Channel: #manjaro

Cookies help us deliver our services. By using our services, you agree to our use of cookies.