This file is indexed.

postinst is in kmod 24-1ubuntu3.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/sh -e

create_etc_modules() {
  [ -e /etc/modules ] && return 0
  cat <<END > /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

END
  chmod 644 /etc/modules
}

# move the modules parameters from /etc/modules to a new file in modprobe.d
convert_etc_modules() {
  if dpkg --compare-versions "$2" ge "18-2"; then
    return
  fi

  [ -e /etc/modules ] || return 0

  if [ -e /etc/modprobe.d/etc-modules-parameters.conf ]; then
    echo "/etc/modprobe.d/etc-modules-parameters.conf already exists."
    return
  fi

  perl -e '
  use warnings;
  use strict;

  my @parameters;
  while (<>) {
    /^# Parameters can be specified after the module name\.$/ && next;
    push(@parameters, $1) if s/^( (\s* \w+) \s+ \w.* )$/$2/x;
    print $_;
  }
  exit 0 if not @parameters;

  open(OUT, "> /etc/modprobe.d/etc-modules-parameters.conf") or die "open: $!";
  print OUT "# These parameters have been moved from /etc/modules by the kmod package.\n\n";
  print OUT "options $_\n" foreach @parameters;
  close OUT or die "close: $!";
  ' < /etc/modules > /etc/modules.kmod-postinst

  # replace the old file if it has been changed
  if cmp --quiet /etc/modules /etc/modules.kmod-postinst; then
    rm /etc/modules.kmod-postinst
  else
    mv /etc/modules.kmod-postinst /etc/modules
  fi
}

case "$1" in
  configure)
  create_etc_modules
  convert_etc_modules "$@"

  # on amd64 installer's hw-detect component used to unconditionally
  # add rtc module. Nowawadays, rtc module has been completely dropped
  # from the kernel.
  if dpkg --compare-versions "$2" lt "16-2ubuntu4"; then
      sed -i '/^rtc$/d' /etc/modules
  fi
esac

dpkg-maintscript-helper rm_conffile /etc/modprobe.d/mlx4.conf 24-1ubuntu2 kmod -- "$@"

# Automatically added by dh_installdeb/11.1.3ubuntu1
dpkg-maintscript-helper rm_conffile /etc/init/kmod.conf 24-1ubuntu2~ kmod -- "$@"
# End automatically added section
# Automatically added by dh_installinit/11.1.3ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	if [ -x "/etc/init.d/kmod" ]; then
		update-rc.d kmod defaults >/dev/null || exit 1
	fi
fi
# End automatically added section


exit 0