GithubHelp home page GithubHelp logo

Comments (2)

eugulixes avatar eugulixes commented on August 15, 2024

@mosesdeutschlaender, thank you for opening the issue.
I can't reproduce the problem (even with debootstrap 1.0.106), but I think I know the root of it. Could you test the bionic-fix-kernel-installation-in-chroot branch?

I added the following patch which is applied before installation of the kernel.

diff --git a/functions b/functions
index b889c1a..6cc1943 100644
--- usr/share/flash-kernel/functions
+++ usr/share/flash-kernel/functions
@@ -710,6 +710,10 @@
 }
 
 main() {
+if systemd-detect-virt --chroot; then
+	echo "A chroot environment has been detected. Interrupt flash-kernel." >&2
+	exit 0
+fi
 force="no"
 if [ "x$1" = "x--force" ]; then
 	force="yes"
diff --git a/initramfs-tools/hooks/flash_kernel_set_root b/initramfs-tools/hooks/flash_kernel_set_root
index ac57d12..98d76ab 100755
--- usr/share/initramfs-tools/hooks/flash_kernel_set_root
+++ usr/share/initramfs-tools/hooks/flash_kernel_set_root
@@ -62,6 +62,11 @@ if systemd-detect-virt --quiet --container; then
 	exit 0
 fi
 
+# Do not run inside a chroot environment as well
+if systemd-detect-virt --chroot; then
+	exit 0
+fi
+
 # Record the root filesystem device for use during boot
 rootdev=$(egrep '^[^# 	]+[ 	]+/[ 	]' /etc/fstab | awk '{print $1}') || true
 

If it works fine, I'll merge it. Otherwise, we'll keep thinking how to fix the problem.

from pieman.

eugulixes avatar eugulixes commented on August 15, 2024

@mosesdeutschlaender, I've just reproduced the problem and tested the patch. It works great and will be merged to master today.

from pieman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.