copy-modules: Fail if building from installed Linux package without modules.dep
When I added support for building udebs directly from a kernel source
package, I made copy-modules run depmod for Linux architectures if
modules.dep was missing. Rearrange the conditions so we generate
modules.dep if-and-only-if building from a kernel source package.
Fail if we're building from an installed Linux package and it's not
present.
Ben Hutchings
3 years ago
63 | 63 | fi |
64 | 64 | |
65 | 65 | if [ "$os" = "linux" ] ; then |
66 | if [ -e "$moddir/modules.dep" ]; then | |
66 | if [ "$SOURCEDIR" ]; then | |
67 | modulesdep=$tmpdir/modules.dep | |
68 | PATH="/usr/sbin:/sbin:$PATH" depmod \ | |
69 | -b $SOURCEDIR $installedname -n \ | |
70 | | sed '/^#/d; /^alias /,$d' >$modulesdep | |
71 | elif [ -e "$moddir/modules.dep" ]; then | |
67 | 72 | modulesdep=$moddir/modules.dep |
68 | 73 | else |
69 | modulesdep=$tmpdir/modules.dep | |
70 | PATH="/usr/sbin:/sbin:$PATH" depmod \ | |
71 | ${SOURCEDIR:+-b $SOURCEDIR} $installedname -n \ | |
72 | | sed '/^#/d; /^alias /,$d' >$modulesdep | |
74 | echo "Installed kernel package is missing $moddir/modules.dep" >&2 | |
75 | exit 1 | |
73 | 76 | fi |
74 | 77 | |
75 | 78 | # get module dependencies from modules.dep |