Patrick Williams | d91b4b3 | 2023-02-05 20:51:19 -0600 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | PERSIST=/run/mnt-persist |
| 4 | |
| 5 | if [ ! -d $PERSIST ]; then |
| 6 | exit 0 |
| 7 | fi |
| 8 | |
Patrick Williams | ab717d4 | 2024-02-17 15:08:19 -0600 | [diff] [blame] | 9 | # shellcheck disable=SC2043 # @@ pattern will be replaced by recipe |
| 10 | for m in @NOROOTFS_PERSISTENT_DIRS@; do |
Patrick Williams | d91b4b3 | 2023-02-05 20:51:19 -0600 | [diff] [blame] | 11 | 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 |
| 21 | done |