def create_fstab(self, rootdir, rootdev, roottype, bootdev, boottype): # pylint: disable=too-many-arguments
def fsuuid(device):
- out = self.runcmd(['blkid', '-c', '/dev/null', '-o', 'value',
- '-s', 'UUID', device])
- return out.splitlines()[0].strip()
+ if 'freebsd' in os.sys.platform:
+ out = self.runcmd(['grub-probe', '-d', device, '-t', 'fs_uuid'])
+ return "/dev/ufsid/%s" % out.strip()
+ else:
+ out = self.runcmd(['blkid', '-c', '/dev/null', '-o', 'value',
+ '-s', 'UUID', device])
+ return "UUID=%s" % out.splitlines()[0].strip()
if rootdev:
- rootdevstr = 'UUID=%s' % fsuuid(rootdev)
+ rootdevstr = fsuuid(rootdev)
else:
rootdevstr = '/dev/sda1'
if bootdev and not self.settings['use-uefi']:
- bootdevstr = 'UUID=%s' % fsuuid(bootdev)
+ bootdevstr = fsuuid(bootdev)
else:
bootdevstr = None