diff --git a/sys/BootSync/bootsync.py b/sys/BootSync/bootsync.py index 62d1e00..e01b197 100755 --- a/sys/BootSync/bootsync.py +++ b/sys/BootSync/bootsync.py @@ -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()) diff --git a/sys/BootSync/prep.txt b/sys/BootSync/prep.txt index e68cdbe..a1b7f4d 100644 --- a/sys/BootSync/prep.txt +++ b/sys/BootSync/prep.txt @@ -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 \