mirror of
https://github.com/gryf/mkinitramfs.git
synced 2026-03-07 13:05:46 +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:
@@ -62,5 +62,13 @@ Usage
|
|||||||
on ``/boot`` with appropriate links. Note, that old images (they have
|
on ``/boot`` with appropriate links. Note, that old images (they have
|
||||||
``.old`` suffix in the filename) will be removed in that case.
|
``.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/
|
.. _ccrypt: https://sourceforge.net/projects/ccrypt/
|
||||||
.. _cryptsetup: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md
|
.. _cryptsetup: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ class Initramfs(object):
|
|||||||
fobj.write(INIT_CMD)
|
fobj.write(INIT_CMD)
|
||||||
if self._args.disk_label:
|
if self._args.disk_label:
|
||||||
fobj.write(INIT_LABELED % {'label': 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_SD)
|
||||||
fobj.write(INIT_OPEN)
|
fobj.write(INIT_OPEN)
|
||||||
os.chmod('init', 0b111101101)
|
os.chmod('init', 0b111101101)
|
||||||
@@ -429,8 +429,9 @@ def main():
|
|||||||
parser.add_argument('-k', '--key-path', help='path to the location where '
|
parser.add_argument('-k', '--key-path', help='path to the location where '
|
||||||
'keys are stored', default=KEYS_PATH)
|
'keys are stored', default=KEYS_PATH)
|
||||||
parser.add_argument('-d', '--disk-label', help='Provide disk label '
|
parser.add_argument('-d', '--disk-label', help='Provide disk label '
|
||||||
'instead of assumed first partition on hardcoded SD '
|
'to be read decritpion key from.')
|
||||||
'card reader')
|
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',
|
parser.add_argument('-l', '--lvm', action='store_true',
|
||||||
help='Enable LVM in init.')
|
help='Enable LVM in init.')
|
||||||
parser.add_argument('disk', choices=disks.keys(), help='Disk name')
|
parser.add_argument('disk', choices=disks.keys(), help='Disk name')
|
||||||
|
|||||||
Reference in New Issue
Block a user