From d827c6cf1631209f5042a9d1d8a7ecc24223c8a0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 23:06:40 +0200 Subject: Adding upstream version 13.11.4. Signed-off-by: Daniel Baumann --- dh_installinitramfs | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100755 dh_installinitramfs (limited to 'dh_installinitramfs') diff --git a/dh_installinitramfs b/dh_installinitramfs new file mode 100755 index 0000000..37fb27f --- /dev/null +++ b/dh_installinitramfs @@ -0,0 +1,103 @@ +#!/usr/bin/perl + +=head1 NAME + +dh_installinitramfs - install initramfs hooks and setup maintscripts + +=cut + +use strict; +use warnings; +use Debian::Debhelper::Dh_Lib; + +our $VERSION = DH_BUILTIN_VERSION; + +=head1 SYNOPSIS + +B [S>] [B<-n>] + +=head1 DESCRIPTION + +B is a debhelper program that is responsible for +installing Debian package provided initramfs hooks. + +If B installs or detects one or more initramfs +hooks in the package, then it also automatically generates the noawait +trigger B command needed to interface with the +Debian initramfs system. This trigger is inserted into the +packaging by L. + +=head1 FILES + +=over 4 + +=item debian/I.initramfs-hook + +Assumed to be an initramfs hook that will be installed into F<< +usr/share/initramfs-tools/hooks/I >> in the package build +directory. See B in L for more +information about initramfs hooks. + +=back + +=head1 OPTIONS + +=over 4 + +=item B<-n>, B<--no-scripts> + +Do not add the B trigger even if it seems like the package +might need it. The option is called B<--no-scripts> for historical +reasons as B would previously generate maintainer +scripts that called B. + +Use this option, if you need to interface with the B +system that is not satisfied by the noawait trigger (e.g. because you need +the extra guarantees and head-aches of a await trigger). + +=back + +=head1 NOTES + +Note that this command is not idempotent. L should be called +between invocations of this command. Otherwise, it may cause multiple +instances of the same text to be added to triggers file. + +=cut + +init(); + +# PROMISE: DH NOOP WITHOUT initramfs-hook tmp(usr/share/initramfs-tools/hooks) cli-options() + +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp = tmpdir($package); + my $hook_script = pkgfile($package, 'initramfs-hook'); + my $has_hooks; + my $hook_dir = "${tmp}/usr/share/initramfs-tools/hooks"; + + if ($hook_script ne '') { + install_dir($hook_dir); + install_prog($hook_script, "${hook_dir}/${package}"); + $has_hooks = 1; + } elsif (-d $hook_dir and not is_empty_dir($hook_dir)) { + $has_hooks = 1; + } + + if ($has_hooks && ! $dh{NOSCRIPTS}) { + autotrigger($package, 'activate-noawait', 'update-initramfs'); + } +} + +=head1 SEE ALSO + +L +L +L + +This program is a part of debhelper. + +=head1 AUTHOR + +Niels Thykier + +=cut -- cgit v1.2.3