feat: do not error out if resolv.conf doesn't already exist

This commit is contained in:
Rudra Saraswat 2024-06-05 18:40:56 +00:00
parent 20295cae34
commit 03f30a545e

View file

@ -224,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('bash', '-c', 'rm /.new_rootfs/etc/resolv.conf') exec_chroot('rm', '-f', '/.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')
@ -354,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('bash', '-c', 'rm /.new_rootfs/etc/resolv.conf') exec_chroot('rm', '-f', '/.new_rootfs/etc/resolv.conf')
exec('cp', '-ax', '/.new_rootfs/etc', '/.new.etc') exec('cp', '-ax', '/.new_rootfs/etc', '/.new.etc')