Commit 56848edb authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Tim Gardner

UBUNTU: [Debian] module-inclusion -- add dependency inclusion for a list

When adding a module via an inclusion list, add any specific dependencies
it lists.
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
parent dcbb8228
......@@ -84,6 +84,7 @@ install-%: target_flavour = $*
install-%: MODHASHALGO=sha512
install-%: MODSECKEY=$(builddir)/build-$*/certs/signing_key.pem
install-%: MODPUBKEY=$(builddir)/build-$*/certs/signing_key.x509
install-%: build_dir=$(builddir)/build-$*
install-%: splopts = INSTALL_MOD_STRIP=1
install-%: splopts += INSTALL_MOD_PATH=$(pkgdir)/
install-%: splopts += INSTALL_MOD_DIR=zfs
......@@ -178,13 +179,17 @@ ifeq ($(do_extras_package),true)
# Remove all modules not in the inclusion list.
#
if [ -f $(DEBIAN)/control.d/$(target_flavour).inclusion-list ] ; then \
/sbin/depmod -v -b $(pkgdir) $(abi_release)-$* | \
sed -e "s@$(pkgdir)/lib/modules/$(abi_release)-$*/kernel/@@g" | \
awk '{ print $$1 " " $$NF}' >$(build_dir)/module-inclusion.depmap; \
mkdir -p $(pkgdir_ex)/lib/modules/$(abi_release)-$*; \
mv $(pkgdir)/lib/modules/$(abi_release)-$*/kernel \
$(pkgdir_ex)/lib/modules/$(abi_release)-$*/kernel; \
$(SHELL) $(DROOT)/scripts/module-inclusion --master \
$(pkgdir_ex)/lib/modules/$(abi_release)-$*/kernel \
$(pkgdir)/lib/modules/$(abi_release)-$*/kernel \
$(DEBIAN)/control.d/$(target_flavour).inclusion-list 2>&1 | \
$(DEBIAN)/control.d/$(target_flavour).inclusion-list \
$(build_dir)/module-inclusion.depmap 2>&1 | \
tee $(target_flavour).inclusion-list.log; \
/sbin/depmod -b $(pkgdir) -ea -F $(pkgdir)/boot/System.map-$(abi_release)-$* \
$(abi_release)-$* 2>&1 |tee $(target_flavour).depmod.log; \
......
......@@ -7,7 +7,8 @@
# usage: $0 ROOT INCLUSION_LIST
# example: $0 \
# debian/build/build-virtual-ALL debian/build/build-virtual \
# debian.master/control.d/virtual.inclusion-list
# debian.master/control.d/virtual.inclusion-list \
# virtual.depmap
master=0
if [ "$1" = "--master" ]; then
master=1
......@@ -17,6 +18,9 @@ fi
ROOT=$1
NROOT=$2
ILIST=$3
DEPMAP=$4
tmp="/tmp/module-inclusion.$$"
#
# Prep a destination directory.
......@@ -47,8 +51,9 @@ mkdir -p ${NROOT}
;;
esac
done <"${ILIST}"
} >"$tmp"
# Copy over the listed modules.
} | \
while read i
do
# If this is already moved over, all is good.
......@@ -64,6 +69,36 @@ do
else
echo "Warning: Could not find ${ROOT}/$i" 1>&2
fi
done <"$tmp"
# Copy over any dependancies, note if those are missing
# we know they are in a pre-requisite package as they must
# have existed at depmap generation time, and can only have
# moved into a package.
let n=0 || true
while [ -s "$tmp" ]
do
let n="$n+1" || true
[ "$n" = "20" ] && break || true
echo "NOTE: pass $n: dependency scan" 1>&2
while read i
do
grep "^$i " "$DEPMAP" | \
while read m d
do
if [ -f "${ROOT}/$d" ]; then
echo "NOTE: pass $n: ${i} pulls in ${d}" 1>&2
echo "$d"
mkdir -p "${NROOT}/`dirname $d`"
mv "${ROOT}/$d" "${NROOT}/$d"
fi
done
done <"$tmp" >"$tmp.new"
mv -f "$tmp.new" "$tmp"
done
rm -f "$tmp"
exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment