CustomPiOS icon indicating copy to clipboard operation
CustomPiOS copied to clipboard

Make host directory visible from target

Open Salamandar opened this issue 5 years ago • 4 comments

Would it be possible to bind mount a directory on the host to make it visible on the target ? Right now I have a wrapper around build_dist that copies a bunch of files from my git repo (containing the custom OS definitions) before building the image. I can't find any trick to do that properly.

Salamandar avatar Nov 24 '20 21:11 Salamandar

Not really. The mount code is here and its mostly hard-coded in aspect of what goes where: https://github.com/guysoft/CustomPiOS/blob/devel/src/common.sh#L162

If you can share what your code is doing exactly it might help me understand what changes could be done. The idea is to have all the data in the same context and folder so it easy to encapsulate. But perhaps there are changes possible.

guysoft avatar Dec 01 '20 09:12 guysoft

I understand. If there was a before_chroot_script inside which I could do the copy, I could do without a bind mount. For now, I have an acceptable solution : I edited the build_dist script :

#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

export DIST_PATH=${DIR}
export CUSTOM_PI_OS_PATH="$DIR/../CustomPiOS/src"
export PATH=$PATH:$CUSTOM_PI_OS_PATH

rsync -av --delete \
    "$DIR/../../StrangerFamily" \
    "$DIR/modules/strangerpi/filesystem/home/pi"

"$CUSTOM_PI_OS_PATH/build_custom_os" "$@"

Salamandar avatar Dec 01 '20 09:12 Salamandar

That should not be too hard to add. It could be added here: https://github.com/guysoft/CustomPiOS/blob/devel/src/custompios#L147 It will have to be though one script for the whole distro and not one per-module. I think it would make more sense that way.

guysoft avatar Dec 01 '20 10:12 guysoft

i guess this should have read https://github.com/guysoft/CustomPiOS/blob/333dd9f46b84e5b80104e5163d9c2574b4579fef/src/custompios#L147 (clicking on the ellipsis besides a line of code, the pull down menu has an entry "Copy permalink" which will make the reference usable even when the line-numbers change)

umlaeute avatar Sep 14 '23 12:09 umlaeute