Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
799730ed
Commit
799730ed
authored
12 years ago
by
Avi Kivity
Browse files
Options
Downloads
Patches
Plain Diff
Add script for creating boot filesystem
parent
c02ce240
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/mkbootfs.py
+66
-0
66 additions, 0 deletions
scripts/mkbootfs.py
with
66 additions
and
0 deletions
scripts/mkbootfs.py
0 → 100755
+
66
−
0
View file @
799730ed
#!/usr/bin/python
import
os
,
sys
,
struct
,
optparse
,
StringIO
,
ConfigParser
make_option
=
optparse
.
make_option
defines
=
{}
def
add_var
(
option
,
opt
,
value
,
parser
):
var
,
val
=
value
.
split
(
'
=
'
)
defines
[
var
]
=
val
opt
=
optparse
.
OptionParser
(
option_list
=
[
make_option
(
'
-o
'
,
dest
=
'
output
'
,
help
=
'
write to FILE
'
,
metavar
=
'
FILE
'
),
make_option
(
'
-d
'
,
dest
=
'
depends
'
,
help
=
'
write dependencies to FILE
'
,
metavar
=
'
FILE
'
,
default
=
None
),
make_option
(
'
-m
'
,
dest
=
'
manifest
'
,
help
=
'
read manifest from FILE
'
,
metavar
=
'
FILE
'
),
make_option
(
'
-D
'
,
type
=
'
string
'
,
help
=
'
define VAR=DATA
'
,
metavar
=
'
VAR=DATA
'
,
action
=
'
callback
'
,
callback
=
add_var
),
])
(
options
,
args
)
=
opt
.
parse_args
()
metadata_size
=
128
depends
=
StringIO
.
StringIO
()
if
options
.
depends
:
depends
=
file
(
options
.
depends
,
'
w
'
)
out
=
file
(
options
.
output
,
'
w
'
)
print
defines
manifest
=
ConfigParser
.
SafeConfigParser
()
manifest
.
read
(
options
.
manifest
)
depends
.
write
(
'
%s:
\\\n
'
%
(
options
.
output
,))
files
=
dict
([(
f
,
manifest
.
get
(
'
manifest
'
,
f
,
vars
=
defines
))
for
f
in
manifest
.
options
(
'
manifest
'
)])
pos
=
(
len
(
files
)
+
1
)
*
metadata_size
for
name
,
hostname
in
files
.
items
():
size
=
os
.
stat
(
hostname
).
st_size
metadata
=
struct
.
pack
(
'
QQ112s
'
,
size
,
pos
,
name
)
out
.
write
(
metadata
)
pos
+=
size
depends
.
write
(
'
\t
%s
\\\n
'
%
(
hostname
,))
out
.
write
(
struct
.
pack
(
'
128s
'
,
''
))
for
name
,
hostname
in
files
.
items
():
out
.
write
(
file
(
hostname
).
read
())
depends
.
write
(
'
\n\n
'
)
out
.
close
()
depends
.
close
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment