mirror of
https://github.com/truenas/scale-build.git
synced 2025-12-24 13:00:20 +00:00
Fix installer DNS (#840)
This commit is contained in:
@@ -329,6 +329,8 @@ iso-packages:
|
|||||||
- python3-truenas-installer
|
- python3-truenas-installer
|
||||||
- udhcpc
|
- udhcpc
|
||||||
- vim-tiny
|
- vim-tiny
|
||||||
|
# Must be the last package as installing it breaks /etc/resolv.conf in chroot
|
||||||
|
- systemd-resolved
|
||||||
|
|
||||||
#
|
#
|
||||||
# List of Git source repositories the build will checkout and perform a debian
|
# List of Git source repositories the build will checkout and perform a debian
|
||||||
|
|||||||
@@ -32,10 +32,18 @@ def install_iso_packages():
|
|||||||
def install_iso_packages_impl():
|
def install_iso_packages_impl():
|
||||||
run_in_chroot(['apt', 'update'])
|
run_in_chroot(['apt', 'update'])
|
||||||
|
|
||||||
|
with open(f"{CHROOT_BASEDIR}/etc/resolv.conf") as f:
|
||||||
|
resolv_conf = f.read()
|
||||||
|
|
||||||
# echo "/dev/disk/by-label/TRUENAS / iso9660 loop 0 0" > ${CHROOT_BASEDIR}/etc/fstab
|
# echo "/dev/disk/by-label/TRUENAS / iso9660 loop 0 0" > ${CHROOT_BASEDIR}/etc/fstab
|
||||||
for package in get_manifest()['iso-packages']:
|
for package in get_manifest()['iso-packages']:
|
||||||
run_in_chroot(['apt', 'install', '-y', package])
|
run_in_chroot(['apt', 'install', '-y', package])
|
||||||
|
|
||||||
|
# Installing systemd-resolved breaks existing resolv.conf
|
||||||
|
os.unlink(f"{CHROOT_BASEDIR}/etc/resolv.conf")
|
||||||
|
with open(f"{CHROOT_BASEDIR}/etc/resolv.conf", "w") as f:
|
||||||
|
f.write(resolv_conf)
|
||||||
|
|
||||||
# Inject vendor name into grub.cfg
|
# Inject vendor name into grub.cfg
|
||||||
with open(CONF_GRUB, 'r') as f:
|
with open(CONF_GRUB, 'r') as f:
|
||||||
grub_cfg = f.read()
|
grub_cfg = f.read()
|
||||||
@@ -55,7 +63,7 @@ def make_iso_file():
|
|||||||
run(fr'chroot {CHROOT_BASEDIR} /bin/bash -c "echo -e \"root\nroot\" | passwd root"', shell=True)
|
run(fr'chroot {CHROOT_BASEDIR} /bin/bash -c "echo -e \"root\nroot\" | passwd root"', shell=True)
|
||||||
|
|
||||||
# Bring up network for the installer
|
# Bring up network for the installer
|
||||||
run(f'chroot {CHROOT_BASEDIR} systemctl enable systemd-networkd', shell=True)
|
run(f'chroot {CHROOT_BASEDIR} systemctl enable systemd-networkd systemd-resolved', shell=True)
|
||||||
|
|
||||||
# Create /etc/version
|
# Create /etc/version
|
||||||
with open(os.path.join(CHROOT_BASEDIR, 'etc/version'), 'w') as f:
|
with open(os.path.join(CHROOT_BASEDIR, 'etc/version'), 'w') as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user