From 4f4047a3f8927e58d79e396bdd032b9c24bd1f19 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sun, 24 Jan 2021 17:29:01 +0200 Subject: configs/releng: move the mirror uncommenting sed command from customize_airootfs.sh to a pacman hook After pacman-mirrorlist is installed, /etc/pacman.d/hooks/uncomment-mirrors.hook will run a sed command which uncomments all Server lines in /etc/pacman.d/mirrorlist. This brings us another step closer to the complete removal of customize_airootfs.sh. Related to https://gitlab.archlinux.org/archlinux/archiso/-/issues/21 . --- .../airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 configs/releng/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook (limited to 'configs/releng/airootfs/etc/pacman.d') diff --git a/configs/releng/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook b/configs/releng/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook new file mode 100644 index 0000000..ad0b5ba --- /dev/null +++ b/configs/releng/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook @@ -0,0 +1,12 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Type = Package +Target = pacman-mirrorlist + +[Action] +Description = Uncommenting all mirrors in /etc/pacman.d/mirrorlist... +When = PostTransaction +Depends = pacman-mirrorlist +Depends = sed +Exec = /usr/bin/sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist -- cgit v1.2.3-54-g00ecf From a46c74087fe91c35589dcf1082128e282ad8c9be Mon Sep 17 00:00:00 2001 From: nl6720 Date: Wed, 27 Jan 2021 19:10:01 +0200 Subject: config/releng: remove pacman hooks specific to ISO build process from airootfs after they run This works around https://bugs.archlinux.org/task/49347 . Leaving the hooks in the airootfs image will result in it being run when pacstrap is run in the live environment. This should not happen as they are intended for the ISO build process only. Fixes https://gitlab.archlinux.org/archlinux/archiso/-/issues/91 . --- .../airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook | 1 + .../zzzz99-remove-custom-hooks-from-airootfs.hook | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 configs/releng/airootfs/etc/pacman.d/hooks/zzzz99-remove-custom-hooks-from-airootfs.hook (limited to 'configs/releng/airootfs/etc/pacman.d') diff --git a/configs/releng/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook b/configs/releng/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook index ad0b5ba..342aa95 100644 --- a/configs/releng/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook +++ b/configs/releng/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook @@ -1,3 +1,4 @@ +# remove from airootfs! [Trigger] Operation = Install Operation = Upgrade diff --git a/configs/releng/airootfs/etc/pacman.d/hooks/zzzz99-remove-custom-hooks-from-airootfs.hook b/configs/releng/airootfs/etc/pacman.d/hooks/zzzz99-remove-custom-hooks-from-airootfs.hook new file mode 100644 index 0000000..8dfb943 --- /dev/null +++ b/configs/releng/airootfs/etc/pacman.d/hooks/zzzz99-remove-custom-hooks-from-airootfs.hook @@ -0,0 +1,18 @@ +# remove from airootfs! +# As a workaround for https://bugs.archlinux.org/task/49347 , remove pacman hooks specific to the ISO build process. +# If not, they would be used when pacstrap is run in the live environment. + +[Trigger] +Operation = Install +Operation = Upgrade +Operation = Remove +Type = Package +Target = * + +[Action] +Description = Work around FS#49347 by removing custom pacman hooks that are only required during ISO build... +When = PostTransaction +Depends = sh +Depends = coreutils +Depends = grep +Exec = /bin/sh -c "rm -- $(grep -Frl 'remove from airootfs' /etc/pacman.d/hooks/)" -- cgit v1.2.3-54-g00ecf From f9a7b206a58a353eac2d26b464068cfe15f5e461 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Wed, 27 Jan 2021 11:31:02 +0200 Subject: configs/releng: move locale-gen from customize_airootfs.sh to a pacman hook This finally removes customize_airootfs.sh from releng. Fixes https://gitlab.archlinux.org/archlinux/archiso/-/issues/21 . --- .../releng/airootfs/etc/pacman.d/hooks/40-locale-gen.hook | 13 +++++++++++++ configs/releng/airootfs/root/customize_airootfs.sh | 10 ---------- 2 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 configs/releng/airootfs/etc/pacman.d/hooks/40-locale-gen.hook delete mode 100755 configs/releng/airootfs/root/customize_airootfs.sh (limited to 'configs/releng/airootfs/etc/pacman.d') diff --git a/configs/releng/airootfs/etc/pacman.d/hooks/40-locale-gen.hook b/configs/releng/airootfs/etc/pacman.d/hooks/40-locale-gen.hook new file mode 100644 index 0000000..82dd199 --- /dev/null +++ b/configs/releng/airootfs/etc/pacman.d/hooks/40-locale-gen.hook @@ -0,0 +1,13 @@ +# remove from airootfs! +[Trigger] +Operation = Install +Type = Package +Target = glibc + +[Action] +Description = Uncommenting en_US.UTF-8 locale and running locale-gen... +When = PostTransaction +Depends = glibc +Depends = sed +Depends = sh +Exec = /bin/sh -c "sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen && locale-gen" diff --git a/configs/releng/airootfs/root/customize_airootfs.sh b/configs/releng/airootfs/root/customize_airootfs.sh deleted file mode 100755 index 5a39523..0000000 --- a/configs/releng/airootfs/root/customize_airootfs.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -set -e -u - -# Warning: customize_airootfs.sh is deprecated! Support for it will be removed in a future archiso version. - -sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen -locale-gen -- cgit v1.2.3-54-g00ecf