From b1fe4911fdea74dde46dad43ccf77a70450f00d2 Mon Sep 17 00:00:00 2001 From: Marcos Mello Date: Sun, 5 Jul 2020 16:06:34 -0300 Subject: [PATCH] Reorder make_customize_airootfs() and make_setup_mkinitcpio() in build.sh Also remove unnecessary commented lines. No functional change. --- build.sh | 54 +++++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/build.sh b/build.sh index 696899c..75671fc 100755 --- a/build.sh +++ b/build.sh @@ -89,35 +89,6 @@ make_packages() { setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -p "$(grep -h -v '^#' ${script_path}/packages)" install } -# Copy mkinitcpio archiso hooks and build initramfs (airootfs) -make_setup_mkinitcpio() { - #rsync -r ${script_path}/airootfs/etc/initcpio/ ${work_dir}/${arch}/airootfs/etc/initcpio/ - local _hook - mkdir -p ${work_dir}/${arch}/airootfs/etc/initcpio/hooks - mkdir -p ${work_dir}/${arch}/airootfs/etc/initcpio/install - for _hook in archiso archiso_shutdown archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_loop_mnt; do - cp /usr/lib/initcpio/hooks/${_hook} ${work_dir}/${arch}/airootfs/etc/initcpio/hooks - cp /usr/lib/initcpio/install/${_hook} ${work_dir}/${arch}/airootfs/etc/initcpio/install - done - sed -i "s|/usr/lib/initcpio/|/etc/initcpio/|g" ${work_dir}/${arch}/airootfs/etc/initcpio/install/archiso_shutdown - cp /usr/lib/initcpio/install/archiso_kms ${work_dir}/${arch}/airootfs/etc/initcpio/install - cp /usr/lib/initcpio/archiso_shutdown ${work_dir}/${arch}/airootfs/etc/initcpio - cp ${script_path}/mkinitcpio.conf ${work_dir}/${arch}/airootfs/etc/mkinitcpio-archiso.conf - gnupg_fd= - if [[ ${gpg_key} ]]; then - gpg --export ${gpg_key} >${work_dir}/gpgkey - exec 17<>${work_dir}/gpgkey - fi - - #mkdir -p ${work_dir}/${arch}/airootfs/etc/modprobe.d - #cp ${script_path}/airootfs/etc/modprobe.d/* ${work_dir}/${arch}/airootfs/etc/modprobe.d/ - - ARCHISO_GNUPG_FD=${gpg_key:+17} setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -r 'mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux-lts -g /boot/sysresccd.img' run - if [[ ${gpg_key} ]]; then - exec 17<&- - fi -} - # Customize installation (airootfs) make_customize_airootfs() { cp -af --no-preserve=ownership ${script_path}/airootfs ${work_dir}/${arch} @@ -138,6 +109,31 @@ make_customize_airootfs() { rm -f ${work_dir}/${arch}/airootfs/root/customize_airootfs.sh } +# Copy mkinitcpio archiso hooks and build initramfs (airootfs) +make_setup_mkinitcpio() { + local _hook + mkdir -p ${work_dir}/${arch}/airootfs/etc/initcpio/hooks + mkdir -p ${work_dir}/${arch}/airootfs/etc/initcpio/install + for _hook in archiso archiso_shutdown archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_loop_mnt; do + cp /usr/lib/initcpio/hooks/${_hook} ${work_dir}/${arch}/airootfs/etc/initcpio/hooks + cp /usr/lib/initcpio/install/${_hook} ${work_dir}/${arch}/airootfs/etc/initcpio/install + done + sed -i "s|/usr/lib/initcpio/|/etc/initcpio/|g" ${work_dir}/${arch}/airootfs/etc/initcpio/install/archiso_shutdown + cp /usr/lib/initcpio/install/archiso_kms ${work_dir}/${arch}/airootfs/etc/initcpio/install + cp /usr/lib/initcpio/archiso_shutdown ${work_dir}/${arch}/airootfs/etc/initcpio + cp ${script_path}/mkinitcpio.conf ${work_dir}/${arch}/airootfs/etc/mkinitcpio-archiso.conf + gnupg_fd= + if [[ ${gpg_key} ]]; then + gpg --export ${gpg_key} >${work_dir}/gpgkey + exec 17<>${work_dir}/gpgkey + fi + + ARCHISO_GNUPG_FD=${gpg_key:+17} setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -r 'mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux-lts -g /boot/sysresccd.img' run + if [[ ${gpg_key} ]]; then + exec 17<&- + fi +} + # Prepare kernel/initramfs ${install_dir}/boot/ make_boot() { mkdir -p ${work_dir}/iso/${install_dir}/boot/${arch}