Autosign: run blkid as user
This commit is contained in:
parent
0a15307e05
commit
4a3c393c24
2 changed files with 3 additions and 1 deletions
|
|
@ -328,6 +328,7 @@ class Autosign:
|
|||
linux_mount_subdir = 'mmgen_autosign'
|
||||
macOS_ramdisk_name = 'AutosignRamDisk'
|
||||
wallet_subdir = 'autosign'
|
||||
linux_blkid_cmd = '/sbin/blkid -s LABEL -o value'
|
||||
|
||||
cmds = ('setup', 'xmr_setup', 'sign', 'wait')
|
||||
|
||||
|
|
@ -758,7 +759,7 @@ class Autosign:
|
|||
if self.cfg.no_insert_check:
|
||||
return True
|
||||
if sys.platform == 'linux':
|
||||
cp = run('sudo blkid -s LABEL -o value'.split(), stdout=PIPE, text=True)
|
||||
cp = run(self.linux_blkid_cmd.split(), stdout=PIPE, text=True)
|
||||
if cp.returncode not in (0, 2):
|
||||
die(2, f'blkid exited with error code {cp.returncode}')
|
||||
return self.dev_label in cp.stdout.splitlines()
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class overlay_fake_Autosign:
|
|||
self.dev_label = 'MMGEN_TS_ONLINE' if self.cfg.online else 'MMGEN_TS_OFFLINE'
|
||||
self.mount_cmd = f'sudo mount LABEL={self.dev_label} {self.mountpoint}'
|
||||
self.umount_cmd = f'sudo umount {self.mountpoint}'
|
||||
self.linux_blkid_cmd = 'sudo blkid -s LABEL -o value'
|
||||
|
||||
Autosign.dev_label = 'MMGEN_TS_TX' # autosign_live only (Linux)
|
||||
Autosign.linux_mount_subdir = 'mmgen_ts_autosign'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue