bluerider / liveroot

Initcpio hooks for overlayfs ontop of root
BSD 3-Clause "New" or "Revised" License
79 stars 13 forks source link

overlay_flush syntax error causes unmount to fail #20

Open raingloom opened 7 years ago

raingloom commented 7 years ago

Contents of /usr/bin/overlay_flush copied verbatim:

#!/bin/bash
           mkdir /run/oroot
           mount -U "1bbe211e-cf1c-45eb-bb29-065a9676f04b"              -o rw,relatime,space_cache,compress=zlib,subvolid=5,subvol=/ "/run/oroot"
           if [ "compressed" = "live" ]; then
              btrfs subvolume snapshot / /oroot-snap
              cd /oroot-snap
            else
              cd /
           fi
           rsync -ax --delete --no-whole-file --inplace $PWD/ /run/oroot              --exclude boot --exclude dev              --exclude mnt --exclude proc --exclude run              --exclude sys --exclude tmp --exclude usr/bin/overlay_flush;
           btrfs subvolume snapshot -r "/run/oroot" "/run/oroot/snapshots/$(date +%s)"
           if [ "compressed" = "live" ]; then
              btrfs subvolume delete /oroot-snap
           fi
           umount /run/oroot &&
           rm -r /run/oroot &&

As I understand it, this is always generated from the hook, so this is probably a classic string concatenation bug. The && at the end does not connect to anything.