1
0
mirror of https://github.com/gryf/mkinitramfs.git synced 2026-01-07 17:24:12 +01:00

Make labeled usb drive/mmc card real optional.

Waiting for the devices, especially, when there are more than one/two o
them is annoying. Let's make a compromise for user to choose hes way for
providing password for key and/or use specific device holding a key.
This commit is contained in:
2022-05-31 19:55:16 +02:00
parent 0a3932676c
commit d2aa7c13c2
2 changed files with 12 additions and 3 deletions

View File

@@ -62,5 +62,13 @@ Usage
on ``/boot`` with appropriate links. Note, that old images (they have
``.old`` suffix in the filename) will be removed in that case.
Using key devices
-----------------
It is possible to use an SD card (if computer does have reader built-in) or old
plain USB pendrive. Currently support for the keys is limited to 4096 bytes,
and assumption that key is unencrypted - it helps with booting system
non-interactively.
.. _ccrypt: https://sourceforge.net/projects/ccrypt/
.. _cryptsetup: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md

View File

@@ -314,7 +314,7 @@ class Initramfs(object):
fobj.write(INIT_CMD)
if self._args.disk_label:
fobj.write(INIT_LABELED % {'label': self._args.disk_label})
else:
if self._args.sdcard:
fobj.write(INIT_SD)
fobj.write(INIT_OPEN)
os.chmod('init', 0b111101101)
@@ -429,8 +429,9 @@ def main():
parser.add_argument('-k', '--key-path', help='path to the location where '
'keys are stored', default=KEYS_PATH)
parser.add_argument('-d', '--disk-label', help='Provide disk label '
'instead of assumed first partition on hardcoded SD '
'card reader')
'to be read decritpion key from.')
parser.add_argument('-s', '--sdcard', help='Use built in sdcard reader to '
'read from (hopefully) inserted card')
parser.add_argument('-l', '--lvm', action='store_true',
help='Enable LVM in init.')
parser.add_argument('disk', choices=disks.keys(), help='Disk name')