-
Notifications
You must be signed in to change notification settings - Fork 0
/
ovldiff
executable file
·33 lines (28 loc) · 883 Bytes
/
ovldiff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
set -eu
CWD="$(dirname "$0")"
OVL="${1:-$PWD/iso/LiveOS/overlay}"
sqfs="$(realpath -m "$OVL/../squashfs.img")"
test -f "$sqfs"
tmp="$(mktemp -d)"
mkdir "$tmp/dev" "$tmp/ovl"
mount -o ro "$sqfs" "$tmp/dev"
mkdir -p "$OVL" "$OVL/../ovlwork"
mount -o lowerdir="$tmp/dev",upperdir="$OVL",workdir="$OVL/../ovlwork" -t overlay overlay "$tmp/ovl"
( cd "$tmp/ovl"
find etc \! -type d \! -type l \
\! -path 'etc/csh.env' \
\! -path 'etc/environment.d/10-gentoo-env.conf' \
\! -path 'etc/group' \
\! -path 'etc/group-' \
\! -path 'etc/gshadow' \
\! -path 'etc/gshadow-' \
\! -path 'etc/passwd' \
\! -path 'etc/passwd-' \
\! -path 'etc/profile.env' \
\! -path 'etc/shadow' \
\! -path 'etc/shadow-' \
| sort | xargs -I% diff -Nu ../dev/% %
)
umount "$tmp/ovl" "$tmp/dev"
rm -r "$tmp"