diff --git a/conf/build.manifest b/conf/build.manifest index 53aedef..d7134ee 100644 --- a/conf/build.manifest +++ b/conf/build.manifest @@ -312,17 +312,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 diff --git a/conf/cd-files/root/.bash_profile b/conf/cd-files/root/.bash_profile index 7b7ae2f..280187a 100755 --- a/conf/cd-files/root/.bash_profile +++ b/conf/cd-files/root/.bash_profile @@ -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 diff --git a/truenas_install/__main__.py b/truenas_install/__main__.py index 692c989..8c03e76 100644 --- a/truenas_install/__main__.py +++ b/truenas_install/__main__.py @@ -27,22 +27,15 @@ RE_UNSQUASHFS_PROGRESS = re.compile(r"\[.+]\s+(?P[0-9]+)/(?P[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_: @@ -242,12 +235,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 IS_FREEBSD: