2 # Copyright (C) 2018 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 from datetime
import datetime
26 def compress(filename
):
27 with
open(filename
, 'rb') as f_in
:
28 with gzip
.open('{}.gz'.format(filename
), 'wb') as f_out
:
29 shutil
.copyfileobj(f_in
, f_out
)
59 'libtap-harness-archive-perl',
83 parser
= argparse
.ArgumentParser(description
='Generate lava lttng rootfs')
84 parser
.add_argument("--arch", default
='amd64')
85 parser
.add_argument("--distribution", default
='bionic')
86 parser
.add_argument("--mirror", default
='http://archive.ubuntu.com/ubuntu')
88 "--component", default
='universe,multiverse,main,restricted')
89 args
= parser
.parse_args()
91 name
= "rootfs_{}_{}_{}.tar".format(args
.arch
, args
.distribution
,
92 datetime
.now().strftime("%Y-%m-%d"))
94 hostname
= "linaro-server"
95 user
= "linaro/linaro"
96 root_password
= "root"
101 "--arch={}".format(args
.arch
),
102 "--distribution={}".format(args
.distribution
),
103 "--mirror={}".format(args
.mirror
),
104 "--debootstrapopts=components={}".format(args
.component
),
105 "--tarball={}".format(name
),
106 "--package={}".format(",".join(packages
)),
107 "--hostname={}".format(hostname
),
108 "--user={}".format(user
),
109 "--root-password={}".format(root_password
),
115 completed_command
= subprocess
.run(command
, check
=True)
120 if __name__
== "__main__":
This page took 0.033654 seconds and 4 git commands to generate.