Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make host directory visible from target #86

Open
Salamandar opened this issue Nov 24, 2020 · 4 comments
Open

Make host directory visible from target #86

Salamandar opened this issue Nov 24, 2020 · 4 comments

Comments

@Salamandar
Copy link
Contributor

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.

@guysoft
Copy link
Owner

guysoft commented Dec 1, 2020

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.

@Salamandar
Copy link
Contributor Author

Salamandar commented Dec 1, 2020

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" "$@"

@guysoft
Copy link
Owner

guysoft commented Dec 1, 2020

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.

@umlaeute
Copy link
Contributor

i guess this should have read

# execute the base chroot script

(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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants