Skip to content

Commit

Permalink
Major refactor into wlutil package. Testing now another command in
Browse files Browse the repository at this point in the history
sw_manager. sw_manager also now infers workload directory from config
and you can pass multiple configs to the build command.
  • Loading branch information
Nathan Pemberton committed Dec 17, 2018
1 parent b273be3 commit b732294
Show file tree
Hide file tree
Showing 55 changed files with 718 additions and 704 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.img
*-bin
*.swp
fedora/Fedora-Developer-Rawhide-20181015.n.0-sda.raw
fedora/Fedora-Developer-Rawhide-20181015.n.0-sda.raw.xz
fedora/rootfs.cpio
Expand Down
13 changes: 7 additions & 6 deletions br/br.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import subprocess as sp
import shutil
import logging
from util.util import *
import wlutil
# from wlutil import *

# Note: All argument paths are expected to be absolute paths

Expand Down Expand Up @@ -32,7 +33,7 @@ def buildBaseImage(self):
# Buildroot complains about some common PERL configurations
env = os.environ.copy()
env.pop('PERL_MM_OPT', None)
run(['make'], cwd=os.path.join(br_dir, "buildroot"), env=env)
wlutil.run(['make'], cwd=os.path.join(br_dir, "buildroot"), env=env)

# Return True if the base image is up to date, or False if it needs to be
# rebuilt.
Expand Down Expand Up @@ -61,13 +62,13 @@ def generateBootScriptOverlay(script):
# script at boot. We just overwrite this script.
scriptDst = os.path.join(overlay, 'firesim.sh')
if script != None:
run(['cp', script, scriptDst])
wlutil.run(['cp', script, scriptDst])
else:
run(['rm', scriptDst])
wlutil.run(['rm', scriptDst])
# Create a blank init script because overlays won't let us delete stuff
# Alternatively: we could consider replacing the default.target
# symlink to disable the firesim target entirely
run(['touch', scriptDst])
wlutil.run(['touch', scriptDst])

run(['chmod', '+x', scriptDst])
wlutil.run(['chmod', '+x', scriptDst])
return overlay
12 changes: 6 additions & 6 deletions fedora/fedora.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import subprocess as sp
import shutil
from util.util import *
import wlutil

# Some common directories for this module (all absolute paths)
fed_dir=os.path.dirname(os.path.realpath(__file__))
Expand All @@ -20,7 +20,7 @@ def baseConfig(self):
}

def buildBaseImage(self):
run(['make', "rootfs.img"], cwd=fed_dir)
wlutil.run(['make', "rootfs.img"], cwd=fed_dir)

# Return True if the base image is up to date, or False if it needs to be
# rebuilt.
Expand All @@ -39,14 +39,14 @@ def generateBootScriptOverlay(self, script):
# can change the default boot behavior by changing this script.
scriptDst = os.path.join(overlay, 'firesim.sh')
if script != None:
run(['cp', script, scriptDst])
wlutil.run(['cp', script, scriptDst])
else:
run(['rm', scriptDst])
wlutil.run(['rm', scriptDst])
# Create a blank init script because overlays won't let us delete stuff
# Alternatively: we could consider replacing the default.target
# symlink to disable the firesim target entirely
run(['touch', scriptDst])
wlutil.run(['touch', scriptDst])

# run(['sudo', 'chown', 'root:root', scriptDst])
run(['chmod', '+x', scriptDst])
wlutil.run(['chmod', '+x', scriptDst])
return overlay
Loading

0 comments on commit b732294

Please sign in to comment.