Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
slapos.toolbox
Commits
63f0bf8e
Commit
63f0bf8e
authored
Oct 11, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed hard tabs
parent
331216b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
slapos/builder/__init__.py
slapos/builder/__init__.py
+21
-21
No files found.
slapos/builder/__init__.py
View file @
63f0bf8e
...
...
@@ -152,19 +152,19 @@ def run(config):
fdisk_output_path
=
"/tmp/a_generated_file"
try
:
if
not
config
.
virtual
:
offset
=
0
fdisk_output_file
=
open
(
fdisk_output_path
,
'w'
)
_call
([
'sfdisk'
,
'-d'
,
'-uS'
,
config
.
system_path
],
stdout
=
fdisk_output_file
)
fdisk_output_file
.
close
()
fdisk_output_file
=
open
(
fdisk_output_path
,
'r'
)
for
line
in
fdisk_output_file
:
line
=
line
.
rstrip
().
replace
(
' '
,
''
)
if
line
.
endswith
(
"bootable"
):
offset
=
int
(
line
.
split
(
':'
)[
1
].
split
(
','
)[
0
].
split
(
'='
)[
1
])
fdisk_output_file
.
close
()
offset
=
offset
*
512
_call
([
'mount'
,
'-o'
,
'loop,offset=%i'
%
offset
,
config
.
system_path
,
mount_dir_path
],
dry_run
=
dry_run
)
offset
=
0
fdisk_output_file
=
open
(
fdisk_output_path
,
'w'
)
_call
([
'sfdisk'
,
'-d'
,
'-uS'
,
config
.
system_path
],
stdout
=
fdisk_output_file
)
fdisk_output_file
.
close
()
fdisk_output_file
=
open
(
fdisk_output_path
,
'r'
)
for
line
in
fdisk_output_file
:
line
=
line
.
rstrip
().
replace
(
' '
,
''
)
if
line
.
endswith
(
"bootable"
):
offset
=
int
(
line
.
split
(
':'
)[
1
].
split
(
','
)[
0
].
split
(
'='
)[
1
])
fdisk_output_file
.
close
()
offset
=
offset
*
512
_call
([
'mount'
,
'-o'
,
'loop,offset=%i'
%
offset
,
config
.
system_path
,
mount_dir_path
],
dry_run
=
dry_run
)
# Call vmware-mount to mount Virtual disk image
else
:
print
"Mount Virtual Image"
...
...
@@ -302,16 +302,16 @@ def run(config):
# Adding slapos_firstboot in case of MultiDisk usage
if
not
config
.
one_disk
:
for
script
in
[
'slapos_firstboot'
]:
path
=
os
.
path
.
join
(
mount_dir_path
,
'etc'
,
'init.d'
,
script
)
print
"Creating %r"
%
path
if
not
dry_run
:
open
(
path
,
'w'
).
write
(
pkg_resources
.
resource_stream
(
__name__
,
'script/%s'
%
script
).
read
())
os
.
chmod
(
path
,
0755
)
for
script
in
[
'slapos_firstboot'
]:
path
=
os
.
path
.
join
(
mount_dir_path
,
'etc'
,
'init.d'
,
script
)
print
"Creating %r"
%
path
if
not
dry_run
:
open
(
path
,
'w'
).
write
(
pkg_resources
.
resource_stream
(
__name__
,
'script/%s'
%
script
).
read
())
os
.
chmod
(
path
,
0755
)
else
:
for
script
in
[
'slapos_firstboot'
]:
path
=
os
.
path
.
join
(
mount_dir_path
,
'etc'
,
'init.d'
,
script
)
path
=
os
.
path
.
join
(
mount_dir_path
,
'etc'
,
'init.d'
,
script
)
if
os
.
path
.
exists
(
path
):
print
"Removing %r"
%
path
os
.
remove
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment