From 2ca0dcd9ce42722f1428daba9bd574ebbc97d0e2 Mon Sep 17 00:00:00 2001 From: Donald Burr Date: Sat, 21 Feb 2015 17:57:37 -0800 Subject: [PATCH] Add experimental automated raspbian installer generator --- auto_raspbian/auto_raspbian | 26 ++++++++++++++++++++++++++ auto_raspbian/new_test.json | 1 + auto_raspbian/test.json | 14 ++++++++++++++ 3 files changed, 41 insertions(+) create mode 100755 auto_raspbian/auto_raspbian create mode 100644 auto_raspbian/new_test.json create mode 100755 auto_raspbian/test.json diff --git a/auto_raspbian/auto_raspbian b/auto_raspbian/auto_raspbian new file mode 100755 index 0000000..cda8649 --- /dev/null +++ b/auto_raspbian/auto_raspbian @@ -0,0 +1,26 @@ +#!/usr/bin/python +#http://raspberrypi.stackexchange.com/questions/15192/installing-raspbian-from-noobs-without-display +#also: https://github.com/shamiao/TRUNCATED-raspi-autoconfig + +import json + +f = open('test.json', 'r') +data = json.load(f) +new_dict = {} +the_stuff = [] + +if data["flavours"]: + print "found flavours" + flavours = data["flavours"] + for flavour in flavours: + print "found flavour [%s]" % flavour["name"] + if flavour["name"].lower() == "raspbian": + print "found raspbian" + the_stuff.append(flavour) + +new_dict["flavours"] = the_stuff + +print new_dict +outfile = open('new_test.json', 'w') +json.dump(new_dict, outfile) + diff --git a/auto_raspbian/new_test.json b/auto_raspbian/new_test.json new file mode 100644 index 0000000..e73783a --- /dev/null +++ b/auto_raspbian/new_test.json @@ -0,0 +1 @@ +{"flavours": [{"supported_hex_revisions": "2,3,4,5,6,7,8,9,d,e,f,10,11,12,14,1040,1041", "name": "Raspbian", "description": "A Debian wheezy port, optimised for the Raspberry Pi"}]} \ No newline at end of file diff --git a/auto_raspbian/test.json b/auto_raspbian/test.json new file mode 100755 index 0000000..7b9917d --- /dev/null +++ b/auto_raspbian/test.json @@ -0,0 +1,14 @@ +{ + "flavours": [ + { + "name": "Raspbian - Boot to Scratch", + "description": "A version of Raspbian that boots straight into Scratch", + "supported_hex_revisions": "2,3,4,5,6,7,8,9,d,e,f,10,11,12,14,1040,1041" + }, + { + "name": "Raspbian", + "description": "A Debian wheezy port, optimised for the Raspberry Pi", + "supported_hex_revisions": "2,3,4,5,6,7,8,9,d,e,f,10,11,12,14,1040,1041" + } + ] +}