summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrent s <r00t@square-r00t.net>2019-08-19 00:16:03 -0400
committerbrent s <r00t@square-r00t.net>2019-08-19 00:16:03 -0400
commit3848a0bf7e0f954ff25e651712da3dc6bf784717 (patch)
treec70b254e4bd8dcd1a1463c415ab2c36464c6149f
parent31826960c196ae215e24f0afca57bb51d99845bf (diff)
downloadOpTools-3848a0bf7e0f954ff25e651712da3dc6bf784717.tar.xz
lol whoops
-rwxr-xr-xsys/BootSync/bootsync.py5
-rw-r--r--sys/BootSync/prep.txt6
2 files changed, 7 insertions, 4 deletions
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 \