mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 13:36:58 +02:00
fix(*): move dev_image to overlays
put the dev_image in overlays/usr/local
This commit is contained in:
parent
cf8be2c320
commit
be72d56a50
@ -5,7 +5,7 @@
|
|||||||
. "${SRC_ROOT}/platform/dev/toolchain_utils.sh" || exit 1
|
. "${SRC_ROOT}/platform/dev/toolchain_utils.sh" || exit 1
|
||||||
|
|
||||||
# Overlays are parts of the disk that live on the stateful partition
|
# Overlays are parts of the disk that live on the stateful partition
|
||||||
ROOT_OVERLAYS=(var opt srv home)
|
ROOT_OVERLAYS=(var opt srv home usr/local)
|
||||||
|
|
||||||
cleanup_mounts() {
|
cleanup_mounts() {
|
||||||
local prev_ret=$?
|
local prev_ret=$?
|
||||||
@ -151,11 +151,11 @@ create_base_image() {
|
|||||||
sudo mount --bind "${stateful_fs_dir}/overlays/$i" "${root_fs_dir}/$i"
|
sudo mount --bind "${stateful_fs_dir}/overlays/$i" "${root_fs_dir}/$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
sudo mkdir -p "${stateful_fs_dir}/images/dev"
|
sudo mkdir -p "${stateful_fs_dir}/overlays/usr/local"
|
||||||
|
|
||||||
# Create symlinks so that /usr/local/usr based directories are symlinked to
|
# Create symlinks so that /usr/local/usr based directories are symlinked to
|
||||||
# /usr/local/ directories e.g. /usr/local/usr/bin -> /usr/local/bin, etc.
|
# /usr/local/ directories e.g. /usr/local/usr/bin -> /usr/local/bin, etc.
|
||||||
setup_symlinks_on_root "${stateful_fs_dir}/images/dev" \
|
setup_symlinks_on_root "${stateful_fs_dir}/overlays/usr/local" \
|
||||||
"${stateful_fs_dir}/overlays/var" \
|
"${stateful_fs_dir}/overlays/var" \
|
||||||
"${stateful_fs_dir}"
|
"${stateful_fs_dir}"
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ create_base_image() {
|
|||||||
|
|
||||||
# Setup the dev image for developer tools
|
# Setup the dev image for developer tools
|
||||||
sudo mkdir -p "${root_fs_dir}/usr/local"
|
sudo mkdir -p "${root_fs_dir}/usr/local"
|
||||||
sudo mount --bind "${stateful_fs_dir}/images/dev" "${root_fs_dir}/usr/local"
|
sudo mount --bind "${stateful_fs_dir}/overlays/usr/local" "${root_fs_dir}/usr/local"
|
||||||
|
|
||||||
sudo mkdir -p "${root_fs_dir}/dev"
|
sudo mkdir -p "${root_fs_dir}/dev"
|
||||||
|
|
||||||
|
@ -735,7 +735,7 @@ setup_symlinks_on_root() {
|
|||||||
# Give args better names.
|
# Give args better names.
|
||||||
local dev_image_target=$1
|
local dev_image_target=$1
|
||||||
local var_target=$2
|
local var_target=$2
|
||||||
local dev_image_root="$3/images/dev"
|
local dev_image_root="$3/overlays/usr/local"
|
||||||
|
|
||||||
# If our var target is actually the standard var, we are cleaning up the
|
# If our var target is actually the standard var, we are cleaning up the
|
||||||
# symlinks (could also check for /usr/local for the dev_image_target).
|
# symlinks (could also check for /usr/local for the dev_image_target).
|
||||||
|
@ -181,12 +181,12 @@ mount_image() {
|
|||||||
# Mount directories and setup symlinks.
|
# Mount directories and setup symlinks.
|
||||||
sudo mount --bind "${FLAGS_stateful_mountpt}/overlays/var" \
|
sudo mount --bind "${FLAGS_stateful_mountpt}/overlays/var" \
|
||||||
"${FLAGS_rootfs_mountpt}/var"
|
"${FLAGS_rootfs_mountpt}/var"
|
||||||
sudo mount --bind "${FLAGS_stateful_mountpt}/images/dev" \
|
sudo mount --bind "${FLAGS_stateful_mountpt}/overlays/usr/local" \
|
||||||
"${FLAGS_rootfs_mountpt}/usr/local"
|
"${FLAGS_rootfs_mountpt}/usr/local"
|
||||||
# Setup symlinks in /usr/local so you can emerge packages into /usr/local.
|
# Setup symlinks in /usr/local so you can emerge packages into /usr/local.
|
||||||
|
|
||||||
if [ ${FLAGS_read_only} -eq ${FLAGS_FALSE} ]; then
|
if [ ${FLAGS_read_only} -eq ${FLAGS_FALSE} ]; then
|
||||||
setup_symlinks_on_root "${FLAGS_stateful_mountpt}/images/dev" \
|
setup_symlinks_on_root "${FLAGS_stateful_mountpt}/overlays/usr/local" \
|
||||||
"${FLAGS_stateful_mountpt}/overlays/var" "${FLAGS_stateful_mountpt}"
|
"${FLAGS_stateful_mountpt}/overlays/var" "${FLAGS_stateful_mountpt}"
|
||||||
fi
|
fi
|
||||||
info "Image specified by ${FLAGS_from} mounted at"\
|
info "Image specified by ${FLAGS_from} mounted at"\
|
||||||
|
Loading…
Reference in New Issue
Block a user