stip /dev/ since path is /dev/sdxN

This commit is contained in:
advaithm 2021-03-12 14:10:08 +05:30
parent 0a47dfe5d5
commit 72284e2b2a
No known key found for this signature in database
GPG Key ID: E557E45E6DAFFC0C
1 changed files with 1 additions and 1 deletions

View File

@ -365,7 +365,7 @@ class Installer():
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB'))
sys_command('/usr/bin/arch-chroot grub-mkconfig -o /boot/grub/grub.cfg')
else:
root_device = subprocess.check_output(f'basename "$(readlink -f "/sys/class/block/{self.partition.path}/..")',shell=True).decode().strip()
root_device = subprocess.check_output(f'basename "$(readlink -f "/sys/class/block/{self.partition.path.strip("/dev/")}/..")',shell=True).decode().strip()
if root_device == "block":
root_device = f"{self.partition.path}"
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} grub-install --target=--target=i386-pc /dev/{root_device}'))