From 372905218fb73c0de5eb6903aad5d2e0299c624a Mon Sep 17 00:00:00 2001 From: sickcodes Date: Wed, 24 Feb 2021 05:29:17 +0000 Subject: [PATCH] Add zip, fix global variables in the serial generator. --- Dockerfile | 2 +- custom/generate-unique-machine-values.sh | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8445ecb..c4c0dd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -91,7 +91,7 @@ RUN if [[ "${RANKMIRRORS}" ]]; then \ # RUN tee -a /etc/pacman.conf <<< '[community-testing]' \ # && tee -a /etc/pacman.conf <<< 'Include = /etc/pacman.d/mirrorlist' -RUN pacman -Syu git vim nano alsa-utils openssh --noconfirm \ +RUN pacman -Syu git zip vim nano alsa-utils openssh --noconfirm \ && ln -s /bin/vim /bin/vi \ && useradd arch -p arch \ && tee -a /etc/sudoers <<< 'arch ALL=(ALL) NOPASSWD: ALL' \ diff --git a/custom/generate-unique-machine-values.sh b/custom/generate-unique-machine-values.sh index e87905c..c97db87 100755 --- a/custom/generate-unique-machine-values.sh +++ b/custom/generate-unique-machine-values.sh @@ -93,17 +93,17 @@ done build_mac_serial () { - MACINFOPKG_VERSION="${MACINFOPKG_VERSION:=2.1.2}" + export MACINFOPKG_VERSION="${MACINFOPKG_VERSION:=2.1.2}" wget -O "${TARBALL:=./MacInfoPkg.tar.gz}" \ - "https://github.com/acidanthera/MacInfoPkg/archive/${MACINFOPKG_VERSION:=2.1.2}.tar.gz" + "https://github.com/acidanthera/MacInfoPkg/archive/${MACINFOPKG_VERSION}.tar.gz" tar -xzvf "${TARBALL}" cd "./MacInfoPkg-${MACINFOPKG_VERSION}/macserial" \ - && ./build.tool 2>/dev/null \ + && ./build.tool \ && cd - mv "./MacInfoPkg-${MACINFOPKG_VERSION}/macserial/bin/macserial" . rm -f "${TARBALL}" rm -rf "./MacInfoPkg-${MACINFOPKG_VERSION}/" - chmod +x macserial + chmod +x ./macserial stat ./macserial } @@ -156,10 +156,13 @@ EOF main () { # setting default variables if there are no options + export DEVICE_MODEL="${DEVICE_MODEL:=iMacPro1,1}" + export SERIAL_SET_COUNT="${SERIAL_SET_COUNT:=1}" + export OUTPUT_DIRECTORY="${OUTPUT_DIRECTORY:=.}" cat <