Giter Club home page Giter Club logo

Comments (4)

pevsonic avatar pevsonic commented on June 18, 2024 1

Fixed by d790fed thanks!

from pi-gen.

pevsonic avatar pevsonic commented on June 18, 2024

Fixed this with a pleasingly minimal change here at : pevsonic@2fe8d47

from pi-gen.

XECDesign avatar XECDesign commented on June 18, 2024

Thanks!

So I understand a bit better, could you please give an example output lines of 'mount' which demonstrate the situation where the problem would occur?

from pi-gen.

pevsonic avatar pevsonic commented on June 18, 2024

So I understand a bit better, could you please give an example output lines of 'mount' which demonstrate the situation where the problem would occur?

Sure!

So test scenario... on this machine, physical drive (bigssd) is mounted at /mnt/bigssd. It has a top level split of directories that get bind-mounted to their actual locations :

/home
/opt
/tftpboot
/workdrive
...

For example, fstab contains :

#
# Bind-mounts
#

/mnt/bigssd/home					/home		auto	defaults,bind	0	0
/mnt/bigssd/opt						/opt		auto	defaults,bind	0	0
/mnt/bigssd/workdrive					/workdrive	auto	defaults,bind	0	0
/mnt/bigssd/tftpboot					/tftpboot	auto	defaults,bind	0	0

I create a new test project under /workdrive/projects which is part of my usual workflow :

cd /workdrive/projects
git clone  -b arm64 https://github.com/RPi-Distro/pi-gen.git
cd pi-gen

At the time of writing, git log --oneline | head -1 gives me :

64e2057 Merge branch 'master' into arm64

I then modify scripts/common to add debug in :

unmount(){
	if [ -z "$1" ]; then
		DIR=$PWD
	else
		DIR=$1
	fi

	echo "-------------------------------------------------"
	echo "Scenario C: existing unmount() logic :"
	mount | grep "$DIR" | cut -f 3 -d ' ' | sort -r
	echo "-------------------------------------------------"

	echo "-------------------------------------------------"
	echo "Scenario D: new unmount() logic :"
	mount | grep " $DIR" | cut -f 3 -d ' ' | sort -r
	echo "-------------------------------------------------"

	while mount | grep -q "$DIR"; do
		local LOCS
		LOCS=$(mount | grep "$DIR" | cut -f 3 -d ' ' | sort -r)
		for loc in $LOCS; do
			umount "$loc"
		done
	done
}

And create a trivial config as per README.md and attempt to build :

echo "IMG_NAME='raspios'" > config
touch ./stage3/SKIP ./stage4/SKIP ./stage5/SKIP
touch ./stage4/SKIP_IMAGES ./stage5/SKIP_IMAGES
sudo ./build.sh

This then crashes out with a failure containing the debug I added showing what's going on :

...
[16:08:36] End /workdrive/projects/pi-gen/stage0/02-firmware/01-packages
[16:08:36] Begin /workdrive/projects/pi-gen/stage0/02-firmware/02-run.sh
[16:08:36] End /workdrive/projects/pi-gen/stage0/02-firmware/02-run.sh
[16:08:36] End /workdrive/projects/pi-gen/stage0/02-firmware
[16:08:36] Begin /workdrive/projects/pi-gen/stage0/files
[16:08:36] End /workdrive/projects/pi-gen/stage0/files
-------------------------------------------------
Scenario C: existing unmount() logic :
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/tmp
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/sys
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/run
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/proc
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/dev/pts
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/dev
/mnt/bigssd/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/tmp
/mnt/bigssd/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/sys
/mnt/bigssd/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/run
/mnt/bigssd/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/proc
/mnt/bigssd/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/dev/pts
/mnt/bigssd/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/dev
-------------------------------------------------
-------------------------------------------------
Scenario D: new unmount() logic :
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/tmp
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/sys
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/run
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/proc
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/dev/pts
/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/dev
-------------------------------------------------
umount: /mnt/bigssd/workdrive/projects/pi-gen/work/raspios/stage0/rootfs/tmp: not mounted.
pev@thinkpad:/workdrive/projects/pi-gen$ 

from pi-gen.

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.