mirror of
https://github.com/truenas/scale-build.git
synced 2026-02-15 07:29:12 +00:00
Merge pull request #594 from truenas/NAS-127426
NAS-127426 / 24.10 / Use new installer
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -27,22 +27,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_:
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user