-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.py
82 lines (61 loc) · 2.27 KB
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 AndrewBCN Andre Derrick Balsa ([email protected])
#
# This file is licensed under the terms of the GNU General Public
# License version 3. This program is licensed "as is" without any
# warranty of any kind, whether express or implied.
#
# build.py - Build an Armbian image bootable on Aarch64 hardware
#
# This file is a part of the Armbian-NG project
# https://github.com/AndrewBCN/Armbian-NG
# check Armbian-NG as well as standard Armbian documentation for more info
import os
import sys
import subprocess
import time
import argparse
import ngsupportfunc # various functions used by main() below
ngversion = "0.05"
def main():
print("Welcome to Armbian-NG!")
# Start stopwatch
start = time.time()
# Parse command line
args = ngsupportfunc.parsecommandline(ngversion)
print(args.armbianbranch,args.configfile,args.distcc) # temporarily print command line arguments, for debugging
# Check the underlying architecture, must be Aarch64, if not, print message and exit
ngsupportfunc.checkarch()
# Install needed Python 3 packages
ngsupportfunc.installmodules()
# Check build host Linux distribution
ngsupportfunc.checklinuxdistro()
# Display Armbian-NG banner
ngsupportfunc.printbanner()
# Tell user we are getting started
ngsupportfunc.armbianngmsg('Armbian-NG started!')
# Git clone the selected armbian-build branch in /armbian-<branchname>
ngsupportfunc.armbianngmsg('Cloning armbian-build, '+ args.armbianbranch + ' branch, please wait...')
ngsupportfunc.clonearmbianbranch(args.armbianbranch)
# Make modules in lib visible
sys.path.append('./lib/')
# Get build options from user
options = ngsupportfunc.dialog(ngversion)
# import armbian-ng-functions
# check-requirements()
# build-kernel()
# build-u-boot()
# build-rootfs()
# build-boot()
# build-image()
# cleanup()
# Tell user we are done and stop stopwatch
ngsupportfunc.armbianngmsg('Armbian-NG done!')
end = time.time()
# Report build time in minutes
btime = round((end-start)/60)
ngsupportfunc.reportbuildtime(btime)
if __name__ == '__main__':
main()