2023-07-18 12:49:44 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
source common.sh
|
|
|
|
|
|
|
|
# Avoid store dir being inside sandbox build-dir
|
|
|
|
unset NIX_STORE_DIR
|
|
|
|
unset NIX_STATE_DIR
|
|
|
|
|
2023-12-11 20:30:40 +02:00
|
|
|
setupStoreDirs
|
2023-07-18 12:49:44 +03:00
|
|
|
|
|
|
|
initLowerStore
|
|
|
|
|
|
|
|
mountOverlayfs
|
|
|
|
|
|
|
|
# Add something to the overlay store
|
|
|
|
overlayPath=$(addTextToStore "$storeB" "overlay-file" "Add to overlay store")
|
2023-07-20 13:03:14 +03:00
|
|
|
stat "$storeBRoot/$overlayPath"
|
2023-07-18 12:49:44 +03:00
|
|
|
|
|
|
|
# Now add something to the lower store
|
|
|
|
lowerPath=$(addTextToStore "$storeA" "lower-file" "Add to lower store")
|
2023-07-20 12:27:11 +03:00
|
|
|
stat "$storeVolume/store-a/$lowerPath"
|
2023-07-18 12:49:44 +03:00
|
|
|
|
|
|
|
# Remount overlayfs to ensure synchronization
|
2023-07-20 13:03:14 +03:00
|
|
|
remountOverlayfs
|
2023-07-18 12:49:44 +03:00
|
|
|
|
|
|
|
# Path should be accessible via overlay store
|
2023-07-20 13:03:14 +03:00
|
|
|
stat "$storeBRoot/$lowerPath"
|