feat: remove resolv.conf before dircmp

This commit is contained in:
Rudra Saraswat 2024-06-05 18:39:40 +00:00
parent a0b4a25934
commit 20295cae34

View file

@ -124,6 +124,8 @@ def update_system():
os.chdir('/') os.chdir('/')
if exec('rm', '-rf', '/.new_rootfs', '/.new.etc', '/.new.var.lib') != 0:
exec('umount', '-l', '/.new_rootfs')
exec('rm', '-rf', '/.new_rootfs', '/.new.etc', '/.new.var.lib') exec('rm', '-rf', '/.new_rootfs', '/.new.etc', '/.new.var.lib')
# Check if update is available # Check if update is available
@ -222,7 +224,7 @@ def update_system():
if type(blend_release.get('user-services')) == list: if type(blend_release.get('user-services')) == list:
user_services += blend_release.get('user-services') user_services += blend_release.get('user-services')
exec_chroot('cp', '/.new_rootfs/etc/resolv.conf', '/.new_rootfs/etc/resolv.conf.orig') exec_chroot('bash', '-c', 'rm /.new_rootfs/etc/resolv.conf')
with open('/.new_rootfs/etc/resolv.conf', 'w') as pacman_mirrorlist_conf: with open('/.new_rootfs/etc/resolv.conf', 'w') as pacman_mirrorlist_conf:
pacman_mirrorlist_conf.write('nameserver 1.1.1.1\n') pacman_mirrorlist_conf.write('nameserver 1.1.1.1\n')
@ -352,7 +354,7 @@ Server = {package_repo["repo-url"]}
exec('cp', '-ax', '/etc/locale.gen', '/.new_rootfs/etc/locale.gen') exec('cp', '-ax', '/etc/locale.gen', '/.new_rootfs/etc/locale.gen')
exec_chroot('locale-gen') exec_chroot('locale-gen')
exec_chroot('mv', '/.new_rootfs/etc/resolv.conf.orig', '/.new_rootfs/etc/resolv.conf') exec_chroot('bash', '-c', 'rm /.new_rootfs/etc/resolv.conf')
exec('cp', '-ax', '/.new_rootfs/etc', '/.new.etc') exec('cp', '-ax', '/.new_rootfs/etc', '/.new.etc')