2023-02-11 06:03:29 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
run_latehook() {
|
|
|
|
if [[ -f /new_root/blend/states/.load_prev_state ]] && compgen -G "/new_root/blend/states/state+([0-9]).tar.gz" >/dev/null; then
|
|
|
|
rm -rf /new_root/blend/overlay/current
|
|
|
|
mkdir -p /new_root/blend/overlay/current/usr
|
|
|
|
c=0
|
|
|
|
for i in $(compgen -G "/new_root/blend/states/state*.tar.gz"); do
|
|
|
|
n="${i:19:-7}"
|
|
|
|
if [[ "$n" -gt "$c" ]]; then
|
|
|
|
c="$n"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
tar -xvpzf "/new_root/blend/states/state${c}.tar.gz" -C "/new_root/blend/overlay/current/usr" --numeric-owner &>/dev/null
|
|
|
|
rm -f "/new_root/blend/states/state${c}.tar.gz" "/new_root/blend/states/.load_prev_state"
|
|
|
|
fi
|
|
|
|
|
2023-04-10 23:54:31 -05:00
|
|
|
mkdir -p /new_root/blend/overlay/current/usr/bin \
|
|
|
|
/new_root/blend/overlay/current/usr/sbin \
|
2023-04-17 02:26:58 -05:00
|
|
|
/new_root/blend/overlay/current/usr/share
|
2023-04-10 23:54:31 -05:00
|
|
|
|
|
|
|
mkdir -p /new_root/usr/bin \
|
|
|
|
/new_root/usr/sbin \
|
2023-04-17 02:26:58 -05:00
|
|
|
/new_root/usr/share
|
2023-04-10 23:54:31 -05:00
|
|
|
rm -rf /new_root/blend/overlay/workdir_1 /new_root/blend/overlay/workdir_2 /new_root/blend/overlay/workdir_3
|
|
|
|
mkdir -p /new_root/blend/overlay/workdir_1 /new_root/blend/overlay/workdir_2 /new_root/blend/overlay/workdir_3
|
|
|
|
mount -t overlay overlay -o 'lowerdir=/new_root/usr/bin,upperdir=/new_root/blend/overlay/current/usr/bin,workdir=/new_root/blend/overlay/workdir_1' /new_root/usr/bin -o index=off
|
|
|
|
mount -t overlay overlay -o 'lowerdir=/new_root/usr/sbin,upperdir=/new_root/blend/overlay/current/usr/sbin,workdir=/new_root/blend/overlay/workdir_2' /new_root/usr/sbin -o index=off
|
2023-04-17 02:26:58 -05:00
|
|
|
mount -t overlay overlay -o 'lowerdir=/new_root/usr/share,upperdir=/new_root/blend/overlay/current/usr/share,workdir=/new_root/blend/overlay/workdir_3' /new_root/usr/share -o index=off
|
2023-02-11 06:03:29 -06:00
|
|
|
}
|