From 114a069a9936fee56ce86a16ac5b844b425e63af Mon Sep 17 00:00:00 2001 From: Graham Forest Date: Wed, 28 Mar 2018 11:01:41 -0700 Subject: [PATCH] Create device dirs if they do not exist Some build environments (e.g. Google Cloud Container Builder docker images) don't have enough of a /dev filesystem to have /dev/disk/by-uuid/ by default. Make them if they don't exist. --- bootstrapvz/base/fs/partitions/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrapvz/base/fs/partitions/base.py b/bootstrapvz/base/fs/partitions/base.py index 76c8f3b..10b43fa 100644 --- a/bootstrapvz/base/fs/partitions/base.py +++ b/bootstrapvz/base/fs/partitions/base.py @@ -86,6 +86,7 @@ class BasePartition(AbstractPartition): # $GRUB_DEVICE_UUID when creating /boot/grub/grub.cfg self.disk_by_uuid_path = os.path.join('/dev/disk/by-uuid', self.get_uuid()) if not os.path.exists(self.disk_by_uuid_path): + os.makedirs(os.path.dirname(self.disk_by_uuid_path)) os.symlink(self.device_path, self.disk_by_uuid_path) def unlink_uuid(self):