diff -Nru linux-restricted-modules-5.4.0/debian/changelog linux-restricted-modules-5.4.0/debian/changelog --- linux-restricted-modules-5.4.0/debian/changelog 2020-04-22 16:03:46.000000000 +0000 +++ linux-restricted-modules-5.4.0/debian/changelog 2020-04-22 21:43:55.000000000 +0000 @@ -1,3 +1,10 @@ +linux-restricted-modules (5.4.0-26.30+2) focal; urgency=medium + + * /bin/in-target check is flawed as it does not tell the difference + between live-session and in-target chroot. (LP: #1874278) + + -- Dimitri John Ledkov Wed, 22 Apr 2020 22:43:55 +0100 + linux-restricted-modules (5.4.0-26.30+1) focal; urgency=medium * Can't install any packages with ubuntu-drivers using ubuntu-drivers when diff -Nru linux-restricted-modules-5.4.0/debian/templates/nvidia.postinst.in linux-restricted-modules-5.4.0/debian/templates/nvidia.postinst.in --- linux-restricted-modules-5.4.0/debian/templates/nvidia.postinst.in 2020-04-22 16:00:04.000000000 +0000 +++ linux-restricted-modules-5.4.0/debian/templates/nvidia.postinst.in 2020-04-22 21:43:55.000000000 +0000 @@ -10,16 +10,15 @@ exit 0 fi -ubiquity_host() { - if [ -n "${UBIQUITY_FRONTEND}" ]; then - if [ -e /bin/in-target ]; then - return 0 - fi +ubiquity_live() { + if [ -n "${UBIQUITY_FRONTEND}" ] && ! systemd-detect-virt --chroot; then + return 0 + else + return 1 fi - return 1 } # Must load the confmodule for our template to be installed correctly. -if ! ubiquity_host; then +if ! ubiquity_live; then . /usr/share/debconf/confmodule fi @@ -34,10 +33,10 @@ esac mkdir -p /usr/lib/linux -if ! ubiquity_host; then - db_get linux/nvidia/latelink -else +if ubiquity_live; then RET=false +else + db_get linux/nvidia/latelink fi # If the value is changed write it back. if [ "$RET" != "$latelink" ]; then