You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
livecd-rootfs/livecd.py

25 lines
507 B

#!/usr/bin/python
import os,sys
import atexit
class Mount:
def __init__(self):
atexit.register(self.cleanup,self)
self.mounts={}
self.losetupDev=None
def addMount(self,name):
self.mounts[name]=1
def losetup(self,name):
if self.losetupDev==None:
self.losetupDev=os.popen("losetup -f").read().strip()
os.system("losetup %s %s" % (self.losetupDev,name)
def unLosetup(self):
os.system("losetup -d %s"%self.losetupDev)
def cleanup(self):
# XXX - need to unmount stuff
pass