Skip to content

Commit

Permalink
Allow downstreams to brand the installer
Browse files Browse the repository at this point in the history
Add overrides for the distribution name and the docs URL so that
downstreams can brand the installer as needed in their bootstrap
script.

Signed-off-by: Davide Cavalca <dcavalca@fedoraproject.org>
  • Loading branch information
davide125 authored and marcan committed May 31, 2024
1 parent 0632029 commit c1013f1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ def step2_indirect(self, report=False):
p_plain( " * If you are asked to 'Select a volume to recover',")
p_plain( " then choose your normal macOS volume and click Next.")
p_plain( " You may need to authenticate yourself with your macOS credentials.")
p_message( "7. Once the 'Asahi Linux installer' screen appears, follow the prompts.")
p_message(f"7. Once the '{DISTRO} installer' screen appears, follow the prompts.")
print()
p_warning( "If you end up in a bootloop or get a message telling you that macOS needs to")
p_warning( "be reinstalled, that means you didn't follow the steps above properly.")
Expand Down Expand Up @@ -798,13 +798,13 @@ def action_select_disk(self):

def main(self):
print()
p_message("Welcome to the Asahi Linux installer!")
p_message(f"Welcome to the {DISTRO} installer!")
print()
p_message("This installer will guide you through the process of setting up")
p_message("Asahi Linux on your Mac.")
p_message(f"{DISTRO} on your Mac.")
print()
p_message("Please make sure you are familiar with our documentation at:")
p_plain( f" {col(BLUE, BRIGHT)}https://alx.sh/w{col()}")
p_plain( f" {col(BLUE, BRIGHT)}{DISTRO_DOCS}{col()}")
print()
p_question("Press enter to continue.")
self.input()
Expand Down
5 changes: 3 additions & 2 deletions src/step2/step2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

set -e

DISTRO="##DISTRO##"
VGID="##VGID##"
PREBOOT="##PREBOOT##"

Expand All @@ -15,7 +16,7 @@ os_name="${system_dir##*/}"
# clear
printf '\033[2J\033[H'

echo "Asahi Linux installer (second step)"
echo "$DISTRO installer (second step)"
echo
echo "VGID: $VGID"
echo "System volume: $system_dir"
Expand Down Expand Up @@ -88,7 +89,7 @@ fi

echo "You will see some messages advising you that you are changing the"
echo "security level of your system. These changes apply only to your"
echo "Asahi Linux install, and are necessary to install a third-party OS."
echo "$DISTRO install, and are necessary to install a third-party OS."
echo
echo "Apple Silicon platforms maintain a separate security level for each"
echo "installed OS, and are designed to retain their security with mixed OSes."
Expand Down
1 change: 1 addition & 0 deletions src/stub.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ def install_files(self, cur_os):

logging.info("Writing step2.sh")
step2_sh = open("step2/step2.sh").read()
step2_sh = step2_sh.replace("##DISTRO##", DISTRO)
step2_sh = step2_sh.replace("##VGID##", self.osi.vgid)
step2_sh = step2_sh.replace("##PREBOOT##", self.osi.preboot_vgid)
with open(self.step2_sh, "w") as fd:
Expand Down
3 changes: 3 additions & 0 deletions src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
COMPRESSION_LZFSE = 0x801
CHUNK_SIZE = 0x10000

DISTRO = os.environ.get("DISTRO", "Asahi Linux")
DISTRO_DOCS = os.environ.get("DISTRO_DOCS", "https://alx.sh/w")

def ssize(v):
suffixes = ["B", "KB", "MB", "GB", "TB"]
for i in suffixes:
Expand Down

0 comments on commit c1013f1

Please sign in to comment.