From b0bc5e1a3ae30e05981b3c57583219d2e0f6e067 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Sun, 1 Nov 2015 17:47:28 +0100 Subject: [PATCH] Use grub-probe instead of blkid on freebsd grub-probe can identify the ufsid to use --- vmdebootstrap | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 -- 2.39.5