1. 22 Jun, 2021 1 commit
  2. 18 Jun, 2021 1 commit
  3. 05 Jun, 2021 1 commit
  4. 01 Jun, 2021 1 commit
  5. 10 May, 2021 2 commits
    • David Runge's avatar
      mkarchiso: Also create package list for netboot · 6b11d7be
      David Runge authored
      archiso/mkarchiso:
      Change `_make_pkglist()` to also generate the package list when using the netboot build mode.
      6b11d7be
    • David Runge's avatar
      mkarchiso: Add buildmode to export netboot artifacts · d54bf635
      David Runge authored
      archiso/mkarchiso:
      Implement a buildmode to export artifacts required for netboot with IPXE.
      When providing the buildmode 'netboot' via profiledef.sh or the `-m` option, all targets necessary to create an ISO
      medium are built, but the components required for netboot are exported to the output dir.
      Optionally, it is possible to provide a set of certificates for codsigning using the `-c` option, where the first file
      is considered as the signer certificate and the second as the key.
      
      Add `_export_netboot_artifacts()` to copy build artifacts to the output directory.
      Add `_sign_netboot_artifacts()` to codesign the netboot artifacts in the work directory.
      Add `_validate_requirements_buildmode_netboot()` to check for openssl.
      Add `_build_iso_base()` to implement common function calls between the 'iso' and the 'netboot' buildmodes.
      Add `_build_buildmode_netboot()` to make use of `_build_iso_base()`, (optionally) `_sign_netboot_artifacts()` and
      `_export_netboot_artifacts()`.
      Change `_build_buildmode_iso()` to make use of `_build_iso_base()`.
      Add `-c` as an option to mkarchiso to read in a list of file names.
      Unify the output of `_usage()` by using the same definition style for lists of strings provided to options that accept
      them (e.g. `-c`, `-m`, `-p`).
      
      Closes #128
      d54bf635
  6. 09 May, 2021 1 commit
    • David Runge's avatar
      mkarchiso: Implement buildmodes that allow building bootstrap images · 2cac5396
      David Runge authored
      archiso/mkarchiso:
      Introduce a buildmodes array, that can be used to build towards more than one output artifact type.
      Add a buildmode for building a bootstrap image (a compressed file containing a very minimal Arch installation).
      The buildmodes can be set either using a `buildmodes` array in a `profiledef.sh` or by using the `-m` option flag to
      mkarchiso and providing a space delimited, quoted list.
      The 'iso' buildmode is always the default if no buildmodes are setup.
      Implement building a bootstrap image, when using the 'bootstrap' `buildmode`, which uses a profile's
      'bootstrap_packages.$arch' file to install packages using pacstrap and compressing it to a bootstrap image.
      The name of the output file is currently constructed from the `iso_name` value by appending `-bootstrap`.
      
      Replace the uses of `airootfs_dir` with the more generic `pacstrap_dir`, as the location denotes where pacstrap is
      being used.
      Replace uses of `img_name` with `image_name` and removing it from the global scope, so that it can be overridden per
      each buildmode.
      Rename `_cleanup_airootfs_dir()` to `_cleanup_pacstrap_dir()`.
      Make `_run_once()` more generic by prepending the state files with a string defined by `run_once_mode`.
      Add `_validate_requirements_buildmode_all()`, `_validate_requirements_buildmode_bootstrap()` and
      `_validate_requirements_buildmode_iso()` to validate the general requirements of the different buildmodes.
      Add `_build_bootstrap_image()` to generate the bootstrap image using bsdtar.
      Rename `_build_iso()` to `_build_iso_image()` to fit the naming of the respective bootstrap function.
      Extend `_read_profile()` to include the reading of bootstrap image specific packages from a file.
      Extend `_validate_options()` to include testing of the bootstrap packages and running of validation functions for all
      buildmodes.
      Change `_set_overrides()` to override the buildmodes if they are specified via the `-m` option flag.
      Change `_make_version()` to be used generically in all buildmodes.
      Change `_make_pkglist()` to be used generically in all buildmodes.
      Rename `_build_profile()` to `_build_buildmode_iso()` and set local variables that are specific to the buildmode, such
      as `image_name`, `pacstrap_dir`, `run_once_mode` , `buildmode_packages` and `buildmode_pkg_list`.
      Add `_build_buildmode_bootstrap()` and set local variables that are specific to the buildmode, such as `image_name`,
      `pacstrap_dir`, `run_once_mode` , `buildmode_packages` and `buildmode_pkg_list`.
      Add the `-m` option flag to the list of flags.
      
      Closes #127
      2cac5396
  7. 01 May, 2021 2 commits
    • David Runge's avatar
      Set more generic output for signatures · 42cdf867
      David Runge authored
      archiso/mkarchiso:
      Change the help output to reflect that the `-g` option is generically signing a rootfs (which may be e.g. squashfs or
      erofs).
      Change the output of `_mksignature()` to be more generic, as it signs any type of understood rootfs image (which may be
      e.g. squashfs or erofs).
      42cdf867
    • David Runge's avatar
      Force PGP signature file extension · cc735dbb
      David Runge authored
      archiso/mkarchiso:
      Force the file extension in use for the PGP signatures of the rootfs to always be .sig.
      When gnupg's 'armor' configuration option is used, the output otherwise defaults to using .asc.
      As the verification hook in mkinitcpio-archiso expects the .sig file extension, verifying the rootfs will fail in that
      scenario.
      cc735dbb
  8. 30 Apr, 2021 3 commits
    • nl6720's avatar
      mkarchiso: create reproducible gzip archives · 0406f9ca
      nl6720 authored
      Use the gzip option -n/--no-name to prevent saving the original file name and timestamp.
      
      Fixes #104.
      0406f9ca
    • nl6720's avatar
      mkarchiso: make sure to remove potentially preexisting files from... · a771297e
      nl6720 authored
      mkarchiso: make sure to remove potentially preexisting files from $airootfs_dir before creating them with output redirection
      
      mkarchiso creates "${airootfs_dir}/etc/machine-id" by using output redirection. If this file is an existing symlink, then the printf output would be written to the symlink target. It can be a big issue in case the symlink resolves to a path outside ${airootfs_dir}.
      
      Fixes #121.
      a771297e
    • nl6720's avatar
      mkarchiso: append IMAGE_ID and IMAGE_VERSION to /etc/os-release · 98c7b676
      nl6720 authored
      This provides the ISO version information in the os-release file.
      
      * IMAGE_ID is set to the value of $iso_name.
      * IMAGE_VERSION is set to the value of $iso_version.
      
      Implements #116.
      98c7b676
  9. 07 Apr, 2021 2 commits
  10. 26 Mar, 2021 1 commit
  11. 21 Mar, 2021 1 commit
  12. 09 Mar, 2021 1 commit
    • nl6720's avatar
      Support EROFS · bc67933a
      nl6720 authored
      EROFS, like Squashfs, is a read-only file system. It can be used to store airootfs in an image file.
      Its advantage is the support for POSIX ACLs. EROFS downside is that currently it only supports LZ4 compression (LZMA support is not yet fully implemented).
      
      A difference from Squashfs is that, EROFS stores change time (ctime) not modification time (mtime). The reverse is true for Squashfs.
      
      Implements archlinux/archiso#59
      bc67933a
  13. 28 Jan, 2021 1 commit
  14. 26 Jan, 2021 1 commit
    • Christian Hesse's avatar
      mkarchiso: add version information · b30d1cad
      Christian Hesse authored
      To date the iso version was used for iso volume information and iso file name.
      In my custom builds I do use it a lot more:
      
      * Inside the root fs: The system knows about its own version. I use this to:
        -> report the version to a server (poor man's inventory)
        -> let the system update itself
      
      * On the iso fs: The files are served via rsync, running systems transfer
        version file first to check for available update.
      
      * A grub environment file on the iso fs: Booting the iso from grub allows
        to create cow directory per version:
      
          loopback loop archlinux.iso
          load_env -f (loop)/arch/grubenv
          linux (loop)/arch/boot/x86_64/vmlinuz-linux ... \
              cow_directory=archlinux/${VERSION} ...
      
      So let's just create these files.
      b30d1cad
  15. 23 Jan, 2021 1 commit
  16. 07 Jan, 2021 1 commit
  17. 30 Nov, 2020 4 commits
    • David Runge's avatar
      Fix issues with file ownerships/modes · c10004df
      David Runge authored
      archiso/mkarchiso:
      Make sure to always compare absolute paths in `_make_custom_airootfs()` (as `realpath` is used).
      Remove `echo` calls that prevent the setting of actual file ownerships and modes.
      
      configs/releng/profiledef.sh:
      Set file mode of /root/.automated_script.sh to 755.
      
      Fixes #82
      c10004df
    • nl6720's avatar
      Keep all SYSLINUX files in /syslinux · 863247d0
      nl6720 authored
      This gets rid of the duplicate ldlinux.c32 and the useless isolinux.cfg which only points to syslinux.cfg.
      
      Implements archlinux/archiso#46 .
      863247d0
    • nl6720's avatar
      Prevent path traversal outside of $airootfs_dir · 183ae527
      nl6720 authored
      183ae527
    • nl6720's avatar
      Allow specifying ownership and mode of custom airootfs files and directories · 42d9e4f9
      nl6720 authored
      profiledef.sh can now contain an associative array called file_permissions which can be used to set custom ownership and mode of custom airootfs files. The array's keys contain the path and the value is a colon separated list of owner UID, owner GID and access mode.
      For example:
      
          file_permissions=(
            ["/etc/shadow"]="0:0:400"
          )
      
      This means that mkarchiso now copies airootfs files (and directores) without permissions and anything that should be owned by a user other than root and/or if the mode should be something other than 644 for files and 755 for directories must to be listed in ${file_permission[@]} in profiledef.sh.
      
      Fixes archlinux/archiso#61 .
      42d9e4f9
  18. 18 Nov, 2020 1 commit
    • David Runge's avatar
      Fix evaluation bugs in mkarchiso · 3160db0e
      David Runge authored
      archiso/mkarchiso:
      Guard the call to `_mksignature()` in `_prepare_airootfs_image()` by an if statement.
      Using the `&&` logic leads to `_prepare_airootfs_image()` evaluating to false if `$gpg_key` is not set.
      
      Add `_msg_info()` calls to `_set_override()` which prevent the function from evaluating to false if no override is
      being done. Additionally this is great for debugging purposes.
      
      Add `_msg_info()` calls to `_read_profile()` (which is great for debugging purposes).
      
      Fixes #81
      3160db0e
  19. 14 Nov, 2020 3 commits
  20. 30 Oct, 2020 1 commit
  21. 29 Oct, 2020 1 commit
    • David Runge's avatar
      Remove build.sh support from profiles and mkarchiso · 1bd944ee
      David Runge authored
      configs/{baseline,releng}/build.sh:
      Remove `build.sh` scripts. They were deprecated with v47.
      
      archiso/mkarchiso:
      Remove all `build.sh` related functionality (i.e. `command_pkglist()`, `command_iso()`, `command_prepare()`,
      `command_install()`, `command_init()`, `command_run()`).
      
      Rename `command_build_profile()` to `_build_profile()` to be more in line with the style of the other function naming.
      
      Change `_show_config()` to only print info about the profile and make no more use of parameters.
      
      Remove all help output related to legacy `build.sh` commands.
      
      Fixes #51
      1bd944ee
  22. 24 Oct, 2020 2 commits
    • David Runge's avatar
      Set CacheDir and HookDir for profile more sanely · f3af5692
      David Runge authored
      archiso/mkarchiso:
      Change `_pacman()` to use the *modified* pacman.conf from the work_dir, instead of using the *unmodified* pacman.conf from
      the profile.
      
      Change `_make_pacman_conf()` to compare the system's and the profile's CacheDir setting and use the profile's CacheDir
      setting only if it's not the default and not the same as the system's.
      
      Always set the HookDir to the airootfs' override directory, so that no hooks from the host system are being run.
      
      Remove DBPath, LogFile and RootDir settings from the work_dir pacman.conf as they are otherwise referring to the host
      system, **even if** pacman is being called with the `-r` flag.
      
      Fix a typo in _make_custom_airootfs().
      
      README.profile.rst:
      Add information about the pacman.conf in a profile and how configuration options behave, when used by mkarchiso.
      
      Fixes #73
      Fixes #74
      f3af5692
    • nl6720's avatar
      Move FAT image to a separate partition outside the ISO 9660 file system · 729d16b4
      nl6720 authored
      Support bios.syslinux.eltorito boot mode without bios.syslinux.mbr.
      bios.syslinux.mbr does not work without bios.syslinux.eltorito because -isohybrid-mbr requires the El Torito boot image.
      
      Support uefi-x64.systemd-boot.esp boot mode without uefi-x64.systemd-boot.eltorito and vice versa.
      If uefi-x64.systemd-boot.eltorito is used without uefi-x64.systemd-boot.esp, the El Torito boot image will be placed in the ISO 9660 file system as before.
      Note that an ISO created with only uefi-x64.systemd-boot.eltorito will still be bootable as a "hard disk" on OVMF. OVMF will boot the El Torito image.
      
      This change has the following effect on the partition tables:
      
      - *.eltorito options add El Torito boot catalog entries. MBR and GPT are not affected.
      - uefi-x64.systemd-boot.esp creates a protective MBR partition table and a GPT table that includes a Linux filesystem data partition for the ISO 9660 volume, an EFI system partition and a Microsoft basic data partition that maps the 300 KiB padding added by xorriso.
      - bios.syslinux.mbr (without uefi-x64.systemd-boot.esp): adds a MBR partition table and maps the ISO 9660 volume as a partition of type 0x83. No GPT is produced.
      - bios.syslinux.mbr (with uefi-x64.systemd-boot.esp): adds an second partition in the MBR (after 0xEE) starting from sector 0 to sector 1 with type 0 and marks it as bootable. This violates the GPT specification, but allows some systems to succesfully boot in BIOS mode from GPT.
      
      Fixes archlinux/archiso#49
      729d16b4
  23. 07 Oct, 2020 3 commits
  24. 04 Oct, 2020 1 commit
  25. 03 Oct, 2020 1 commit
    • David Runge's avatar
      Replace bash arithmetic with awk functions · 55cfb8ba
      David Runge authored
      archiso/mkarchiso:
      The bash arithmethics in _make_boot_uefi-x64.systemd-boot.esp() introduced rounding issues, that can lead to
      insufficient FAT image size for the files.
      Conversion functions for awk now replace the bash arithmetics and additionally a ceil() function rounds the calculated
      size up to the next full MiB.
      Add an info message about the size of the created FAT image.
      
      Fixes #70
      55cfb8ba
  26. 29 Sep, 2020 1 commit
    • David Runge's avatar
      Fix info message for legacy command · 2e1ddec0
      David Runge authored
      archiso/mkarchiso:
      Change the way _show_config() displays information about the build environment, as displaying a profile directory as a
      legacy command to mkarchiso is confusing.
      The function now prints a deprecation message if '$command_name' is not a directory (i.e. not a profile).
      Remove 'command_' prefix from help output for legacy commands (the prefix is only in use for internal functions).
      
      Relates to !69
      Fixes #60
      2e1ddec0
  27. 27 Sep, 2020 1 commit