Integrate geli into autoconfiguration system
This commit is contained in:
parent
d7bdab32b8
commit
20a409405b
13 changed files with 835 additions and 682 deletions
|
@ -309,10 +309,8 @@ fstest (int n, char **args)
|
|||
char *argv[2] = { "-a", NULL};
|
||||
if (mount_crypt)
|
||||
{
|
||||
if (execute_command ("luksmount", 1, argv))
|
||||
grub_util_error (_("luksmount command fails: %s"), grub_errmsg);
|
||||
if (execute_command ("gelimount", 1, argv))
|
||||
grub_util_error (_("gelimount command fails: %s"), grub_errmsg);
|
||||
if (execute_command ("cryptomount", 1, argv))
|
||||
grub_util_error (_("cryptomount command fails: %s"), grub_errmsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -538,9 +538,9 @@ if [ "x${devabstraction_module}" = "x" ] ; then
|
|||
|
||||
exit 1
|
||||
fi
|
||||
if [ x$GRUB_LUKS_ENABLE = xy ]; then
|
||||
for uuid in "`"${grub_probe}" --device "${device}" --target=luks_uuid`"; do
|
||||
echo "luksmount -u $uuid"
|
||||
if [ x$GRUB_CRYPTODISK_ENABLE = xy ]; then
|
||||
for uuid in "`"${grub_probe}" --device "${device}" --target=cryptodisk_uuid`"; do
|
||||
echo "cryptomount -u $uuid"
|
||||
done
|
||||
fi
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ export GRUB_DEFAULT \
|
|||
GRUB_DISABLE_OS_PROBER \
|
||||
GRUB_INIT_TUNE \
|
||||
GRUB_SAVEDEFAULT \
|
||||
GRUB_ENABLE_LUKS \
|
||||
GRUB_ENABLE_CRYPTODISK \
|
||||
GRUB_BADRAM
|
||||
|
||||
if test "x${grub_cfg}" != "x"; then
|
||||
|
|
|
@ -69,12 +69,12 @@ is_path_readable_by_grub ()
|
|||
return 1
|
||||
fi
|
||||
|
||||
if [ x$GRUB_LUKS_ENABLE = xy ]; then
|
||||
if [ x$GRUB_CRYPTODISK_ENABLE = xy ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
for abstraction in $abstractions; do
|
||||
if [ "x$abstraction" = xluks ]; then
|
||||
if [ "x$abstraction" = xcryptodisk ]; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
@ -138,9 +138,9 @@ prepare_grub_to_access_device ()
|
|||
echo "insmod ${module}"
|
||||
done
|
||||
|
||||
if [ x$GRUB_LUKS_ENABLE = xy ]; then
|
||||
for uuid in "`"${grub_probe}" --device "${device}" --target=luks_uuid`"; do
|
||||
echo "luksmount -u $uuid"
|
||||
if [ x$GRUB_CRYPTODISK_ENABLE = xy ]; then
|
||||
for uuid in "`"${grub_probe}" --device "${device}" --target=cryptodisk_uuid`"; do
|
||||
echo "cryptomount -u $uuid"
|
||||
done
|
||||
fi
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ enum {
|
|||
PRINT_DEVICE,
|
||||
PRINT_PARTMAP,
|
||||
PRINT_ABSTRACTION,
|
||||
PRINT_LUKS_UUID
|
||||
PRINT_CRYPTODISK_UUID
|
||||
};
|
||||
|
||||
int print = PRINT_FS;
|
||||
|
@ -91,7 +91,7 @@ probe_partmap (grub_disk_t disk)
|
|||
}
|
||||
|
||||
static void
|
||||
probe_luks_uuid (grub_disk_t disk)
|
||||
probe_cryptodisk_uuid (grub_disk_t disk)
|
||||
{
|
||||
grub_disk_memberlist_t list = NULL, tmp;
|
||||
|
||||
|
@ -102,14 +102,13 @@ probe_luks_uuid (grub_disk_t disk)
|
|||
}
|
||||
while (list)
|
||||
{
|
||||
probe_luks_uuid (list->disk);
|
||||
probe_cryptodisk_uuid (list->disk);
|
||||
tmp = list->next;
|
||||
free (list);
|
||||
list = tmp;
|
||||
}
|
||||
/* FIXME: support non-LUKS. */
|
||||
if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
|
||||
grub_util_luks_print_uuid (disk);
|
||||
grub_util_cryptodisk_print_uuid (disk);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -215,9 +214,9 @@ probe (const char *path, char *device_name)
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (print == PRINT_LUKS_UUID)
|
||||
if (print == PRINT_CRYPTODISK_UUID)
|
||||
{
|
||||
probe_luks_uuid (dev->disk);
|
||||
probe_cryptodisk_uuid (dev->disk);
|
||||
printf ("\n");
|
||||
goto end;
|
||||
}
|
||||
|
@ -295,8 +294,8 @@ Probe device information for a given path (or device, if the -d option is given)
|
|||
\n\
|
||||
-d, --device given argument is a system device, not a path\n\
|
||||
-m, --device-map=FILE use FILE as the device map [default=%s]\n\
|
||||
-t, --target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction|luks_uuid)\n\
|
||||
print filesystem module, GRUB drive, system device, partition map module, abstraction module or LUKS UUID [default=fs]\n\
|
||||
-t, --target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction|cryptodisk_uuid)\n\
|
||||
print filesystem module, GRUB drive, system device, partition map module, abstraction module or CRYPTO UUID [default=fs]\n\
|
||||
-h, --help display this message and exit\n\
|
||||
-V, --version print version information and exit\n\
|
||||
-v, --verbose print verbose messages\n\
|
||||
|
@ -354,8 +353,8 @@ main (int argc, char *argv[])
|
|||
print = PRINT_PARTMAP;
|
||||
else if (!strcmp (optarg, "abstraction"))
|
||||
print = PRINT_ABSTRACTION;
|
||||
else if (!strcmp (optarg, "luks_uuid"))
|
||||
print = PRINT_LUKS_UUID;
|
||||
else if (!strcmp (optarg, "cryptodisk_uuid"))
|
||||
print = PRINT_CRYPTODISK_UUID;
|
||||
else
|
||||
usage (1);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue