chore: remove .okay after update
This commit is contained in:
parent
754a7ddfff
commit
5dc1713698
2 changed files with 13 additions and 2 deletions
14
akshara
14
akshara
|
@ -154,6 +154,7 @@ def update_system():
|
|||
########################
|
||||
|
||||
# Enable services
|
||||
exec_chroot('systemctl', 'enable', 'akshara')
|
||||
exec_chroot('systemctl', 'enable', 'bluetooth')
|
||||
exec_chroot('systemctl', 'enable', 'cups')
|
||||
exec_chroot('systemctl', '--global', 'enable', 'blend-files')
|
||||
|
@ -214,6 +215,10 @@ def handle_system_packages(operation):
|
|||
error('you may not install linux* packages')
|
||||
exit(1)
|
||||
|
||||
if os.path.isfile('/mnt/iso-update/.ready-for-update'):
|
||||
error('an update was downloaded in the background, you')
|
||||
error('must reboot before installing any system packages')
|
||||
|
||||
if operation == 'set-custom-packages':
|
||||
info('this operation will replace the current overlay on the next boot')
|
||||
info('(any custom system packages/drivers installed earlier will be removed)')
|
||||
|
@ -342,8 +347,11 @@ def daemon():
|
|||
shutil.rmtree('/' + dir)
|
||||
while True:
|
||||
if not os.path.isfile('/mnt/iso-update/.ready-for-update'):
|
||||
update_system()
|
||||
time.sleep(3600)
|
||||
exec('touch', '/var/lib/.akshara-system-lock')
|
||||
system_lock = fasteners.InterProcessLock('/var/lib/.akshara-system-lock')
|
||||
with system_lock:
|
||||
update_system()
|
||||
time.sleep(300)
|
||||
|
||||
|
||||
description = f'''
|
||||
|
@ -406,6 +414,8 @@ try:
|
|||
elif command == handle_system_packages:
|
||||
exec('touch', '/var/lib/.akshara-system-lock')
|
||||
system_lock = fasteners.InterProcessLock('/var/lib/.akshara-system-lock')
|
||||
info('attempting to acquire system lock')
|
||||
print()
|
||||
with system_lock:
|
||||
command(args.command)
|
||||
else:
|
||||
|
|
|
@ -76,6 +76,7 @@ run_latehook() {
|
|||
for i in usr varlibpacman; do
|
||||
rm -rf /new_root/.blend-overlays/$i
|
||||
mv /new_root/.blend-overlays/future-$i /new_root/.blend-overlays/$i
|
||||
rm -f /new_root/.blend-overlays/$i/.okay
|
||||
done
|
||||
else
|
||||
rm -rf /new_root/.blend-overlays /new_root/.blendrw
|
||||
|
|
Loading…
Reference in a new issue