Add experimental automated raspbian installer generator
This commit is contained in:
parent
5be24bcc8d
commit
2ca0dcd9ce
3 changed files with 41 additions and 0 deletions
26
auto_raspbian/auto_raspbian
Executable file
26
auto_raspbian/auto_raspbian
Executable file
|
@ -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)
|
||||
|
1
auto_raspbian/new_test.json
Normal file
1
auto_raspbian/new_test.json
Normal file
|
@ -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"}]}
|
14
auto_raspbian/test.json
Executable file
14
auto_raspbian/test.json
Executable file
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue