Skip to content

Commit

Permalink
Handle netboot in migrate.py
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Jul 10, 2017
1 parent 9ee3de3 commit a465823
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions userspace/py/bin/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
args[key] = value
if 'root' in args:
print("Original root is:", args['root'])
elif 'init' in args and args['init'] == '/dev/ram0':
print("Init is ram0, so this is probably a netboot image, going to assume root is /tmp/netboot.img")
args['root'] = '/tmp/netboot.img'
else:
print("Don't know what root is, bailing.")
sys.exit(1)
Expand Down Expand Up @@ -59,6 +62,8 @@
root,_ = root.split(',',1)
with open(root,'r') as f:
fcntl.ioctl(f, 0x4001)
if '/tmp/' in root:
os.remove(root)

if start == '--single':
os.execv('/bin/compositor',['compositor','--','/bin/terminal','-Fl'])
Expand Down

0 comments on commit a465823

Please sign in to comment.