...
This commit is contained in:
parent
9c538678bd
commit
d46b85489d
16
aifclient.py
16
aifclient.py
@ -439,9 +439,11 @@ class archInstall(object):
|
|||||||
if y == '%PART%':
|
if y == '%PART%':
|
||||||
mkformat[x] = d + str(p)
|
mkformat[x] = d + str(p)
|
||||||
cmds.append(mkformat)
|
cmds.append(mkformat)
|
||||||
|
# TODO: add non-gpt stuff here?
|
||||||
with open(os.devnull, 'w') as DEVNULL:
|
with open(os.devnull, 'w') as DEVNULL:
|
||||||
for p in cmds:
|
for p in cmds:
|
||||||
subprocess.call(p, stdout = DEVNULL, stderr = subprocess.STDOUT)
|
subprocess.call(p, stdout = DEVNULL, stderr = subprocess.STDOUT)
|
||||||
|
usermntidx = self.mount.keys()
|
||||||
|
|
||||||
def mounts(self):
|
def mounts(self):
|
||||||
mntorder = list(self.mount.keys())
|
mntorder = list(self.mount.keys())
|
||||||
@ -503,12 +505,14 @@ class archInstall(object):
|
|||||||
if '/tmp' in mountlist.keys():
|
if '/tmp' in mountlist.keys():
|
||||||
if (chrootdir + '/tmp') not in mountlist.keys():
|
if (chrootdir + '/tmp') not in mountlist.keys():
|
||||||
cmounts['tmp'] = ['/bin/mount', '-t', 'tmpfs', '-o', 'mode=1777,strictatime,nodev,nosuid', 'tmp', chrootdir + '/tmp']
|
cmounts['tmp'] = ['/bin/mount', '-t', 'tmpfs', '-o', 'mode=1777,strictatime,nodev,nosuid', 'tmp', chrootdir + '/tmp']
|
||||||
# Because the order of these mountpoints is so ridiculously important, we hardcode it. Yeah, python 3.6 has ordered dicts, but do we really want to risk it?
|
# Because the order of these mountpoints is so ridiculously important, we hardcode it.
|
||||||
|
# Yeah, python 3.6 has ordered dicts, but do we really want to risk it?
|
||||||
with open(os.devnull, 'w') as DEVNULL:
|
with open(os.devnull, 'w') as DEVNULL:
|
||||||
for m in ('chroot', 'resolv', 'proc', 'sys', 'efi', 'dev', 'pts', 'shm', 'run', 'tmp'):
|
for m in ('chroot', 'resolv', 'proc', 'sys', 'efi', 'dev', 'pts', 'shm', 'run', 'tmp'):
|
||||||
if cmounts[m]:
|
if cmounts[m]:
|
||||||
subprocess.call(cmounts[m], stdout = DEVNULL, stderr = subprocess.STDOUT)
|
subprocess.call(cmounts[m], stdout = DEVNULL, stderr = subprocess.STDOUT)
|
||||||
# Okay. So we finally have all the mounts bound. Whew.
|
# Okay. So we finally have all the mounts bound. Whew.
|
||||||
|
return()
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
# TODO: could we leverage https://github.com/hartwork/image-bootstrap somehow? I want to keep this close
|
# TODO: could we leverage https://github.com/hartwork/image-bootstrap somehow? I want to keep this close
|
||||||
@ -766,9 +770,9 @@ class archInstall(object):
|
|||||||
# We want to run these right away.
|
# We want to run these right away.
|
||||||
with open(os.devnull, 'w') as DEVNULL:
|
with open(os.devnull, 'w') as DEVNULL:
|
||||||
for i, s in enumerate(self.scripts['pre']):
|
for i, s in enumerate(self.scripts['pre']):
|
||||||
subprocess.call('/root/scripts/post/{0}'.format(i),
|
subprocess.call('/root/scripts/pre/{0}'.format(i),
|
||||||
stdout = DEVNULL,
|
stdout = DEVNULL,
|
||||||
stderr = subproces.STDOUT)
|
stderr = subprocess.STDOUT)
|
||||||
return()
|
return()
|
||||||
|
|
||||||
def packagecmds(self):
|
def packagecmds(self):
|
||||||
@ -816,9 +820,9 @@ def runInstall(confdict):
|
|||||||
install.scriptcmds('pre')
|
install.scriptcmds('pre')
|
||||||
install.format()
|
install.format()
|
||||||
install.mounts()
|
install.mounts()
|
||||||
install.bootloader()
|
install.chroot()
|
||||||
#install.chroot()
|
install.scriptcmds('post')
|
||||||
#install.unmount()
|
install.unmount()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if os.getuid() != 0:
|
if os.getuid() != 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user