README.profile.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. =======
  2. profile
  3. =======
  4. A parabolaiso profile consists of several configuration files and a directory for files to be added to the resulting image.
  5. .. code:: plaintext
  6. profile/
  7. ├── airootfs/
  8. ├── efiboot/
  9. ├── syslinux/
  10. ├── grub/
  11. ├── bootstrap_packages.arch
  12. ├── packages.arch
  13. ├── pacman.conf
  14. └── profiledef.sh
  15. The required files and directories are explained in the following sections.
  16. profiledef.sh
  17. =============
  18. This file describes several attributes of the resulting image and is a place for customization to the general behavior
  19. of the image.
  20. The image file is constructed from some of the variables in ``profiledef.sh``: ``<iso_name>-<iso_version>-<arch>.iso``
  21. (e.g. ``parabola-202010-x86_64.iso``).
  22. * ``iso_name``: The first part of the name of the resulting image (defaults to ``mkparabolaiso``)
  23. * ``iso_label``: The ISO's volume label (defaults to ``MKPARABOLAISO``)
  24. * ``iso_publisher``: A free-form string that states the publisher of the resulting image (defaults to ``mkparabolaiso``)
  25. * ``iso_application``: A free-form string that states the application (i.e. its use-case) of the resulting image (defaults
  26. to ``mkparabolaiso iso``)
  27. * ``iso_version``: A string that states the version of the resulting image (defaults to ``""``)
  28. * ``install_dir``: A string (maximum eight characters long, which **must** consist of ``[a-z0-9]``) that states the
  29. directory on the resulting image into which all files will be installed (defaults to ``mkparabolaiso``)
  30. * ``buildmodes``: An optional list of strings, that state the build modes that the profile uses. Only the following are
  31. understood:
  32. - ``bootstrap``: Build a compressed file containing a minimal system to bootstrap from
  33. - ``iso``: Build a bootable ISO image (implicit default, if no ``buildmodes`` are set)
  34. - ``netboot``: Build artifacts required for netboot using iPXE
  35. * ``bootmodes``: A list of strings, that state the supported boot modes of the resulting image. Only the following are
  36. understood:
  37. - ``bios.syslinux.mbr``: Syslinux for x86 BIOS booting from a disk
  38. - ``bios.syslinux.eltorito``: Syslinux for x86 BIOS booting from an optical disc
  39. - ``uefi-ia32.grub.esp``: GRUB for IA32 UEFI booting from a disk
  40. - ``uefi-ia32.grub.eltorito``: GRUB for IA32 UEFI booting from an optical disc
  41. - ``uefi-x64.grub.esp``: GRUB for x64 UEFI booting from a disk
  42. - ``uefi-x64.grub.eltorito``: GRUB for x64 UEFI booting from an optical disc
  43. - ``uefi-ia32.systemd-boot.esp``: systemd-boot for IA32 UEFI booting from a disk
  44. - ``uefi-ia32.systemd-boot.eltorito``: systemd-boot for IA32UEFI booting from an optical disc
  45. - ``uefi-x64.systemd-boot.esp``: systemd-boot for x64 UEFI booting from a disk
  46. - ``uefi-x64.systemd-boot.eltorito``: systemd-boot for x64 UEFI booting from an optical disc
  47. Note that BIOS El Torito boot mode must always be listed before UEFI El Torito boot mode.
  48. * ``arch``: The architecture (e.g. ``x86_64``) to build the image for. This is also used to resolve the name of the packages
  49. file (e.g. ``packages.x86_64``)
  50. * ``pacman_conf``: The ``pacman.conf`` to use to install packages to the work directory when creating the image (defaults to
  51. the host's ``/etc/pacman.conf``)
  52. * ``airootfs_image_type``: The image type to create. The following options are understood (defaults to ``squashfs``):
  53. - ``squashfs``: Create a squashfs image directly from the airootfs work directory
  54. - ``ext4+squashfs``: Create an ext4 partition, copy the airootfs work directory to it and create a squashfs image from it
  55. - ``erofs``: Create an EROFS image for the airootfs work directory
  56. * ``airootfs_image_tool_options``: An array of options to pass to the tool to create the airootfs image. ``mksquashfs`` and
  57. ``mkfs.erofs`` are supported. See ``mksquashfs --help`` or ``mkfs.erofs --help`` for all possible options
  58. * ``file_permissions``: An associative array that lists files and/or directories who need specific ownership or
  59. permissions. The array's keys contain the path and the value is a colon separated list of owner UID, owner GID and
  60. access mode. E.g. ``file_permissions=(["/etc/shadow"]="0:0:400")``. When directories are listed with a trailing backslash (``/``) **all** files and directories contained within the listed directory will have the same owner UID, owner GID, and access mode applied recursively.
  61. bootstrap_packages.arch
  62. =======================
  63. All packages to be installed into the environment of a bootstrap image have to be listed in an architecture specific
  64. file (e.g. ``bootstrap_packages.x86_64``), which resides top-level in the profile.
  65. Packages have to be listed one per line. Lines starting with a ``#`` and blank lines are ignored.
  66. This file is required when generating bootstrap images using the ``bootstrap`` build mode.
  67. packages.arch
  68. =============
  69. All packages to be installed into the environment of an ISO image have to be listed in an architecture specific file
  70. (e.g. ``packages.x86_64``), which resides top-level in the profile.
  71. Packages have to be listed one per line. Lines starting with a ``#`` and blank lines are ignored.
  72. .. note::
  73. The **mkinitcpio** and **mkinitcpio-parabolaiso** packages are mandatory (see `#30
  74. <https://gitlab.archlinux.org/archlinux/archiso/-/issues/30>`_).
  75. This file is required when generating ISO images using the ``iso`` or ``netboot`` build modes.
  76. pacman.conf
  77. ===========
  78. A configuration for pacman is required per profile.
  79. Some configuration options will not be used or will be modified:
  80. * ``CacheDir``: the profile's option is **only** used if it is not the default (i.e. ``/var/cache/pacman/pkg``) and if it is
  81. not the same as the system's option. In all other cases the system's pacman cache is used.
  82. * ``HookDir``: it is **always** set to the ``/etc/pacman.d/hooks`` directory in the work directory's airootfs to allow
  83. modification via the profile and ensure interoparability with hosts using dracut (see `#73
  84. <https://gitlab.archlinux.org/archlinux/archiso/-/issues/73>`_)
  85. * ``RootDir``: it is **always** removed, as setting it explicitely otherwise refers to the host's root filesystem (see
  86. ``man 8 pacman`` for further information on the ``-r`` option used by ``pacstrap``)
  87. * ``LogFile``: it is **always** removed, as setting it explicitely otherwise refers to the host's pacman log file (see
  88. ``man 8 pacman`` for further information on the ``-r`` option used by ``pacstrap``)
  89. * ``DBPath``: it is **always** removed, as setting it explicitely otherwise refers to the host's pacman database (see
  90. ``man 8 pacman`` for further information on the ``-r`` option used by ``pacstrap``)
  91. airootfs
  92. ========
  93. This optional directory may contain files and directories that will be copied to the work directory of the resulting
  94. image's root filesystem.
  95. The files are copied before packages are being installed to work directory location.
  96. Ownership and permissions of files and directories from the profile's ``airootfs`` directory are not preserved. The mode
  97. will be ``644`` for files and ``755`` for directories, all of them will be owned by root. To set custom ownership and/or
  98. permissions, use ``file_permissions`` in ``profiledef.sh``.
  99. With this overlay structure it is possible to e.g. create users and set passwords for them, by providing
  100. ``airootfs/etc/passwd``, ``airootfs/etc/shadow``, ``airootfs/etc/gshadow`` (see ``man 5 passwd``, ``man 5 shadow`` and ``man 5 gshadow`` respectively).
  101. If user home directories exist in the profile's ``airootfs``, their ownership and (and top-level) permissions will be
  102. altered according to the provided information in the password file.
  103. Boot loader configuration
  104. =========================
  105. A profile may contain configuration for several boot loaders. These reside in specific top-level directories, which are
  106. explained in the following subsections.
  107. The following *custom template identifiers* are understood and will be replaced according to the assignments of the
  108. respective variables in ``profiledef.sh``:
  109. * ``%PARABOLAISO_LABEL%``: Set this using the ``iso_label`` variable in ``profiledef.sh``.
  110. * ``%INSTALL_DIR%``: Set this using the ``install_dir`` variable in ``profiledef.sh``.
  111. * ``%ARCH%``: Set this using the ``arch`` variable in ``profiledef.sh``.
  112. Additionally there are also *custom template identifiers* have harcoded values set by ``mkparabolaiso`` that cannot be
  113. overridden:
  114. * ``%PARABOLAISO_UUID%``: the ISO 9660 modification date in UTC, i.e. its "UUID",
  115. * ``%PARABOLAISO_SEARCH_FILENAME%``: file path on ISO 9660 that can be used by GRUB to find the ISO volume
  116. (**for GRUB ``.cfg`` files only**).
  117. efiboot
  118. -------
  119. This directory is mandatory when the ``uefi-x64.systemd-boot.esp`` or ``uefi-x64.systemd-boot.eltorito`` bootmodes are
  120. selected in ``profiledef.sh``. It contains configuration for `systemd-boot
  121. <https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>`_.
  122. .. note::
  123. The directory is a top-level representation of the systemd-boot configuration directories and files found in the
  124. root of an EFI system partition.
  125. The *custom template identifiers* are **only** understood in the boot loader entry `.conf` files (i.e. **not** in
  126. ``loader.conf``).
  127. The same applies for the ``uefi-x64.refind.esp`` and ``uefi-x64.refind.eltorito`` bootmodes. In the case of OpenRC profiles,
  128. this directory contains configuration for `rEFInd <https://www.rodsbooks.com/refind/>`_.
  129. syslinux
  130. --------
  131. This directory is mandatory when the ``bios.syslinux.mbr`` or the ``bios.syslinux.eltorito`` bootmodes are selected in
  132. ``profiledef.sh``.
  133. It contains configuration files for `syslinux <https://wiki.syslinux.org/wiki/index.php?title=SYSLINUX>`_ or `isolinux
  134. <https://wiki.syslinux.org/wiki/index.php?title=ISOLINUX>`_ , or `pxelinux
  135. <https://wiki.syslinux.org/wiki/index.php?title=PXELINUX>`_ used in the resuling image.
  136. The *custom template identifiers* are understood in all `.cfg` files in this directory.
  137. grub
  138. ----
  139. This directory is mandatory when any of the following bootmodes is used in ``profiledef.sh``:
  140. - ``uefi-ia32.grub.esp`` or
  141. - ``uefi-ia32.grub.eltorito`` or
  142. - ``uefi-x64.grub.esp`` or
  143. - ``uefi-x64.grub.eltorito``
  144. It contains configuration files for `GRUB <https://www.gnu.org/software/grub/>`_
  145. used in the resulting image.