mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
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.
This commit is contained in:
parent
a9efdb4bf9
commit
114a069a99
1 changed files with 1 additions and 0 deletions
|
@ -86,6 +86,7 @@ class BasePartition(AbstractPartition):
|
||||||
# $GRUB_DEVICE_UUID when creating /boot/grub/grub.cfg
|
# $GRUB_DEVICE_UUID when creating /boot/grub/grub.cfg
|
||||||
self.disk_by_uuid_path = os.path.join('/dev/disk/by-uuid', self.get_uuid())
|
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):
|
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)
|
os.symlink(self.device_path, self.disk_by_uuid_path)
|
||||||
|
|
||||||
def unlink_uuid(self):
|
def unlink_uuid(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue