summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/build/binary_hooks35
-rwxr-xr-xscripts/build/chroot_hooks21
-rwxr-xr-xscripts/build/config10
-rwxr-xr-xscripts/build/source_hooks35
-rwxr-xr-xshare/hooks/normal/0020-create-mtab-symlink.hook.chroot (renamed from share/hooks/live/0020-create-mtab-symlink.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0030-enable-cryptsetup.hook.chroot (renamed from share/hooks/live/0030-enable-cryptsetup.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0040-create-locales-files.hook.chroot (renamed from share/hooks/live/0040-create-locales-files.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0100-remove-adjtime-configuration.hook.chroot (renamed from share/hooks/live/0100-remove-adjtime-configuration.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0110-remove-backup-files.hook.chroot (renamed from share/hooks/live/0110-remove-backup-files.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0120-remove-dbus-machine-id.hook.chroot (renamed from share/hooks/live/0120-remove-dbus-machine-id.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0130-remove-gnome-icon-cache.hook.chroot (renamed from share/hooks/live/0130-remove-gnome-icon-cache.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0140-remove-log-files.hook.chroot (renamed from share/hooks/live/0140-remove-log-files.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0150-remove-mdadm-configuration.hook.chroot (renamed from share/hooks/live/0150-remove-mdadm-configuration.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0160-remove-openssh-server-host-keys.hook.chroot (renamed from share/hooks/live/0160-remove-openssh-server-host-keys.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0170-remove-python-py.hook.chroot (renamed from share/hooks/live/0170-remove-python-py.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0180-remove-systemd-machine-id.hook.chroot (renamed from share/hooks/live/0180-remove-systemd-machine-id.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0190-remove-temporary-files.hook.chroot (renamed from share/hooks/live/0190-remove-temporary-files.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0195-remove-ssl-cert-snakeoil.hook.chroot (renamed from share/hooks/live/0195-remove-ssl-cert-snakeoil.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0200-remove-udev-persistent-cd-rules.hook.chroot (renamed from share/hooks/live/0200-remove-udev-persistent-cd-rules.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0300-remove-udev-persistent-net-rules.hook.chroot (renamed from share/hooks/live/0300-remove-udev-persistent-net-rules.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0400-update-apt-file-cache.hook.chroot (renamed from share/hooks/live/0400-update-apt-file-cache.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0410-update-apt-xapian-index.hook.chroot (renamed from share/hooks/live/0410-update-apt-xapian-index.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0420-update-glx-alternative.hook.chroot (renamed from share/hooks/live/0420-update-glx-alternative.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0430-update-mlocate-database.hook.chroot (renamed from share/hooks/live/0430-update-mlocate-database.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0440-update-nvidia-alternative.hook.chroot (renamed from share/hooks/live/0440-update-nvidia-alternative.hook.chroot)0
-rwxr-xr-xshare/hooks/normal/0910-remove-apt-sources-lists (renamed from share/hooks/live/0910-remove-apt-sources-lists)0
26 files changed, 57 insertions, 44 deletions
diff --git a/scripts/build/binary_hooks b/scripts/build/binary_hooks
index bdad671cc..b40139797 100755
--- a/scripts/build/binary_hooks
+++ b/scripts/build/binary_hooks
@@ -58,21 +58,22 @@ do
done
## Processing local hooks
+for HOOK in config/hooks/normal/*.binary config/hooks/live/*.binary
+do
+ if [ ! -e "${HOOK}" ]
+ then
+ continue
+ fi
+
+ # Making hook executable
+ if [ ! -x "${HOOK}" ]
+ then
+ chmod +x "${HOOK}"
+ fi
+
+ # Executing hook
+ ./"${HOOK}" || { Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
+done
-if Find_files config/hooks/live/*.binary
-then
- for HOOK in config/hooks/live/*.binary
- do
- # Making hook executable
- if [ ! -x "${HOOK}" ]
- then
- chmod +x "${HOOK}"
- fi
-
- # Executing hook
- ./"${HOOK}" || { Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
- done
-
- # Creating stage file
- Create_stagefile .build/binary_hooks
-fi
+# Creating stage file
+Create_stagefile .build/binary_hooks
diff --git a/scripts/build/chroot_hooks b/scripts/build/chroot_hooks
index e25f3b7fd..26ffdd701 100755
--- a/scripts/build/chroot_hooks
+++ b/scripts/build/chroot_hooks
@@ -78,28 +78,32 @@ then
fi
## Processing local hooks
-
-if Find_files config/hooks/live/*.chroot
+if ls config/hooks/*.chroot > /dev/null 2>&1
then
# Restoring cache
Restore_cache cache/packages.chroot
- for _HOOK in config/hooks/live/*.chroot
+ for HOOK in config/hooks/normal/*.binary config/hooks/live/*.binary
do
+ if [ ! -e "${HOOK}" ]
+ then
+ continue
+ fi
+
# Copying hook
- cp "${_HOOK}" chroot/root
+ cp "${HOOK}" chroot/root
# Making hook executable
- if [ ! -x chroot/root/"$(basename ${_HOOK})" ]
+ if [ ! -x chroot/root/"$(basename ${HOOK})" ]
then
- chmod +x chroot/root/"$(basename ${_HOOK})"
+ chmod +x chroot/root/"$(basename ${HOOK})"
fi
# Executing hook
- Chroot chroot "/root/$(basename ${_HOOK})" || { Echo_error "${_HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
+ Chroot chroot "/root/$(basename ${HOOK})" || { Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
# Removing hook
- rm -f chroot/root/"$(basename ${_HOOK})"
+ rm -f chroot/root/"$(basename ${HOOK})"
done
# Saving cache
@@ -112,4 +116,3 @@ fi
# Remove bind mount of build config inside chroot.
umount chroot/live-build/config
rmdir chroot/live-build/config
-
diff --git a/scripts/build/config b/scripts/build/config
index 8e2109594..e6dcd4341 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -1312,11 +1312,19 @@ then
rmdir --ignore-fail-on-non-empty local > /dev/null 2>&1 || true
fi
-mkdir -p config/hooks/live
+mkdir -p config/hooks/normal config/hooks/live
mkdir -p config/includes config/includes.bootstrap config/includes.chroot config/includes.binary config/includes.source
Echo_message "Symlinking hooks..."
+for _HOOK in "${LIVE_BUILD}"/share/hooks/normal/*.hook* /usr/share/normal/build/hooks/normal/*.hook*
+do
+ if [ -e "${_HOOK}" ] && [ ! -e "config/hooks/normal/$(basename ${_HOOK})" ]
+ then
+ ln -s "${_HOOK}" "config/hooks/normal/$(basename ${_HOOK})"
+ fi
+done
+
for _HOOK in "${LIVE_BUILD}"/share/hooks/live/*.hook* /usr/share/live/build/hooks/live/*.hook*
do
if [ -e "${_HOOK}" ] && [ ! -e "config/hooks/live/$(basename ${_HOOK})" ]
diff --git a/scripts/build/source_hooks b/scripts/build/source_hooks
index 6f3e08dcd..d3059de98 100755
--- a/scripts/build/source_hooks
+++ b/scripts/build/source_hooks
@@ -58,21 +58,22 @@ do
done
## Processing local hooks
+for HOOK in config/hooks/normal/*.source config/hooks/live/*.source
+do
+ if [ ! -e "${HOOK}" ]
+ then
+ continue
+ fi
+
+ # Making hook executable
+ if [ ! -x "${HOOK}" ]
+ then
+ chmod +x "${HOOK}"
+ fi
+
+ # Executing hook
+ ./"${HOOK}" || { Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
+done
-if Find_files config/hooks/live/*.source
-then
- for HOOK in config/hooks/live/*.source
- do
- # Making hook executable
- if [ ! -x "${HOOK}" ]
- then
- chmod +x "${HOOK}"
- fi
-
- # Executing hook
- ./"${HOOK}" || { Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
- done
-
- # Creating stage file
- Create_stagefile .build/source_hooks
-fi
+# Creating stage file
+Create_stagefile .build/source_hooks
diff --git a/share/hooks/live/0020-create-mtab-symlink.hook.chroot b/share/hooks/normal/0020-create-mtab-symlink.hook.chroot
index 5c2fa64ae..5c2fa64ae 100755
--- a/share/hooks/live/0020-create-mtab-symlink.hook.chroot
+++ b/share/hooks/normal/0020-create-mtab-symlink.hook.chroot
diff --git a/share/hooks/live/0030-enable-cryptsetup.hook.chroot b/share/hooks/normal/0030-enable-cryptsetup.hook.chroot
index 54c2978d2..54c2978d2 100755
--- a/share/hooks/live/0030-enable-cryptsetup.hook.chroot
+++ b/share/hooks/normal/0030-enable-cryptsetup.hook.chroot
diff --git a/share/hooks/live/0040-create-locales-files.hook.chroot b/share/hooks/normal/0040-create-locales-files.hook.chroot
index 8a5a8677c..8a5a8677c 100755
--- a/share/hooks/live/0040-create-locales-files.hook.chroot
+++ b/share/hooks/normal/0040-create-locales-files.hook.chroot
diff --git a/share/hooks/live/0100-remove-adjtime-configuration.hook.chroot b/share/hooks/normal/0100-remove-adjtime-configuration.hook.chroot
index 7fe5bbd15..7fe5bbd15 100755
--- a/share/hooks/live/0100-remove-adjtime-configuration.hook.chroot
+++ b/share/hooks/normal/0100-remove-adjtime-configuration.hook.chroot
diff --git a/share/hooks/live/0110-remove-backup-files.hook.chroot b/share/hooks/normal/0110-remove-backup-files.hook.chroot
index 55a6b75af..55a6b75af 100755
--- a/share/hooks/live/0110-remove-backup-files.hook.chroot
+++ b/share/hooks/normal/0110-remove-backup-files.hook.chroot
diff --git a/share/hooks/live/0120-remove-dbus-machine-id.hook.chroot b/share/hooks/normal/0120-remove-dbus-machine-id.hook.chroot
index 230099e46..230099e46 100755
--- a/share/hooks/live/0120-remove-dbus-machine-id.hook.chroot
+++ b/share/hooks/normal/0120-remove-dbus-machine-id.hook.chroot
diff --git a/share/hooks/live/0130-remove-gnome-icon-cache.hook.chroot b/share/hooks/normal/0130-remove-gnome-icon-cache.hook.chroot
index ab35a1d68..ab35a1d68 100755
--- a/share/hooks/live/0130-remove-gnome-icon-cache.hook.chroot
+++ b/share/hooks/normal/0130-remove-gnome-icon-cache.hook.chroot
diff --git a/share/hooks/live/0140-remove-log-files.hook.chroot b/share/hooks/normal/0140-remove-log-files.hook.chroot
index f95e54686..f95e54686 100755
--- a/share/hooks/live/0140-remove-log-files.hook.chroot
+++ b/share/hooks/normal/0140-remove-log-files.hook.chroot
diff --git a/share/hooks/live/0150-remove-mdadm-configuration.hook.chroot b/share/hooks/normal/0150-remove-mdadm-configuration.hook.chroot
index 206b494da..206b494da 100755
--- a/share/hooks/live/0150-remove-mdadm-configuration.hook.chroot
+++ b/share/hooks/normal/0150-remove-mdadm-configuration.hook.chroot
diff --git a/share/hooks/live/0160-remove-openssh-server-host-keys.hook.chroot b/share/hooks/normal/0160-remove-openssh-server-host-keys.hook.chroot
index 862704981..862704981 100755
--- a/share/hooks/live/0160-remove-openssh-server-host-keys.hook.chroot
+++ b/share/hooks/normal/0160-remove-openssh-server-host-keys.hook.chroot
diff --git a/share/hooks/live/0170-remove-python-py.hook.chroot b/share/hooks/normal/0170-remove-python-py.hook.chroot
index ff705838f..ff705838f 100755
--- a/share/hooks/live/0170-remove-python-py.hook.chroot
+++ b/share/hooks/normal/0170-remove-python-py.hook.chroot
diff --git a/share/hooks/live/0180-remove-systemd-machine-id.hook.chroot b/share/hooks/normal/0180-remove-systemd-machine-id.hook.chroot
index ed5d6bf6a..ed5d6bf6a 100755
--- a/share/hooks/live/0180-remove-systemd-machine-id.hook.chroot
+++ b/share/hooks/normal/0180-remove-systemd-machine-id.hook.chroot
diff --git a/share/hooks/live/0190-remove-temporary-files.hook.chroot b/share/hooks/normal/0190-remove-temporary-files.hook.chroot
index fd220e030..fd220e030 100755
--- a/share/hooks/live/0190-remove-temporary-files.hook.chroot
+++ b/share/hooks/normal/0190-remove-temporary-files.hook.chroot
diff --git a/share/hooks/live/0195-remove-ssl-cert-snakeoil.hook.chroot b/share/hooks/normal/0195-remove-ssl-cert-snakeoil.hook.chroot
index cdfe39d24..cdfe39d24 100755
--- a/share/hooks/live/0195-remove-ssl-cert-snakeoil.hook.chroot
+++ b/share/hooks/normal/0195-remove-ssl-cert-snakeoil.hook.chroot
diff --git a/share/hooks/live/0200-remove-udev-persistent-cd-rules.hook.chroot b/share/hooks/normal/0200-remove-udev-persistent-cd-rules.hook.chroot
index bdfe52d96..bdfe52d96 100755
--- a/share/hooks/live/0200-remove-udev-persistent-cd-rules.hook.chroot
+++ b/share/hooks/normal/0200-remove-udev-persistent-cd-rules.hook.chroot
diff --git a/share/hooks/live/0300-remove-udev-persistent-net-rules.hook.chroot b/share/hooks/normal/0300-remove-udev-persistent-net-rules.hook.chroot
index 148ba30d1..148ba30d1 100755
--- a/share/hooks/live/0300-remove-udev-persistent-net-rules.hook.chroot
+++ b/share/hooks/normal/0300-remove-udev-persistent-net-rules.hook.chroot
diff --git a/share/hooks/live/0400-update-apt-file-cache.hook.chroot b/share/hooks/normal/0400-update-apt-file-cache.hook.chroot
index 771e9032a..771e9032a 100755
--- a/share/hooks/live/0400-update-apt-file-cache.hook.chroot
+++ b/share/hooks/normal/0400-update-apt-file-cache.hook.chroot
diff --git a/share/hooks/live/0410-update-apt-xapian-index.hook.chroot b/share/hooks/normal/0410-update-apt-xapian-index.hook.chroot
index dcb39b261..dcb39b261 100755
--- a/share/hooks/live/0410-update-apt-xapian-index.hook.chroot
+++ b/share/hooks/normal/0410-update-apt-xapian-index.hook.chroot
diff --git a/share/hooks/live/0420-update-glx-alternative.hook.chroot b/share/hooks/normal/0420-update-glx-alternative.hook.chroot
index 8c36c43f9..8c36c43f9 100755
--- a/share/hooks/live/0420-update-glx-alternative.hook.chroot
+++ b/share/hooks/normal/0420-update-glx-alternative.hook.chroot
diff --git a/share/hooks/live/0430-update-mlocate-database.hook.chroot b/share/hooks/normal/0430-update-mlocate-database.hook.chroot
index 6bfdb3d4f..6bfdb3d4f 100755
--- a/share/hooks/live/0430-update-mlocate-database.hook.chroot
+++ b/share/hooks/normal/0430-update-mlocate-database.hook.chroot
diff --git a/share/hooks/live/0440-update-nvidia-alternative.hook.chroot b/share/hooks/normal/0440-update-nvidia-alternative.hook.chroot
index e73b9678b..e73b9678b 100755
--- a/share/hooks/live/0440-update-nvidia-alternative.hook.chroot
+++ b/share/hooks/normal/0440-update-nvidia-alternative.hook.chroot
diff --git a/share/hooks/live/0910-remove-apt-sources-lists b/share/hooks/normal/0910-remove-apt-sources-lists
index 1c8ca2d22..1c8ca2d22 100755
--- a/share/hooks/live/0910-remove-apt-sources-lists
+++ b/share/hooks/normal/0910-remove-apt-sources-lists