Manjaro Difference between revisions of "Manjaro-tools"

Difference between revisions of "Manjaro-tools"

From Manjaro
imported>Aaditya
m
 
(31 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
<languages/>
__TOC__
__TOC__


<translate>
= Introduction = <!--T:1-->


= Introduction =
<!--T:2-->
 
''manjaro-tools'' consists of a lot of different tools aimed at Manjaro developers. It is split into 3 different packages:
''manjaro-tools'' consists of 4 different tools: ''mkset'', ''buildpkg'', ''buildtree'', and ''buildiso''.
* ''manjaro-tools-base'' contains basic tools, different chroot tools, and ''buildset''
 
* ''manjaro-tools-pkg'' contains small helper tools, ''buildpkg'', and ''buildtree''
''mkset'' and ''buildpkg'' include scripts and tools for Manjaro Linux package maintainers. Official packages get built in clean chroots to avoid dependency conflicts with our branches.
* ''manjaro-tools-iso'' contains small helper tools and ''buildiso''
 
''buildtree'' is a little tool to sync Arch abs and Manjaro packages git repositories.
 
''buildiso'' is a small set of Bash scripts that is capable of building fully functional Manjaro Linux based live medias. It is a very generic tool, so it could potentially be used to generate anything from rescue systems, to install disks, to special interest live CD systems, and who knows what else. Simply put, if it involves Manjaro on a shiny coaster, it can do it.
 


''manjaro-tools'' is a replacement for [[devtools]] and [[manjaroiso]].


A detailed user manual is available at [https://github.com/manjaro/manjaro-tools github].
<!--T:3-->
All of these ''manjaro-tools'' packages are replacements for '''devtools''' and '''manjaroiso'''.  


<!--T:4-->
A detailed user manual is available at [https://gitlab.manjaro.org/tools/development-tools/manjaro-tools gitlab].


= Configuration =


manjaro-tools can be configured via editing {{ic|''/etc/manjaro-tools/manjaro-tools.conf''}}
= Configuration = <!--T:5-->


<!--T:6-->
manjaro-tools can be configured by copying the folder ''/etc/manjaro-tools'' to your home in ''~/.config'' folder and then edit the file {{ic|''~/.config/manjaro-tools/manjaro-tools.conf''}}


= Files =
= Files = <!--T:7-->


<!--T:8-->
These are the new names for renamed scripts.
These are the new names for renamed scripts.


<!--T:9-->
*    mkmanjaroroot --> mkchroot
*    mkmanjaroroot --> mkchroot
*    manjarobuild --> buildpkg
*    manjarobuild --> buildpkg
*    mkset --> buildset
*    pacstrap --> basestrap
*    pacstrap --> basestrap
*    genfstab --> fstabgen
*    genfstab --> fstabgen
Line 35: Line 38:




= mkset =
= buildset = <!--T:10-->


mkset is used to create build lists. Build lists can be defined in {{ic|/etc/manjaro-tools/sets/<buildlistname>.set}}
<!--T:11-->
buildset is used to create build lists. Build lists can be defined in {{ic|/etc/manjaro-tools/sets/<buildlistname>.set}}


To create a build list, one can run in the pkgbuilds dir:
<!--T:12-->
The help looks like the following:


  mkset -c <name>
  <!--T:13-->
{{UserCmdOutput|command=buildset -h|result=
<pre>
Usage: buildset [options]
    -c <name>   Create set
    -r <name>  Remove set
    -s <name>  Show set
    -i          Iso mode
    -q          Query sets
    -h          This help
</pre>
}}


This will create a build list containing all directories with PKGBUILDs in them. This generated list can be then edited, like packages can be removed.
<!--T:14-->
{{Note|The set name should be different from a directory name in pkgbuilds dir. Anything else should work, eg adding a date to the name.}}


For example, in a git clone of https://github.com/manjaro/packages-openrc
= buildpkg = <!--T:15-->


$ ls
<!--T:16-->
consolekit/                  manjaro-tools-git/          openrc-net/
buildpkg is used to build a particular package or a set. In the following chapter all functions of buildpkg get explained.  
eudev/                      manjaro-tools-git-devel/    openrc-systemdcompat/
eudev-systemdcompat/        manjaro-tools-iso-profiles/  openrc-video/
kde-servicemenus-pkg-tools/  manjaro-tools-livecd/        packages/
keyboardctl-openrc/          networkmanager-openrc/      pkgbuilds-review/
kf5-servicemenus-pkg-tools/  openrc-aur/                  polkit-consolekit/
lib32-eudev/                openrc-base/                sddm-consolekit/
lib32-eudev-systemdcompat/  openrc-core/                sysvinit/
lxqt-lightdm-greeter/        openrc-desktop/              upower-pm-utils/
manjaro-openrc/              openrc-devel/                README.md
manjaro-tools/              openrc-misc/


Running '''mkset -c openrc''' does
<!--T:17-->
If you want a detailed example how to use buildpkg to build packages for a local repository, please look [https://wiki.manjaro.org/index.php?title=Buildiso_with_AUR_packages:_Using_buildpkg here].


$ mkset -c openrc
==> Creating [/etc/manjaro-tools/sets/openrc.set] ...
  -> Adding consolekit
  -> Adding eudev
  -> Adding eudev-systemdcompat
  -> Adding kde-servicemenus-pkg-tools
  -> Adding kf5-servicemenus-pkg-tools
  -> Adding lib32-eudev
  -> Adding lib32-eudev-systemdcompat
  -> Adding lxqt-lightdm-greeter
  -> Adding manjaro-openrc
  -> Adding manjaro-tools
  -> Adding manjaro-tools-git
  -> Adding manjaro-tools-git-devel
  -> Adding manjaro-tools-iso-profiles
  -> Adding manjaro-tools-livecd
  -> Adding networkmanager-openrc
  -> Adding openrc-aur
  -> Adding openrc-base
  -> Adding openrc-core
  -> Adding openrc-desktop
  -> Adding openrc-devel
  -> Adding openrc-misc
  -> Adding openrc-net
  -> Adding openrc-systemdcompat
  -> Adding openrc-video
  -> Adding polkit-consolekit
  -> Adding sddm-consolekit
  -> Adding sysvinit
  -> Adding upower-pm-utils


{{Note|The set name should be different from a directory name in pkgbuilds dir. Anything else should work, eg adding a date to the name.}}
<!--T:18-->
The help looks like the following:


 
<!--T:19-->
= buildpkg =
{{UserCmdOutput|command=buildpkg -h|result=
 
<pre>
buildpkg is used to build a particular package or a set. The help looks like the following for i686
Usage: buildpkg [options]
 
     -a <arch>          Arch [default: x86_64]
$ buildpkg -h
     -b <branch>        Branch [default: stable]
Usage: buildpkg [options] [--] [makepkg args]
    -p <profile>      Set profile or pkg [default: default]
     -a <arch>          Set arch  [default: i686]
     -b <branch>        Set branch [default: stable]
    -r <dir>          Chroots directory [default: /srv/manjarobuild]
     -c                Recreate chroot
     -c                Recreate chroot
     -w                 Clean up
     -h                 This help
    -i <pkg>          Install a package into the working copy of the chroot
     -n                Install and run namcap check
     -n                Install and run namcap check
    -p <pkg>          Build list or pkg [default: default]
    -q                Query settings and pretend build
    -r <dir>          Chroots directory
                      [default: /var/lib/manjaro-tools/buildpkg]
     -s                Sign packages
     -s                Sign packages
     -q                 Query settings and pretend build
     -w                 Clean up cache and sources
    -h                This help
</pre>
}}


<!--T:20-->
To build a single package, go into the directory which is one above the package build directory (which contains the PKGBUILD), and run it as:
To build a single package, go into the directory which is one above the package build directory (which contains the PKGBUILD), and run it as:


  buildpkg -p <package-name>
  <!--T:21-->
 
{{UserCmd|command=buildpkg -p package-name}}
For example, we want to build the upower-pm-utils package from the following PKGBUILD folders
 
$ ls
consolekit                  manjaro-tools          openrc-video
eudev                      networkmanager-openrc  packages
eudev-systemdcompat        openrc-aur            polkit-consolekit
kde-servicemenus-pkg-tools  openrc-base            README.md
keyboardctl-openrc          openrc-core            sddm-consolekit
kf5-servicemenus-pkg-tools  openrc-desktop        sysvinit
lib32-eudev                openrc-devel          upower-pm-utils
lib32-eudev-systemdcompat  openrc-misc
manjaro-openrc              openrc-net
 
To test if the options are correct, the {{ic|-q}} option can be used.
 
$ buildpkg -q upower-pm-utils
==> manjaro-tools
  -> version: 0.9.5.6
  -> manjaro_tools_conf: /etc/manjaro-tools/manjaro-tools.conf
==> OPTIONS:
  -> arch: i686
  -> branch: stable
  -> chroots: /srv/manjarobuild
==> ARGS:
  -> mkchrootpkg_args: -r /srv/manjarobuild/stable/i686
  -> makepkg_args:
  -> clean_first: false
  -> wipe_clean: false
  -> namcap: false
  -> sign: false
==> PATHS:
  -> chrootdir: /srv/manjarobuild/stable/i686
  -> profiledir: /etc/manjaro-tools/sets
  -> pkg_dir: /var/cache/manjaro-tools/stable/i686
  -> pacman_conf: /usr/share/manjaro-tools/pacman-default.conf
  -> makepkg_conf: /usr/share/manjaro-tools/makepkg-i686.conf
  -> mirrors_conf: /usr/share/manjaro-tools/pacman-mirrors-stable.conf
==> BLACKLIST:
  -> blacklist_trigger: eudev lib32-eudev upower-pm-utils eudev-systemdcompat lib32-eudev-systemdcompat
  -> blacklist: libsystemd
==> SETS:
  -> profiles: default
  -> profile: upower-pm-utils
  -> is_profile: false
==> Build queue:
  -> upower-pm-utils
 
After that to build the package {{ic|-p}} can be used.
 
$ buildpkg -p upower-pm-utils
==> Updating chroot for [testing] (x86_64)...
:: Synchronizing package databases...
  core is up to date
  extra is up to date
  community is up to date
:: Starting full system upgrade...
  there is nothing to do
==> Making package: upower-pm-utils 0.9.23-4 (Mon Jan 12 12:38:16 IST 2015)
==> Retrieving sources...
...
...
==> Leaving fakeroot environment.
==> Finished making: upower-pm-utils 0.9.23-4 (Mon Jan 12 07:08:28 UTC 2015)
 
To clean the chroot before building {{ic|-c}} can be used.
$ buildpkg -p upower-pm-utils -c
==> Creating chroot for [testing] (x86_64)...
  -> Deleting chroot copy 'aaditya'...
  -> Deleting chroot copy 'root'...
==> Creating install root at /mnt/datalinux2/manjaro-tools/testing/x86_64/root
==> Installing packages to /mnt/datalinux2/manjaro-tools/testing/x86_64/root
:: Synchronizing package databases...
  core                    133.7 KiB  30.8K/s 00:04 [######################] 100%
  extra                  1920.2 KiB  392K/s 00:05 [######################] 100%
  community                  2.7 MiB  512K/s 00:05 [######################] 100%
:: There are 25 members in group base-devel:
:: Repository core
  1) autoconf  2) automake  3) binutils  4) bison  5) fakeroot  6) file
  7) findutils  8) flex  9) gawk  10) gcc  11) gettext  12) grep  13) groff
  14) gzip  15) libtool  16) m4  17) make  18) pacman  19) patch
  20) pkg-config  21) sed  22) sudo  23) texinfo  24) util-linux  25) which
