blob: 9ec0e2f795bae855aa758d3e67089edf9cd86a84 [file] [log] [blame]
Patrick Williamsd91b4b32023-02-05 20:51:19 -06001#!/bin/sh
2
3PERSIST=/run/mnt-persist
4
5if [ ! -d $PERSIST ]; then
6 exit 0
7fi
8
Patrick Williamsab717d42024-02-17 15:08:19 -06009# shellcheck disable=SC2043 # @@ pattern will be replaced by recipe
10for m in @NOROOTFS_PERSISTENT_DIRS@; do
Patrick Williamsd91b4b32023-02-05 20:51:19 -060011 if [ ! -d $PERSIST/$m-data ]; then
12 mkdir -p $PERSIST/$m-data
13 fi
14
15 if [ ! -d $PERSIST/$m-work ]; then
16 mkdir -p $PERSIST/$m-work
17 fi
18
19 mount overlay /$m -t overlay -o \
20 lowerdir=/$m,upperdir=$PERSIST/$m-data,workdir=$PERSIST/$m-work
21done