This commit is contained in:
muon 2025-07-31 18:04:02 +00:00
parent 97fddca4a4
commit f7fe0becd1
5 changed files with 71 additions and 23 deletions

View file

@ -9,17 +9,18 @@ let
# fs-diff.sh
set -euo pipefail
OLD_TRANSID=$(sudo btrfs subvolume find-new /mnt/root-blank 9999999)
OLD_TRANSID=${OLD_TRANSID}
sudo mkdir /btrfs_tmp
sudo mount -o subvol=/ /dev/mapper/crypted /btrfs_tmp
sudo mkdir /mnt
sudo mount -o subvol=/ /dev/mapper/crypted /mnt
sudo btrfs subvolume find-new "/mnt/root" "$OLD_TRANSID" |
sed \'$d\' |
OLD_TRANSID=$(sudo btrfs subvolume find-new /btrfs_tmp/root-blank 9999999)
OLD_TRANSID=''${OLD_TRANSID#transid marker was }
sudo btrfs subvolume find-new "/btrfs_tmp/root" "$OLD_TRANSID" |
sed '$d' |
cut -f17- -d' ' |
sort |
uniq |
while read path; do
while read -r path; do
path="/$path"
if [ -L "$path" ]; then
: # The path is a symbolic link, so is probably handled by NixOS already
@ -29,7 +30,7 @@ let
echo "$path"
fi
done
sudo umount /mnt
sudo umount /btrfs_tmp
'';
};
in with lib; {