...
...
==> Creating clean working copy [aaditya]...
==> Making package: upower-pm-utils 0.9.23-4 (Mon Jan 12 12:37:00 IST 2015)
==> Retrieving sources...
...
...
==> Leaving fakeroot environment.
==> Finished making: upower-pm-utils 0.9.23-4 (Mon Jan 12 07:07:20 UTC 2015)


<!--T:22-->
To build a set the name of the set can be used. The current sets can be queried with the {{ic|-q}} option.
To build a set the name of the set can be used. The current sets can be queried with the {{ic|-q}} option.


= buildtree = <!--T:23-->


= buildtree =
<!--T:24-->
 
buildtree is a little tools to sync arch abs and manjaro packages git repos.
buildtree is a little tools to sync arch abs and manjaro packages git repos.


<!--T:25-->
The arguments are:
The arguments are:


  $ buildtree -h
  <!--T:26-->
{{UserCmdOutput|command=buildtree -h|result=
<pre>
  Usage: buildtree [options]
  Usage: buildtree [options]
     -s            Sync manjaro tree
     -s            Sync manjaro tree
Line 224: Line 119:
     -q            Query settings
     -q            Query settings
     -h            This help[/code]
     -h            This help[/code]
</pre>
}}


<!--T:27-->
To sync Arch and Manjaro trees:
To sync Arch and Manjaro trees:


  buildtree -as
  <!--T:28-->
{{UserCmd|command=buildtree -as}}
 
