lol whoops

This commit is contained in:
brent s 2019-08-19 00:16:03 -04:00
parent 31826960c1
commit 3848a0bf7e
2 changed files with 7 additions and 4 deletions

View File

@ -245,8 +245,11 @@ class BootSync(object):
return (None)
if not os.path.isfile(fpathname):
return(None)
if hashtype not in hashlib.algorithms_available:
raise ValueError('Hashtype {0} is not supported on this system'.format(hashtype))
hasher = getattr(hashlib, hashtype)
fpathname = os.path.abspath(os.path.expanduser(fpathname))
_hash = hashlib.sha512()
_hash = hasher()
with open(fpathname, 'rb') as fh:
_hash.update(fh.read())
return (_hash.hexdigest())

View File

@ -17,7 +17,7 @@ PREPARATION:

grub-install \
--boot-directory=/mnt/boot2 \
--bootloader-id=Arch \
--bootloader-id="Arch (Fallback)" \
--efi-directory=/mnt/boot2/ \
--target=x86_64-efi \
--no-nvram \
@ -34,7 +34,7 @@ PREPARATION:
#
# grub-install \
# --boot-directory=/mnt/boot2 \
# --bootloader-id="Arch (Fallback)" \
# --bootloader-id="Arch" \
# --efi-directory=/mnt/boot2/ \
# --target=x86_64-efi \
# --no-nvram \
@ -46,7 +46,7 @@ PREPARATION:
--create \
--disk /dev/sdd \
--part 1 \
--loader /EFI/Arch/grubx64.efi \
--loader /EFI/Arch (Fallback)/grubx64.efi \
--label "Arch (Fallback)"

efibootmgr \