Use new installer

This commit is contained in:
themylogin
2024-02-21 12:30:58 +01:00
parent d345032855
commit 214b0ab4e5
3 changed files with 4 additions and 22 deletions

View File

@@ -309,17 +309,10 @@ iso-packages:
- curl
- bzip2
- linux-image-truenas-production-amd64
- dialog
- iproute2
- jq
- live-boot
- truenas-installer
- parted
- pciutils
- python3-libzfs
- python3-licenselib
- python3-pyudev
- setserial
- python3-truenas-installer
- udhcpc
- vim-tiny

View File

@@ -2,7 +2,7 @@
if [ -f /cdrom/TrueNAS-SCALE.update ];
then
until /sbin/truenas-install; do true; done
until /usr/bin/python3 -m truenas_installer; do true; done
else
read -p "No installation media found. Press enter to reboot..." answer
reboot

View File

@@ -32,22 +32,15 @@ RE_UNSQUASHFS_PROGRESS = re.compile(r"\[.+]\s+(?P<extracted>[0-9]+)/(?P<total>[0
run_kw = dict(check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8", errors="ignore")
IS_FREEBSD = platform.system().upper() == "FREEBSD"
is_json_output = False
def write_progress(progress, message):
if is_json_output:
sys.stdout.write(json.dumps({"progress": progress, "message": message}) + "\n")
else:
sys.stdout.write(f"[{int(progress * 100)}%] {message}\n")
sys.stdout.write(json.dumps({"progress": progress, "message": message}) + "\n")
sys.stdout.flush()
def write_error(error, raise_=False, prefix="Error: "):
if is_json_output:
sys.stdout.write(json.dumps({"error": error}) + "\n")
else:
sys.stdout.write(f"{prefix}{error}\n")
sys.stdout.write(json.dumps({"error": error}) + "\n")
sys.stdout.flush()
if raise_:
@@ -345,12 +338,8 @@ def precheck(old_root):
def main():
global is_json_output
input = json.loads(sys.stdin.read())
if input.get("json"):
is_json_output = True
old_root = input.get("old_root", None)
if input.get("precheck"):