= buildiso = <!--T:29-->


<!--T:30-->
buildiso is used to build a particular ISO or a set of ISOs. All functions of buildiso will be explained in the following chapters.


= buildiso =
<!--T:31-->
If you want a detailed guide how to use buildiso to build your own Manjaro ISOs from scratch, please look [https://wiki.manjaro.org/index.php?title=Build_Manjaro_ISOs_with_buildiso here].


buildiso is used to build a particular ISO or a set of ISOs.


== Overview ==
== Overview == <!--T:32-->


<!--T:33-->
The help looks like the following for x86_64:
The help looks like the following for x86_64:


$ buildiso -h
<!--T:34-->
{{UserCmdOutput|command=buildiso -h|result=
<pre>
  Usage: buildiso [options]
  Usage: buildiso [options]
    -p <profile>      Buildset or profile [default: default]
    -p <profile>      Buildset or profile [default: default]
    -a <arch>          Arch [default: x86_64]
    -a <arch>          Arch [default: x86_64]
    -b <branch>        Branch [default: unstable]
    -b <branch>        Branch [default: stable]
    -r <dir>          Chroots directory
    -r <dir>          Chroots directory
                      [default: /mnt/datalinux2/manjaro-tools/buildiso]
                        [default: /var/lib/manjaro-tools/buildiso]
    -w                Disable clean iso cache
    -c                Disable clean work dir
    -c                Disable clean work dir
    -x                Clean xorg cache
    -x                Disable clean xorg cache
    -l                Clean lng cache
    -l                Disable clean lng cache
    -i                Build images only
    -i                Build images only
    -s                Generate iso only
    -s                Generate iso only
                        Requires pre built images (-i)
                      Requires pre built images (-i)
    -v                Verbose output, show profies detail (-q)
    -q                Query settings and pretend build
    -q                Query settings and pretend build
    -h                This help
    -h                This help
 
</pre>
}}


Build profiles for official and community editions of Manjaro can be obtained from [https://github.com/manjaro/manjaro-tools-iso-profiles here], and this is what the current folder looks like:
== Query Building == <!--T:35-->
 
$ ls
cinnamon      kde          kde-openrc  lxqt-openrc  netbook    openbox-legacy  shared  xfce-minimal
enlightenment  kde5        lxde        mate        net-openrc  pekwm-openrc    sysmenu  xfce-openbox-openrc
gnome          kde-minimal  lxqt        net          openbox    README.md      xfce
 
== Query Building ==


<!--T:36-->
To query build an ISO ('''-q''' option), for example the xfce-openbox-openrc profile, the following command can be used:
To query build an ISO ('''-q''' option), for example the xfce-openbox-openrc profile, the following command can be used:


$ buildiso -p xfce-openbox-openrc/ -b stable -q
<!--T:37-->
==> manjaro-tools
{{UserCmdOutput|command=buildiso -p xfce -qv|result=
   -> version: 0.9.6.4
<pre>
   -> user_config: /home/aaditya/.config/manjaro-tools.conf
==> manjaro-tools
==> PROFILE:
   -> version: 0.15.9
   -> buildsets: community|default|official|openrc
   -> config: ~/.config/manjaro-tools/manjaro-tools.conf
   -> buildset_iso: xfce-openbox-openrc/
==> PROFILE:
   -> is_buildset: false
   -> build_lists: community|default|manjaro|sonar|v17-release
==> OPTIONS:
   -> build_list_iso: xfce
   -> is_build_list: false
==> OPTIONS:
   -> arch: x86_64
   -> arch: x86_64
   -> branch: stable
   -> branch: unstable
   -> chroots_iso: /mnt/datalinux2/manjaro-tools/buildiso
   -> kernel: linux419
==> ARGS:
==> ARGS:
   -> clean_first: true
   -> clean_first: true
  -> clean_cache_xorg: true
  -> clean_cache_lng: true
  -> clean_cache_iso: true
   -> images_only: false
   -> images_only: false
   -> iso_only: false
   -> iso_only: false
==> PATHS:
  -> persist: false
   -> sets_dir_iso: /etc/manjaro-tools/sets/iso
==> DIST SETTINGS:
   -> cache_dir_iso: /mnt/datalinux2/manjaro-tools/cache/iso
   -> dist_name: Manjaro
   -> cache_dir_xorg: /mnt/datalinux2/manjaro-tools/cache/xorg/x86_64
  -> dist_release: 18.0
   -> cache_dir_lng: /mnt/datalinux2/manjaro-tools/cache/lng/x86_64
   -> dist_codename: Illyria
==> IMAGES SETTINGS:
==> ISO INFO:
   -> manjaro_kernel: linux318
  -> iso_label: MJRO180
   -> manjaro_version: 2015.03
   -> iso_compression: xz
   -> plymouth_theme: manjaro-elegant
==> BUILD QUEUE:
==> ISO SETTINGS:
--> Profile: [xfce]
   -> iso_label: MJRO0812
   -> iso_file: manjaro-xfce-18.0-unstable-minimal-x86_64.iso
   -> iso_version: openrc-2015-03-01
  -> autologin: true
   -> code_name: Ascella
   -> nonfree_mhwd: true
==> LIVECD:
   -> multilib: true
   -> extra: false
  -> netinstall: false
   -> chrootcfg: false
   -> geoip: true
   -> efi_boot_loader: grub
  -> hostname: manjaro
   -> username: manjaro
   -> username: manjaro
   -> password: manjaro
   -> password: manjaro
   -> addgroups: video,audio,power,disk,storage,optical,network,lp,scanner,wheel
  -> login_shell: /bin/bash
   -> hostname: manjaro
   -> addgroups: lp,network,power,sys,wheel
==> BUILD QUEUE:
   -> enable_systemd: avahi-daemon bluetooth cronie ModemManager NetworkManager org.cups.cupsd tlp tlp-sleep ufw lightdm
--> Profile: [xfce-openbox-openrc/] ...
   -> enable_systemd_live: manjaro-live mhwd-live pacman-init mirrors-live
   -> Packages-Custom: Packages-Xfce
   -> disable_systemd: pacman-init
  -> initsys: openrc
</pre>
  -> displaymanager: lxdm
}}
  -> is_plymouth: false
   -> pacman_conf: pacman-multilib.conf
  -> work_dir: /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc//x86_64
  -> iso_file: manjaro-xfce-openrc-2015-03-01-x86_64.iso
  -> start_openrc: syslog-ng cronie acpid alsasound dbus consolekit wicd bluetooth
  -> start_openrc_live: livecd mhwd-live pacman-init pacman-boot


== Building ==
== Building == <!--T:38-->


<!--T:39-->
To actually build the ISO:
To actually build the ISO:


  $ buildiso -p xfce-openbox-openrc/ -b stable
  <!--T:40-->
==> Start building [xfce-openbox-openrc/]
{{UserCmd|command=buildiso -p xfce -b stable}}
--> Profile: [xfce-openbox-openrc/] ...
  -> Packages-Custom: Packages-Xfce
==> Cleaning up ...
  -> Deleting chroot 'root-image'...
  -> Deleting chroot 'xfce-image'...
  -> Cleaning [/mnt/datalinux2/manjaro-tools/cache/xorg/x86_64] ...
  -> Cleaning [/mnt/datalinux2/manjaro-tools/cache/lng/x86_64] ...
--> Loading Packages: [Packages] ...
==> Prepare [Base installation] (root-image)
==> mkiso : Configuration Settings
  -> working directory: /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc//x86_64
  -> image name: none
  -> pacman_mirrors: /usr/share/manjaro-tools/pacman-mirrors-stable.conf
==> Creating install root at /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc/x86_64/root-image
==> Installing packages to /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc/x86_64/root-image
:: Synchronizing package databases...
core                                                    132.7 KiB  202K/s 00:01 [##############################################] 100%
extra                                                  1916.0 KiB  939K/s 00:02 [##############################################] 100%
community                                                2.8 MiB  524K/s 00:05 [##############################################] 100%
multilib                                                140.9 KiB  217K/s 00:01 [##############################################] 100%
...
...
...
  -> Cleaning up what we can
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist
warning: database file for 'multilib' does not exist
warning: database file for 'openrc-eudev' does not exist
  -> Copying overlay ...
==> Done [Base installation] (root-image)
--> Loading Packages: [Packages-Xfce] ...
==> Prepare [xfce installation] (xfce-image)
  -> mount [root-image] on [xfce-image]
==> mkiso : Configuration Settings
  -> working directory: /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc//x86_64
  -> image name: none
  -> pacman_mirrors: /usr/share/manjaro-tools/pacman-mirrors-stable.conf
==> Creating install root at /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc/x86_64/xfce-image
==> Installing packages to /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc/x86_64/xfce-image
:: Synchronizing package databases...
...
...
...
Generation complete.
  -> Cleaning up what we can
warning: database file for 'core' does not exist
warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist
warning: database file for 'multilib' does not exist
warning: database file for 'openrc-eudev' does not exist
  -> Copying xfce-overlay ...
==> Configuring [xfce-image]
  -> Configuring Displaymanager ...
  -> Configured: lxdm
--> Congiguring OpenRC ....
  -> Setting syslog-ng ...
  -> Setting cronie ...
  -> Setting acpid ...
  -> Setting alsasound ...
  -> Setting dbus ...
  -> Setting consolekit ...
  -> Setting wicd ...
  -> Setting bluetooth ...
--> Done configuring OpenRC
==> Done configuring [xfce-image]
  -> unmount xfce-image
==> Done [xfce installation] (xfce-image)
--> Loading Packages: [Packages-Livecd] ...
==> Prepare [livecd-image]
  -> mount [livecd-image] on [xfce-image]
  -> append [root-image] on [livecd-image]
==> mkiso : Configuration Settings
  -> working directory: /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc//x86_64
  -> image name: none
  -> pacman_mirrors: /usr/share/manjaro-tools/pacman-mirrors-testing.conf
==> Creating install root at /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc/x86_64/livecd-image
==> Installing packages to /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc/x86_64/livecd-image
:: Synchronizing package databases...
...
...
...
==> Making bootable image
  -> Removing existing bootable image...
==> Creating ISO image...
xorriso 1.3.8 : RockRidge filesystem manipulator, libburnia project.
Drive current: -outdev 'stdio:/mnt/datalinux2/manjaro-tools/cache/iso/manjaro-xfce-openrc-2015-03-01-x86_64.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 62.7g free
Added to ISO image: directory '/'='/mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc/x86_64/iso'
xorriso : UPDATE : 115 files added in 1 seconds
xorriso : UPDATE : 115 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 432 bytes from file '/mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc/x86_64/iso/isolinux/isohdpfx.bin'
libisofs: NOTE : Aligned image size to cylinder size by 42 blocks
xorriso : UPDATE :  2.75% done
xorriso : UPDATE :  16.40% done
xorriso : UPDATE :  27.90% done, estimate finish Sun Mar 01 23:10:20 2015
xorriso : UPDATE :  93.66% done
xorriso : UPDATE :  99.20% done
xorriso : UPDATE :  99.46% done
xorriso : UPDATE :  99.47% done
xorriso : UPDATE :  99.67% done
xorriso : UPDATE :  99.68% done
ISO image produced: 343552 sectors
Written to medium : 343552 sectors at LBA 0
Writing to 'stdio:/mnt/datalinux2/manjaro-tools/cache/iso/manjaro-xfce-openrc-2015-03-01-x86_64.iso' completed successfully.
==> Done [Build ISO]
==> Creating [md5sum] ...
  -> md5sum: 78f4b335fc593b7df7edff46a4d91b5d  manjaro-xfce-openrc-2015-03-01-x86_64.iso
==> Done [md5sum]
--> Time compress_images: 9.43 minutes
==> Finished building [xfce-openbox-openrc/]
--> Time make_profile: 13.77 minutes


== Building with predownloaded Xorg packages ==
== Building with predownloaded Xorg packages == <!--T:41-->


<!--T:42-->
To build an ISO while retaining the previously downloaded cache of Xorg packages, the '''-x''' option can be used:
To build an ISO while retaining the previously downloaded cache of Xorg packages, the '''-x''' option can be used:


  $ buildiso -p xfce-openbox-openrc/ -b stable -x
  <!--T:43-->
{{UserCmd|command=buildiso -p xfce-openbox-openrc/ -b stable -x}}


== Building with a small config change ==
== Building with a small config change == <!--T:44-->


<!--T:45-->
{{Note| It is to be verified if the procedure given below works or not.}}
{{Note| It is to be verified if the procedure given below works or not.}}


<!--T:46-->
Supposing something only changed in config, like a setting, instead of building the whole ISO from scratch, the ISO build directory can be modified and the ISO can be rebuilt. For example, supposing one changed ''xfce-overlay/etc/skel/.conkyrc'' in the config, one can go into the work directory, modify the said file, and rebuild the ISO using the '''-cs''' option.
Supposing something only changed in config, like a setting, instead of building the whole ISO from scratch, the ISO build directory can be modified and the ISO can be rebuilt. For example, supposing one changed ''xfce-overlay/etc/skel/.conkyrc'' in the config, one can go into the work directory, modify the said file, and rebuild the ISO using the '''-cs''' option.


The work directory can be found using the '''-q''' option:
<!--T:47-->
The work directory can be found using the '''-h''' option:


  $ buildiso -p xfce-openbox-openrc/ -q
  <!--T:48-->
==> manjaro-tools
{{UserCmdOutput|command=buildiso -h|result=                
  -> version: 0.9.6.4
<pre>
  -> user_config: /home/aaditya/.config/manjaro-tools.conf
  Usage: buildiso [options]
  ==> PROFILE:
    -p <profile>       Buildset or profile [default: default]
  -> buildsets: community|default|official|openrc
    -a <arch>         Arch [default: x86_64]
  -> buildset_iso: xfce-openbox-openrc/
    -b <branch>       Branch [default: unstable]
  -> is_buildset: false
    -r <dir>           Chroots directory
==> OPTIONS:
                        [default: '''/var/lib/manjaro-tools/buildiso''']
  -> arch: x86_64
    -t <dir>          Target directory
  -> branch: unstable
                        [default: /home/fh/Data/build/iso]
  -> chroots_iso: /mnt/datalinux2/manjaro-tools/buildiso
    -k <name>         Kernel to use
...
                        [default: linux419]
...
    -g <key>           The gpg key for sfs signing
==> BUILD QUEUE:
                        [default: ]
--> Profile: [xfce-openbox-openrc/] ...
    -m                Set SquashFS image mode to persistence
  -> Packages-Custom: Packages-Xfce
    -c                Disable clean work dir
  -> initsys: openrc
    -f                Build full ISO (extra=true)
  -> displaymanager: lxdm
    -d <comp>         Compression used for build ISO: xz, gzip, lzma, lzo, lz4
  -> is_plymouth: false
                        [default: xz]
  -> pacman_conf: pacman-multilib.conf
    -x                Build images only
  '''-> work_dir: /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc//x86_64'''
    -z                Generate iso only
  -> iso_file: manjaro-xfce-openrc-2015-03-01-x86_64.iso
                        Requires pre built images (-x)
    -v                Verbose output to log file, show profile detail (-q)
    -q                Query settings and pretend build
    -h                This help
</pre>
}}


<!--T:49-->
    -r <dir>          Chroots directory
                        [default: '''/var/lib/manjaro-tools/buildiso''']
(work directory highlighted in bold)
(work directory highlighted in bold)


<!--T:50-->
The required file can be edited as root, for example:
The required file can be edited as root, for example:
$ sudo nano /mnt/datalinux2/manjaro-tools/buildiso/xfce-openbox-openrc//x86_64/xfce-image/etc/skel/.conkyrc
{{UserCmd|command=sudo nano /var/lib/manjaro-tools/buildiso/xfce/x86_64/desktopfs/etc/skel/.conkyrc}}


There is a catch involved here though; the file one wants to edit may be present in multiple images, like root-image, livecd-image, and DE-image (eg, xfce-image), and would need to be edited in the respective image directories.
<!--T:51-->
There is a catch involved here though; the file one wants to edit may be present in multiple images, like rootfs, livefs, desktopfs), and would need to be edited in the respective image directories.




<!--T:52-->
Then the ISO then can be rebuilt as:
Then the ISO then can be rebuilt as:
$ buildiso -p xfce-openbox-openrc/ -cs
{{UserCmd|command=buildiso -p xfce -cs}}


=== Alternative ===
=== Alternative === <!--T:53-->


<!--T:54-->
First only the chroot for the ISO could be created, using the {{ic|-i}} option, then the changes can be made, and finally an ISO can be built with the {{ic|-sc}} option.
First only the chroot for the ISO could be created, using the {{ic|-i}} option, then the changes can be made, and finally an ISO can be built with the {{ic|-sc}} option.


<!--T:55-->
For example:
For example:


  $ buildiso -p xfce-openrc/ -b stable -i
  <!--T:56-->
==> Start building [xfce-openrc/]
{{UserCmdOutput|command=buildiso -p xfce -b stable -x|result=
--> Profile: [xfce-openrc/]
<pre>
  -> Packages-Custom: Packages-Xfce
==> Start building [xfce]
==> Cleaning up ...
==> Cleaning up ...
...
  -> Deleting chroot [rootfs] (x86_64) ...
...
   -> Deleting isoroot [iso] ...
==> Done [manjaro/iso/isolinux]
[..]
==> Creating [isomounts]
</pre>
  -> Writing livecd entry ...
}}
   -> Writing pkgs entry ...
  -> Writing xfce entry ...
  -> Writing root entry ...
==> Done creating [isomounts]
--> Time build_images: 4.28 minutes
==> WARNING: Continue compress: buildiso -p xfce-openrc/ -sc ...


<!--T:57-->
After this the changes in the work directory can be made, and the ISO can be generated with:
After this the changes in the work directory can be made, and the ISO can be generated with:


  $ buildiso -p xfce-openrc/ -sc
  <!--T:58-->
{{UserCmd|command=buildiso -p xfce/ -cz}}


= Further reading =
= See Also = <!--T:59-->


* Github: https://github.com/manjaro/manjaro-tools
<!--T:60-->
* [https://gitlab.manjaro.org/tools/development-tools/manjaro-tools Manjaro Gitlab]
* [[Build Manjaro ISOs with buildiso]]
* [[Build Manjaro ISOs with buildiso]]
* [[Buildiso with AUR packages]]
</translate>
 


[[Category:Contents Page]]
[[Category:Contents Page{{#translation:}}]]

Latest revision as of 08:29, 9 December 2022

Other languages:
English • ‎русский

Introduction

manjaro-tools consists of a lot of different tools aimed at Manjaro developers. It is split into 3 different packages:

  • manjaro-tools-base contains basic tools, different chroot tools, and buildset
  • manjaro-tools-pkg contains small helper tools, buildpkg, and buildtree
  • manjaro-tools-iso contains small helper tools and buildiso


All of these manjaro-tools packages are replacements for devtools and manjaroiso.

A detailed user manual is available at gitlab.


Configuration

manjaro-tools can be configured by copying the folder /etc/manjaro-tools to your home in ~/.config folder and then edit the file ~/.config/manjaro-tools/manjaro-tools.conf

Files

These are the new names for renamed scripts.

  • mkmanjaroroot --> mkchroot
  • manjarobuild --> buildpkg
  • mkset --> buildset
  • pacstrap --> basestrap
  • genfstab --> fstabgen
  • arch-chroot --> manjaro-chroot


buildset

buildset is used to create build lists. Build lists can be defined in /etc/manjaro-tools/sets/<buildlistname>.set

The help looks like the following:


$ buildset -h

 Usage: buildset [options]
     -c <name>   Create set
     -r <name>   Remove set
     -s <name>   Show set
     -i          Iso mode
     -q          Query sets
     -h          This help


Note
The set name should be different from a directory name in pkgbuilds dir. Anything else should work, eg adding a date to the name.

buildpkg

buildpkg is used to build a particular package or a set. In the following chapter all functions of buildpkg get explained.

If you want a detailed example how to use buildpkg to build packages for a local repository, please look here.


The help looks like the following:


$ buildpkg -h

Usage: buildpkg [options]
    -a <arch>          Arch [default: x86_64]
    -b <branch>        Branch [default: stable]
    -c                 Recreate chroot
    -h                 This help
    -i <pkg>           Install a package into the working copy of the chroot
    -n                 Install and run namcap check
    -p <pkg>           Build list or pkg [default: default]
    -q                 Query settings and pretend build
    -r <dir>           Chroots directory
                       [default: /var/lib/manjaro-tools/buildpkg]
    -s                 Sign packages
    -w                 Clean up cache and sources


To build a single package, go into the directory which is one above the package build directory (which contains the PKGBUILD), and run it as:

user $ buildpkg -p package-name COPY TO CLIPBOARD


To build a set the name of the set can be used. The current sets can be queried with the -q option.

buildtree

buildtree is a little tools to sync arch abs and manjaro packages git repos.

The arguments are:


$ buildtree -h

 Usage: buildtree [options]
     -s            Sync manjaro tree
     -a            Sync arch abs
     -c            Clean package tree
     -q            Query settings
     -h            This help[/code]


To sync Arch and Manjaro trees:

user $ buildtree -as COPY TO CLIPBOARD


buildiso

buildiso is used to build a particular ISO or a set of ISOs. All functions of buildiso will be explained in the following chapters.

If you want a detailed guide how to use buildiso to build your own Manjaro ISOs from scratch, please look here.


Overview

The help looks like the following for x86_64:


$ buildiso -h

 Usage: buildiso [options]
     -p <profile>       Buildset or profile [default: default]
     -a <arch>          Arch [default: x86_64]
     -b <branch>        Branch [default: stable]
     -r <dir>           Chroots directory
                        [default: /var/lib/manjaro-tools/buildiso]
     -c                 Disable clean work dir
     -x                 Clean xorg cache
     -l                 Clean lng cache
     -i                 Build images only
     -s                 Generate iso only
                        Requires pre built images (-i)
     -v                 Verbose output, show profies detail (-q)
     -q                 Query settings and pretend build
     -h                 This help


Query Building

To query build an ISO (-q option), for example the xfce-openbox-openrc profile, the following command can be used:


$ buildiso -p xfce -qv

==> manjaro-tools
  -> version: 0.15.9
  -> config: ~/.config/manjaro-tools/manjaro-tools.conf
==> PROFILE:
  -> build_lists: community|default|manjaro|sonar|v17-release
  -> build_list_iso: xfce
  -> is_build_list: false
==> OPTIONS:
  -> arch: x86_64
  -> branch: unstable
  -> kernel: linux419
==> ARGS:
  -> clean_first: true
  -> images_only: false
  -> iso_only: false
  -> persist: false
==> DIST SETTINGS:
  -> dist_name: Manjaro
  -> dist_release: 18.0
  -> dist_codename: Illyria
==> ISO INFO:
  -> iso_label: MJRO180
  -> iso_compression: xz
==> BUILD QUEUE:
 --> Profile: [xfce]
  -> iso_file: manjaro-xfce-18.0-unstable-minimal-x86_64.iso
  -> autologin: true
  -> nonfree_mhwd: true
  -> multilib: true
  -> extra: false
  -> netinstall: false
  -> chrootcfg: false
  -> geoip: true
  -> efi_boot_loader: grub
  -> hostname: manjaro
  -> username: manjaro
  -> password: manjaro
  -> login_shell: /bin/bash
  -> addgroups: lp,network,power,sys,wheel
  -> enable_systemd: avahi-daemon bluetooth cronie ModemManager NetworkManager org.cups.cupsd tlp tlp-sleep ufw lightdm
  -> enable_systemd_live: manjaro-live mhwd-live pacman-init mirrors-live
  -> disable_systemd: pacman-init


Building

To actually build the ISO:

user $ buildiso -p xfce -b stable COPY TO CLIPBOARD


Building with predownloaded Xorg packages

To build an ISO while retaining the previously downloaded cache of Xorg packages, the -x option can be used:

user $ buildiso -p xfce-openbox-openrc/ -b stable -x COPY TO CLIPBOARD


Building with a small config change

Note
It is to be verified if the procedure given below works or not.

Supposing something only changed in config, like a setting, instead of building the whole ISO from scratch, the ISO build directory can be modified and the ISO can be rebuilt. For example, supposing one changed xfce-overlay/etc/skel/.conkyrc in the config, one can go into the work directory, modify the said file, and rebuild the ISO using the -cs option.

The work directory can be found using the -h option:


$ buildiso -h

 Usage: buildiso [options]
     -p <profile>       Buildset or profile [default: default]
     -a <arch>          Arch [default: x86_64]
     -b <branch>        Branch [default: unstable]
     -r <dir>           Chroots directory
                        [default: '''/var/lib/manjaro-tools/buildiso''']
     -t <dir>           Target directory
                        [default: /home/fh/Data/build/iso]
     -k <name>          Kernel to use
                        [default: linux419]
     -g <key>           The gpg key for sfs signing
                        [default: ]
     -m                 Set SquashFS image mode to persistence
     -c                 Disable clean work dir
     -f                 Build full ISO (extra=true)
     -d <comp>          Compression used for build ISO: xz, gzip, lzma, lzo, lz4
                        [default: xz]
     -x                 Build images only
     -z                 Generate iso only
                        Requires pre built images (-x)
     -v                 Verbose output to log file, show profile detail (-q)
     -q                 Query settings and pretend build
     -h                 This help


    -r <dir>           Chroots directory
                       [default: /var/lib/manjaro-tools/buildiso]

(work directory highlighted in bold)

The required file can be edited as root, for example:

user $ sudo nano /var/lib/manjaro-tools/buildiso/xfce/x86_64/desktopfs/etc/skel/.conkyrc COPY TO CLIPBOARD


There is a catch involved here though; the file one wants to edit may be present in multiple images, like rootfs, livefs, desktopfs), and would need to be edited in the respective image directories.


Then the ISO then can be rebuilt as:

user $ buildiso -p xfce -cs COPY TO CLIPBOARD


Alternative

First only the chroot for the ISO could be created, using the -i option, then the changes can be made, and finally an ISO can be built with the -sc option.

For example:


$ buildiso -p xfce -b stable -x

==> Start building [xfce]
==> Cleaning up ...
  -> Deleting chroot [rootfs] (x86_64) ...
  -> Deleting isoroot [iso] ...
[..]


After this the changes in the work directory can be made, and the ISO can be generated with:

user $ buildiso -p xfce/ -cz COPY TO CLIPBOARD


See Also

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