From 63c77dc2d1ff9726ca4bbc57dc84bb22e9c1a195 Mon Sep 17 00:00:00 2001 From: Antonio V Date: Sun, 14 May 2023 14:59:53 +0000 Subject: Subdirectories from grub/ are copied to the ISO --- archiso/mkarchiso | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archiso/mkarchiso') diff --git a/archiso/mkarchiso b/archiso/mkarchiso index e0806bd..23e0a75 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -553,7 +553,7 @@ _make_common_bootmode_grub_copy_to_isofs() { files_to_copy+=("${profile}/grub/"!(*.cfg)) fi install -d -m 0755 -- "${isofs_dir}/boot/grub" - install -m 0644 -- "${files_to_copy[@]}" "${isofs_dir}/boot/grub/" + cp -r --remove-destination -- "${files_to_copy[@]}" "${isofs_dir}/boot/grub/" } # Prepare GRUB configuration files -- cgit v1.2.3-54-g00ecf From 14b2e44d9040ac24017268e309d3abfb14831d7e Mon Sep 17 00:00:00 2001 From: shivanandvp Date: Wed, 17 May 2023 04:08:33 -0500 Subject: mkarchiso: Fix the cp command arguments to retain mkarchiso's behavior prior to the GNU Coreutils update. Fixes Issue #214 --- CHANGELOG.rst | 2 +- archiso/mkarchiso | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'archiso/mkarchiso') diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8503cb2..a4cd42f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,8 +24,8 @@ Fixed - Wait for ``network-online.target`` to become active before trying to download the script passed via the ``script=`` boot parameter. - - Subdirectories from ``grub/`` are copied to the ISO. +- Modify the commandline options to a ``cp`` command in ``mkarchiso`` so that the entire script does not exit with failure when a custom ``.bashrc`` file is supplied with the archiso configuration. This fix was needed after **GNU Coreutils** recently changed the behaviour of the ``-n`` (or ``--no-clobber``) commandline option to the ``cp`` command. Removed ------- diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 23e0a75..e991b52 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -390,7 +390,7 @@ _make_customize_airootfs() { if [[ ! -d "${pacstrap_dir}${passwd[5]}" ]]; then install -d -m 0750 -o "${passwd[2]}" -g "${passwd[3]}" -- "${pacstrap_dir}${passwd[5]}" fi - cp -dnRT --preserve=mode,timestamps,links -- "${pacstrap_dir}/etc/skel/." "${pacstrap_dir}${passwd[5]}" + cp -dRT --update=none --preserve=mode,timestamps,links -- "${pacstrap_dir}/etc/skel/." "${pacstrap_dir}${passwd[5]}" chmod -f 0750 -- "${pacstrap_dir}${passwd[5]}" chown -hR -- "${passwd[2]}:${passwd[3]}" "${pacstrap_dir}${passwd[5]}" else -- cgit v1.2.3-54-g00ecf From 094afd169a0ff871eb7a6b37d68a9b9bcb7195e4 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Thu, 16 Mar 2023 09:22:57 +0200 Subject: mkarchiso: support %ARCHISO_UUID% variable in boot loader configuration It will be replaced with the ISO's modification date in UTC, i.e. its "UUID". This allows to replace `archisolabel=%ARCHISO_LABEL%` with `archisodevice=UUID=%ARCHISO_UUID%` in boot loader configurations. Related to #202 --- archiso/mkarchiso | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'archiso/mkarchiso') diff --git a/archiso/mkarchiso b/archiso/mkarchiso index e991b52..afaeb6e 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -29,6 +29,7 @@ gpg_key="" gpg_sender="" iso_name="" iso_label="" +iso_uuid="" iso_publisher="" iso_application="" iso_version="" @@ -446,6 +447,7 @@ _make_bootmode_bios.syslinux.mbr() { install -d -m 0755 -- "${isofs_dir}/boot/syslinux" for _cfg in "${profile}/syslinux/"*.cfg; do sed "s|%ARCHISO_LABEL%|${iso_label}|g; + s|%ARCHISO_UUID%|${iso_uuid}|g; s|%INSTALL_DIR%|${install_dir}|g; s|%ARCH%|${arch}|g" \ "${_cfg}" > "${isofs_dir}/boot/syslinux/${_cfg##*/}" @@ -558,21 +560,20 @@ _make_common_bootmode_grub_copy_to_isofs() { # Prepare GRUB configuration files _make_common_bootmode_grub_cfg(){ - local _cfg archiso_uuid search_filename + local _cfg search_filename install -d -- "${work_dir}/grub" - # Precalculate the ISO's modification date in UTC, i.e. its "UUID" - TZ=UTC printf -v archiso_uuid '%(%F-%H-%M-%S-00)T' "$SOURCE_DATE_EPOCH" # Create a /boot/grub/YYYY-mm-dd-HH-MM-SS-00.uuid file on ISO 9660. GRUB will search for it to find the ISO # volume. This is similar to what grub-mkrescue does, except it places the file in /.disk/, but we opt to use a # directory that does not start with a dot to avoid it being accidentally missed when copying the ISO's contents. - : > "${work_dir}/grub/${archiso_uuid}.uuid" - search_filename="/boot/grub/${archiso_uuid}.uuid" + : > "${work_dir}/grub/${iso_uuid}.uuid" + search_filename="/boot/grub/${iso_uuid}.uuid" # Fill GRUB configuration files for _cfg in "${profile}/grub/"*'.cfg'; do sed "s|%ARCHISO_LABEL%|${iso_label}|g; + s|%ARCHISO_UUID%|${iso_uuid}|g; s|%INSTALL_DIR%|${install_dir}|g; s|%ARCH%|${arch}|g; s|%ARCHISO_SEARCH_FILENAME%|${search_filename}|g" \ @@ -821,6 +822,7 @@ _make_bootmode_uefi-x64.systemd-boot.esp() { mcopy -i "${efibootimg}" "${profile}/efiboot/loader/loader.conf" ::/loader/ for _conf in "${profile}/efiboot/loader/entries/"*".conf"; do sed "s|%ARCHISO_LABEL%|${iso_label}|g; + s|%ARCHISO_UUID%|${iso_uuid}|g; s|%INSTALL_DIR%|${install_dir}|g; s|%ARCH%|${arch}|g" \ "${_conf}" | mcopy -i "${efibootimg}" - "::/loader/entries/${_conf##*/}" @@ -1660,6 +1662,8 @@ _set_overrides() { # Set variables that do not have overrides [[ -n "$airootfs_image_type" ]] || airootfs_image_type="squashfs" [[ -n "$iso_name" ]] || iso_name="${app_name}" + # Precalculate the ISO's modification date in UTC, i.e. its "UUID" + TZ=UTC printf -v iso_uuid '%(%F-%H-%M-%S-00)T' "$SOURCE_DATE_EPOCH" } _export_gpg_publickey() { -- cgit v1.2.3-54-g00ecf From 8cc0e9e5b09d504a50701a825f0ab9992ed73b6f Mon Sep 17 00:00:00 2001 From: nl6720 Date: Thu, 16 Mar 2023 09:45:00 +0200 Subject: mkarchiso: read SOURCE_DATE_EPOCH from file early When restarting an interrupted build, SOURCE_DATE_EPOCH needs to be available before `profiledef.sh` is read, since it may reference it. Fixes 7c6f266ec94e3eff23466ed8d0c45e4bee0ddae4 --- CHANGELOG.rst | 3 +++ archiso/mkarchiso | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'archiso/mkarchiso') diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c8630bd..36d173d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -23,10 +23,13 @@ Deprecated Fixed ----- +<<<<<<< HEAD - Wait for ``network-online.target`` to become active before trying to download the script passed via the ``script=`` boot parameter. - Subdirectories from ``grub/`` are copied to the ISO. - Modify the commandline options to a ``cp`` command in ``mkarchiso`` so that the entire script does not exit with failure when a custom ``.bashrc`` file is supplied with the archiso configuration. This fix was needed after **GNU Coreutils** recently changed the behaviour of the ``-n`` (or ``--no-clobber``) commandline option to the ``cp`` command. +- Ensure ``SOURCE_DATE_EPOCH`` is read from the ``build_date`` file before ``profiledef.sh`` is sourced to ensure the + variable has a correct value when used inside ``profiledef.sh``. Removed ------- diff --git a/archiso/mkarchiso b/archiso/mkarchiso index afaeb6e..d1d753e 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -1742,12 +1742,8 @@ _build_iso_base() { # Create working directory [[ -d "${work_dir}" ]] || install -d -- "${work_dir}" - # Write build date to file or if the file exists, read it from there - if [[ -e "${work_dir}/build_date" ]]; then - SOURCE_DATE_EPOCH="$(<"${work_dir}/build_date")" - else - printf '%s\n' "$SOURCE_DATE_EPOCH" > "${work_dir}/build_date" - fi + # Write build date to file if it does not exist already + [[ -e "${work_dir}/build_date" ]] || printf '%s\n' "$SOURCE_DATE_EPOCH" > "${work_dir}/build_date" [[ "${quiet}" == "y" ]] || _show_config _run_once _make_pacman_conf @@ -1863,6 +1859,13 @@ fi # get the absolute path representation of the first non-option argument profile="$(realpath -- "${1}")" +# Read SOURCE_DATE_EPOCH from file early +build_date_file="$(realpath -q -- "${override_work_dir:-./work}/build_date")" || : +if [[ -f "$build_date_file" ]]; then + SOURCE_DATE_EPOCH="$(<"$build_date_file")" +fi +unset build_date_file + _read_profile _set_overrides _validate_options -- cgit v1.2.3-54-g00ecf From dc72a84dae41b21f1718ae23f966abf386f40960 Mon Sep 17 00:00:00 2001 From: 2hexed <2hexed@protonmail.com> Date: Wed, 17 May 2023 14:43:15 +0000 Subject: Update mkarchiso --- archiso/mkarchiso | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archiso/mkarchiso') diff --git a/archiso/mkarchiso b/archiso/mkarchiso index d1d753e..18b6ed7 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -87,7 +87,7 @@ usage: ${app_name} [options] Default: '${iso_application}' -C pacman configuration file. Default: '${pacman_conf}' - -D Set an install_dir. All files will by located here. + -D Set an install_dir. All files will be located here. Default: '${install_dir}' NOTE: Max 8 characters, use only [a-z0-9] -L