From 77f7e6d8cc0b806e8f1ba0d51d0f2aa876d214f1 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 29 Mar 2023 18:39:55 -0500 Subject: [PATCH] init-storage: Create intermediate dirs in /etc When creating writable paths in the `/etc` subvolume, the `setup_etc` function needs to create intermediate directories before copying existing files from the root filesystem. Without this step, `cp` will fail with a "no such file or directory" error, referring to the destination path. --- overlay/usr/libexec/init-storage | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/overlay/usr/libexec/init-storage b/overlay/usr/libexec/init-storage index eb87e4f..963b74e 100755 --- a/overlay/usr/libexec/init-storage +++ b/overlay/usr/libexec/init-storage @@ -136,6 +136,11 @@ setup_etc() { while read type path; do if [ ! -e "${tmpdir}/${path}" ]; then if [ -e /etc/"${path}" ]; then + case "${path}" in + */*) + mkdir -p "${tmpdir}/${path%/*}" + ;; + esac cp -ca /etc/"${path}" "${tmpdir}/${path}" elif [ "${type}" = d ]; then mkdir -p "${tmpdir}/${path}"