From 46d862c98c50fdd4f974d0a105d92d09172f90b9 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Fri, 2 Mar 2018 15:34:47 +0800 Subject: [PATCH] Override OF properties more flexibly using Forth --- scripts/bootmake.py | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/scripts/bootmake.py b/scripts/bootmake.py index 507f7da..8beffba 100755 --- a/scripts/bootmake.py +++ b/scripts/bootmake.py @@ -17,14 +17,25 @@ COMPATIBLE = [ "MacRISC", # "MacRISC2", # "MacRISC3", + # "MacRISC4", ] # Changes to the Forth boot script, all off by default DELETE_MODEL_CHECK = False DELETE_CHECKSUM_CHECK = False -MAC_MINI_PRETEND_TO_BE_POWERBOOK = False G4_FIX = False +# *After* OF has loaded this file, set the "model" property? +SET_MODEL_PROPERTY = '' +# SET_MODEL_PROPERTY = 'PowerMac5,1' # Cube + +# ...and the "compatible" property? (empty strings not counted) +SET_COMPATIBLE_PROPERTY = [x for x in [ + # SET_MODEL_PROPERTY, + # *COMPATIBLE, + # 'Power Macintosh', +] if x] + # Adds code to set the AAPL,debug property early in the boot script DEBUG_PROPERTY = 0 # DEBUG_PROPERTY |= 0x00000001 # Print general informative messages. @@ -88,14 +99,23 @@ device-end \ END DEBUG_PROPERTY """ % DEBUG_PROPERTY -if MAC_MINI_PRETEND_TO_BE_POWERBOOK: BOOT_SCRIPT += """ -\ MAC_MINI_PRETEND_TO_BE_POWERBOOK +if SET_MODEL_PROPERTY: BOOT_SCRIPT += """ +\ SET_MODEL_PROPERTY dev / -" PowerBook4,3" encode-string " model" property -" PowerBook4,3" encode-string " MacRISC" encode-string encode+ " MacRiSC2" encode-string encode+ " MacRISC3" encode-string encode+ " Power Macintosh" encode-string encode+ " compatible" property +" %s" encode-string " model" property device-end -\ END MAC_MINI_PRETEND_TO_BE_POWERBOOK -""" +\ END SET_MODEL_PROPERTY +""" % SET_MODEL_PROPERTY + +if SET_COMPATIBLE_PROPERTY: + BOOT_SCRIPT += "\ SET_COMPATIBLE_PROPERTY\n" + BOOT_SCRIPT += "dev /\n" + BOOT_SCRIPT += '" %s" encode-string' % SET_COMPATIBLE_PROPERTY[0] + for x in SET_COMPATIBLE_PROPERTY[1:]: + BOOT_SCRIPT += ' " %s" encode-string encode+' % x + BOOT_SCRIPT += ' " compatible" property\n' + BOOT_SCRIPT += 'device-end\n' + BOOT_SCRIPT += '\ END SET_COMPATIBLE_PROPERTY\n' if G4_FIX: BOOT_SCRIPT += """ \ G4_FIX: