From: Christoph Egger Date: Sun, 1 Nov 2015 16:47:28 +0000 (+0100) Subject: Use grub-probe instead of blkid on freebsd X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=b0bc5e1a3ae30e05981b3c57583219d2e0f6e067;p=forks%2Fvmdebootstrap.git Use grub-probe instead of blkid on freebsd grub-probe can identify the ufsid to use --- diff --git a/vmdebootstrap b/vmdebootstrap index f5041cd..d166485 100755 --- a/vmdebootstrap +++ b/vmdebootstrap @@ -700,17 +700,21 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth 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