Module Name: src Committed By: rin Date: Thu Sep 20 12:27:42 UTC 2018
Modified Files: src/usr.sbin/sysinst: Makefile.inc defs.h install.c main.c menus.mi Added Files: src/usr.sbin/sysinst: menus.pm Log Message: Add NOPARTMAN compile-time option, which drops extended partitioning support provided by partman.c. It reduces, e.g., about 30KB for crunched binary in atari install floppy. OK christos To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sysinst/Makefile.inc cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sysinst/defs.h cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/install.c cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/main.c cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sysinst/menus.mi cvs rdiff -u -r0 -r1.1 src/usr.sbin/sysinst/menus.pm Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/sysinst/Makefile.inc diff -u src/usr.sbin/sysinst/Makefile.inc:1.12 src/usr.sbin/sysinst/Makefile.inc:1.13 --- src/usr.sbin/sysinst/Makefile.inc:1.12 Sun Sep 16 09:15:12 2018 +++ src/usr.sbin/sysinst/Makefile.inc Thu Sep 20 12:27:42 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.12 2018/09/16 09:15:12 martin Exp $ +# $NetBSD: Makefile.inc,v 1.13 2018/09/20 12:27:42 rin Exp $ # # Makefile for sysinst @@ -13,18 +13,22 @@ WARNS= 4 SRCS+= menu_defs.c msg_defs.c main.c install.c upgrade.c \ txtwalk.c run.c factor.c net.c disks.c disks_lfs.c util.c geom.c \ - label.c target.c md.c sizemultname.c configmenu.c checkrc.c partman.c + label.c target.c md.c sizemultname.c configmenu.c checkrc.c SRCS+= ${MD_OPTIONS:MAOUT2ELF:S/AOUT2ELF/aout2elf.c/} SRCS+= ${MENUS_MD:Mmenus.mbr:S/menus.mbr/mbr.c/} SRCS+= ${CPPFLAGS:M-DWSKBD:S/-DWSKBD/wskbd.c/} SRCS+= ${NODISKLABEL:D:Ubsddisklabel.c savenewlabel.c} +SRCS+= ${NOPARTMAN:D:Upartman.c} DPSRCS+= defs.h SYSINSTLANG?= en LANGUAGES?= de en es fr pl +MENUS_MI= menus.mi +MENUS_MI+= ${NOPARTMAN:D:Umenus.pm} + MSG_MD?= msg.md.${SYSINSTLANG} MENUS_MD?= menus.md.${SYSINSTLANG} @@ -48,7 +52,8 @@ CATALOGDIR= /usr/share/sysinst/catalog CPPFLAGS+= -I. -I${.CURDIR}/../.. -I${.CURDIR} \ -DREL=\"${DISTRIBVER}\" -DMACH=\"${MACHINE}\" \ -DMACH_${MACHINE} -DARCH_${MACHINE_ARCH} \ - ${NODISKLABEL:D-DNO_DISKLABEL} + ${NODISKLABEL:D-DNO_DISKLABEL} \ + ${NOPARTMAN:D-DNO_PARTMAN} .if defined(NETBSD_OFFICIAL_RELEASE) && ${NETBSD_OFFICIAL_RELEASE} == "yes" CPPFLAGS+= -DSYSINST_FTP_HOST=\"ftp.NetBSD.org\" -DNETBSD_OFFICIAL_RELEASE @@ -168,7 +173,7 @@ msg.def: msg.mi.${SYSINSTLANG} ${MSG_MD} ${TOOL_SED} "s/@@MACHINE@@/${MACHINE}/" | \ ${TOOL_AWK} -f ${UNIF_AWK} -v defines="${MD_OPTIONS}" > ${.TARGET} -menus.def: menus.mi ${MENUS_MD} msgtouch +menus.def: ${MENUS_MI} ${MENUS_MD} msgtouch ${_MKTARGET_CREATE} ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" ${.ALLSRC} | \ ${TOOL_SED} "s/@@MACHINE@@/${MACHINE}/" | \ Index: src/usr.sbin/sysinst/defs.h diff -u src/usr.sbin/sysinst/defs.h:1.18 src/usr.sbin/sysinst/defs.h:1.19 --- src/usr.sbin/sysinst/defs.h:1.18 Sun Sep 16 09:15:12 2018 +++ src/usr.sbin/sysinst/defs.h Thu Sep 20 12:27:42 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.18 2018/09/16 09:15:12 martin Exp $ */ +/* $NetBSD: defs.h,v 1.19 2018/09/20 12:27:42 rin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -613,9 +613,16 @@ void unwind_mounts(void); int target_mounted(void); /* from partman.c */ +#ifndef NO_PARTMAN int partman(void); -int pm_partusage(pm_devs_t *, int, int); int pm_getrefdev(pm_devs_t *); +void update_wedges(const char *); +#else +static inline int partman(void) { return -1; } +static inline int pm_getrefdev(pm_devs_t *x __unused) { return -1; } +#define update_wedges(x) __nothing +#endif +int pm_partusage(pm_devs_t *, int, int); void pm_setfstype(pm_devs_t *, int, int); int pm_editpart(int); void pm_rename(pm_devs_t *); @@ -626,13 +633,16 @@ int pm_cgd_edit(void *, part_entry_t *); int pm_gpt_convert(pm_devs_t *); void pm_wedges_fill(pm_devs_t *); void pm_make_bsd_partitions(pm_devs_t *); -void update_wedges(const char *); /* flags whether to offer the respective options (depending on helper programs available on install media */ int have_raid, have_vnd, have_cgd, have_lvm, have_gpt, have_dk; /* initialize above variables */ +#ifndef NO_PARTMAN void check_available_binaries(void); +#else +#define check_available_binaries() __nothing +#endif /* from bsddisklabel.c */ int make_bsd_partitions(void); Index: src/usr.sbin/sysinst/install.c diff -u src/usr.sbin/sysinst/install.c:1.4 src/usr.sbin/sysinst/install.c:1.5 --- src/usr.sbin/sysinst/install.c:1.4 Sun May 10 10:14:02 2015 +++ src/usr.sbin/sysinst/install.c Thu Sep 20 12:27:42 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: install.c,v 1.4 2015/05/10 10:14:02 martin Exp $ */ +/* $NetBSD: install.c,v 1.5 2018/09/20 12:27:42 rin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -47,7 +47,11 @@ do_install(void) { int find_disks_ret; int retcode = 0; +#ifndef NO_PARTMAN partman_go = -1; +#else + partman_go = 0; +#endif #ifndef DEBUG msg_display(MSG_installusure); Index: src/usr.sbin/sysinst/main.c diff -u src/usr.sbin/sysinst/main.c:1.9 src/usr.sbin/sysinst/main.c:1.10 --- src/usr.sbin/sysinst/main.c:1.9 Wed Sep 12 13:44:05 2018 +++ src/usr.sbin/sysinst/main.c Thu Sep 20 12:27:42 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.9 2018/09/12 13:44:05 martin Exp $ */ +/* $NetBSD: main.c,v 1.10 2018/09/20 12:27:42 rin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -179,7 +179,11 @@ main(int argc, char **argv) } /* argv processing */ - while ((ch = getopt(argc, argv, "Dr:f:C:p")) != -1) + while ((ch = getopt(argc, argv, "Dr:f:C:" +#ifndef NO_PARTMAN + "p" +#endif + )) != -1) switch(ch) { case 'D': /* set to get past certain errors in testing */ debug = 1; @@ -196,10 +200,12 @@ main(int argc, char **argv) /* Define colors */ sscanf(optarg, "%u:%u", &clr_arg.bg, &clr_arg.fg); break; +#ifndef NO_PARTMAN case 'p': /* Partition tool */ partman_go = 1; break; +#endif case '?': default: usage(); Index: src/usr.sbin/sysinst/menus.mi diff -u src/usr.sbin/sysinst/menus.mi:1.14 src/usr.sbin/sysinst/menus.mi:1.15 --- src/usr.sbin/sysinst/menus.mi:1.14 Tue Sep 11 08:05:18 2018 +++ src/usr.sbin/sysinst/menus.mi Thu Sep 20 12:27:42 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: menus.mi,v 1.14 2018/09/11 08:05:18 martin Exp $ */ +/* $NetBSD: menus.mi,v 1.15 2018/09/20 12:27:42 rin Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -84,6 +84,7 @@ remove_sub_menu(int menuID) } } +#ifndef NO_PARTMAN static void remove_menu_option(int menuID, const char *option) { @@ -101,6 +102,7 @@ remove_menu_option(int menuID, const cha } } } +#endif void remove_color_options() @@ -113,6 +115,7 @@ remove_color_options() remove_sub_menu(MENU_colors); } +#ifndef NO_PARTMAN void remove_raid_options() { @@ -152,6 +155,7 @@ remove_cgd_options() remove_menu_option(MENU_pmdiskentry, MSG_encrypt); remove_menu_option(MENU_pmpartentry, MSG_encrypt); } +#endif } @@ -271,7 +275,13 @@ menu utility, title MSG_NetBSD_VERSION_U network_up = 0; config_network(); }; - option MSG_Partition_a_disk, action { partman_go = 1; partman(); }; + option MSG_Partition_a_disk, + action { +#ifndef NO_PARTMAN + partman_go = 1; + partman(); +#endif + }; option MSG_Logging_functions, action { do_logging(); }; option MSG_Color_scheme, sub menu colors; option MSG_Halt_the_system, exit, @@ -622,138 +632,3 @@ menu usersh, title MSG_User_shell, no cl option "/bin/sh", exit, action { ushell = "/bin/sh";}; option "/bin/ksh", exit, action { ushell = "/bin/ksh";}; option "/bin/csh", exit, action { ushell = "/bin/csh";}; - - -menu pmdiskentry, x=50, y=5, exit, default exit; - option MSG_editbsdpart, exit, action { pm_make_bsd_partitions(pm); }; - option MSG_editmbr, exit, action { md_get_info(); - md_pre_disklabel(); - memset(&pm->bsdlabel, 0, sizeof pm->bsdlabel);}; - option MSG_switchgpt, exit, action { if (pm_gpt_convert(pm) == 0) - pm_partusage(pm, -1, 1); }; - option MSG_renamedisk, exit, action { pm->unsaved = 1; pm_rename(pm); }; - option MSG_fmtasraid, exit, action { pm->unsaved = 1; - pm_partusage(pm, -1, 1); - layoutkind = LY_NEWRAID; - md_make_bsd_partitions();}; - option MSG_fmtaslvm, exit, action { pm->unsaved = 1; - pm_partusage(pm, -1, 1); - layoutkind = LY_NEWLVM; - md_make_bsd_partitions(); }; - option MSG_encrypt, exit, action { pm->unsaved = 1; - pm_partusage(pm, -1, 1); - layoutkind = LY_NEWCGD; - md_make_bsd_partitions(); - pm_cgd_edit(0, &(part_entry_t) - {.dev_ptr = pm, .dev_num = PART_E} - ); }; - option MSG_setbootable, exit, action { pm->unsaved = 1; - pm->bootable = !pm->bootable; }; - option MSG_erase, next menu shred_modes; - option MSG_undo, exit, action { label_read(); pm->unsaved = 0; - pm_partusage(pm, -1, 1); }; - option MSG_unconfig, exit, action { if (pm_unconfigure(pm) == 0) - pm_partusage(pm, -1, 1); }; - -menu pmpartentry, x=50, y=5, exit, default exit; - option MSG_edit, exit, action { - pm->unsaved = 1; - int tpfs = pm->bsdlabel[*(int*)arg].pi_fstype; - int tplvm = pm->bsdlabel[*(int*)arg].lvmpv; - pm_editpart(*(int*)arg); - if (tpfs != pm->bsdlabel[*(int*)arg].pi_fstype || - tplvm != pm->bsdlabel[*(int*)arg].lvmpv) - /* Oops, partition type changed */ - pm_partusage(pm, *(int*)arg, 1); - }; - option MSG_fmtasraid, exit, action { - if (pm->gpt || pm->isspecial) { - process_menu(MENU_ok, __UNCONST(MSG_notsupported)); - return -1; - } - pm->unsaved = 1; - pm_partusage(pm, *(int*)arg, 1); - pm_setfstype(pm, *(int*)arg, FS_RAID); - }; - option MSG_fmtaslvm, exit, action { - if (pm->gpt || pm->isspecial) { - process_menu(MENU_ok, __UNCONST(MSG_notsupported)); - return -1; - } - pm->unsaved = 1; - pm_partusage(pm, *(int*)arg, 1); - pm_setfstype(pm, *(int*)arg, FS_BSDFFS); - pm->bsdlabel[*(int*)arg].lvmpv = 1; - }; - option MSG_encrypt, exit, action { - if (pm->gpt || pm->isspecial) { - process_menu(MENU_ok, __UNCONST(MSG_notsupported)); - return -1; - } - pm->unsaved = 1; - pm_partusage(pm, *(int*)arg, 1); - pm_setfstype(pm, *(int*)arg, FS_CGD); - pm_cgd_edit(0, - &(part_entry_t){.dev_ptr = pm, - .dev_num = *(int*)arg}); - }; - option MSG_erase, next menu shred_modes; - option MSG_doumount, exit, action { pm_umount(pm, *(int*)arg); }; - option MSG_Delete_partition, exit, action { - pm->unsaved = 1; - pm_partusage(pm, *(int*)arg, 1); - if (pm->isspecial) - pm_unconfigure(pm); - else - pm->bsdlabel[*(int*)arg].pi_fstype = FS_UNUSED; - }; - -menu pmgptentry, x=50, y=8, exit, default exit; - option MSG_editbsdpart, exit, action { pm_make_bsd_partitions(pm); }; - option MSG_switchmbr, exit, action { if (pm_gpt_convert(pm) == 0) - pm_partusage(pm, -1, 1); }; - option MSG_setbootable, exit, action { pm->unsaved = 1; - pm->bootable = !pm->bootable; }; - option MSG_erase, next menu shred_modes; - option MSG_undo, exit, action { label_read(); pm->unsaved = 0; - pm_partusage(pm, -1, 1); }; - option MSG_unconfig, exit, action { if (pm_unconfigure(pm) == 0) - pm_partusage(pm, -1, 1); }; - -menu shred_modes, x=50, y=5, exit, default exit; - option MSG_fillzeros, exit, - action { pm_shred(pm, *(int*)arg, SHRED_ZEROS); }; - option MSG_fillrandom, exit, - action { pm_shred(pm, *(int*)arg, SHRED_RANDOM); }; - option MSG_fillcrypto, exit, - action { pm_shred(pm, *(int*)arg, SHRED_CRYPTO); }; - -menu raidlevel; - option MSG_raid0, exit, action { *(int *)arg = 0; }; - option MSG_raid1, exit, action { *(int *)arg = 1; }; - option MSG_raid4, exit, action { *(int *)arg = 4; }; - option MSG_raid5, exit, action { *(int *)arg = 5; }; - -menu cgd_enctype; - option "aes-xts", exit, action { *(const char**)arg = "aes-xts"; }; - option "aes-cbc", exit, action { *(const char**)arg = "aes-cbc"; }; - option "3des-cbc", exit, action { *(const char**)arg = "3des-cbc"; }; - option "blowfish-cbc", exit, action { *(const char**)arg = "blowfish-cbc"; }; - -menu cgd_ivtype; - option "encblkno1", exit, action { *(const char**)arg = "encblkno1"; }; - option "encblkno8", exit, action { *(const char**)arg = "encblkno8"; }; - -menu cgd_keygentype; - option "pkcs5_pbkdf2/sha1", exit, action { *(const char**)arg = "pkcs5_pbkdf2/sha1"; }; - option "pkcs5_pbkdf2", exit, action { *(const char**)arg = "pkcs5_pbkdf2"; }; - option "storedkey", exit, action { *(const char**)arg = "storedkey"; }; - option "randomkey", exit, action { *(const char**)arg = "randomkey"; }; - option "urandomkey", exit, action { *(const char**)arg = "urandomkey"; }; - option "shell_cmd", exit, action { *(const char**)arg = "shell_cmd"; }; - -menu cgd_verifytype; - option "none", exit, action { *(const char**)arg = "none"; }; - option "disklabel", exit, action { *(const char**)arg = "disklabel"; }; - option "ffs", exit, action { *(const char**)arg = "ffs"; }; - option "re-enter", exit, action { *(const char**)arg = "re-enter"; }; Added files: Index: src/usr.sbin/sysinst/menus.pm diff -u /dev/null src/usr.sbin/sysinst/menus.pm:1.1 --- /dev/null Thu Sep 20 12:27:42 2018 +++ src/usr.sbin/sysinst/menus.pm Thu Sep 20 12:27:42 2018 @@ -0,0 +1,167 @@ +/* $NetBSD: menus.pm,v 1.1 2018/09/20 12:27:42 rin Exp $ */ +/* NetBSD: menus.mi,v 1.14 2018/09/11 08:05:18 martin Exp */ + +/*- + * Copyright (c) 2003 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by David Laight. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* Menu system definitions -- extended partitioning */ + +menu pmdiskentry, x=50, y=5, exit, default exit; + option MSG_editbsdpart, exit, action { pm_make_bsd_partitions(pm); }; + option MSG_editmbr, exit, action { md_get_info(); + md_pre_disklabel(); + memset(&pm->bsdlabel, 0, sizeof pm->bsdlabel);}; + option MSG_switchgpt, exit, action { if (pm_gpt_convert(pm) == 0) + pm_partusage(pm, -1, 1); }; + option MSG_renamedisk, exit, action { pm->unsaved = 1; pm_rename(pm); }; + option MSG_fmtasraid, exit, action { pm->unsaved = 1; + pm_partusage(pm, -1, 1); + layoutkind = LY_NEWRAID; + md_make_bsd_partitions();}; + option MSG_fmtaslvm, exit, action { pm->unsaved = 1; + pm_partusage(pm, -1, 1); + layoutkind = LY_NEWLVM; + md_make_bsd_partitions(); }; + option MSG_encrypt, exit, action { pm->unsaved = 1; + pm_partusage(pm, -1, 1); + layoutkind = LY_NEWCGD; + md_make_bsd_partitions(); + pm_cgd_edit(0, &(part_entry_t) + {.dev_ptr = pm, .dev_num = PART_E} + ); }; + option MSG_setbootable, exit, action { pm->unsaved = 1; + pm->bootable = !pm->bootable; }; + option MSG_erase, next menu shred_modes; + option MSG_undo, exit, action { label_read(); pm->unsaved = 0; + pm_partusage(pm, -1, 1); }; + option MSG_unconfig, exit, action { if (pm_unconfigure(pm) == 0) + pm_partusage(pm, -1, 1); }; + +menu pmpartentry, x=50, y=5, exit, default exit; + option MSG_edit, exit, action { + pm->unsaved = 1; + int tpfs = pm->bsdlabel[*(int*)arg].pi_fstype; + int tplvm = pm->bsdlabel[*(int*)arg].lvmpv; + pm_editpart(*(int*)arg); + if (tpfs != pm->bsdlabel[*(int*)arg].pi_fstype || + tplvm != pm->bsdlabel[*(int*)arg].lvmpv) + /* Oops, partition type changed */ + pm_partusage(pm, *(int*)arg, 1); + }; + option MSG_fmtasraid, exit, action { + if (pm->gpt || pm->isspecial) { + process_menu(MENU_ok, __UNCONST(MSG_notsupported)); + return -1; + } + pm->unsaved = 1; + pm_partusage(pm, *(int*)arg, 1); + pm_setfstype(pm, *(int*)arg, FS_RAID); + }; + option MSG_fmtaslvm, exit, action { + if (pm->gpt || pm->isspecial) { + process_menu(MENU_ok, __UNCONST(MSG_notsupported)); + return -1; + } + pm->unsaved = 1; + pm_partusage(pm, *(int*)arg, 1); + pm_setfstype(pm, *(int*)arg, FS_BSDFFS); + pm->bsdlabel[*(int*)arg].lvmpv = 1; + }; + option MSG_encrypt, exit, action { + if (pm->gpt || pm->isspecial) { + process_menu(MENU_ok, __UNCONST(MSG_notsupported)); + return -1; + } + pm->unsaved = 1; + pm_partusage(pm, *(int*)arg, 1); + pm_setfstype(pm, *(int*)arg, FS_CGD); + pm_cgd_edit(0, + &(part_entry_t){.dev_ptr = pm, + .dev_num = *(int*)arg}); + }; + option MSG_erase, next menu shred_modes; + option MSG_doumount, exit, action { pm_umount(pm, *(int*)arg); }; + option MSG_Delete_partition, exit, action { + pm->unsaved = 1; + pm_partusage(pm, *(int*)arg, 1); + if (pm->isspecial) + pm_unconfigure(pm); + else + pm->bsdlabel[*(int*)arg].pi_fstype = FS_UNUSED; + }; + +menu pmgptentry, x=50, y=8, exit, default exit; + option MSG_editbsdpart, exit, action { pm_make_bsd_partitions(pm); }; + option MSG_switchmbr, exit, action { if (pm_gpt_convert(pm) == 0) + pm_partusage(pm, -1, 1); }; + option MSG_setbootable, exit, action { pm->unsaved = 1; + pm->bootable = !pm->bootable; }; + option MSG_erase, next menu shred_modes; + option MSG_undo, exit, action { label_read(); pm->unsaved = 0; + pm_partusage(pm, -1, 1); }; + option MSG_unconfig, exit, action { if (pm_unconfigure(pm) == 0) + pm_partusage(pm, -1, 1); }; + +menu shred_modes, x=50, y=5, exit, default exit; + option MSG_fillzeros, exit, + action { pm_shred(pm, *(int*)arg, SHRED_ZEROS); }; + option MSG_fillrandom, exit, + action { pm_shred(pm, *(int*)arg, SHRED_RANDOM); }; + option MSG_fillcrypto, exit, + action { pm_shred(pm, *(int*)arg, SHRED_CRYPTO); }; + +menu raidlevel; + option MSG_raid0, exit, action { *(int *)arg = 0; }; + option MSG_raid1, exit, action { *(int *)arg = 1; }; + option MSG_raid4, exit, action { *(int *)arg = 4; }; + option MSG_raid5, exit, action { *(int *)arg = 5; }; + +menu cgd_enctype; + option "aes-xts", exit, action { *(const char**)arg = "aes-xts"; }; + option "aes-cbc", exit, action { *(const char**)arg = "aes-cbc"; }; + option "3des-cbc", exit, action { *(const char**)arg = "3des-cbc"; }; + option "blowfish-cbc", exit, action { *(const char**)arg = "blowfish-cbc"; }; + +menu cgd_ivtype; + option "encblkno1", exit, action { *(const char**)arg = "encblkno1"; }; + option "encblkno8", exit, action { *(const char**)arg = "encblkno8"; }; + +menu cgd_keygentype; + option "pkcs5_pbkdf2/sha1", exit, action { *(const char**)arg = "pkcs5_pbkdf2/sha1"; }; + option "pkcs5_pbkdf2", exit, action { *(const char**)arg = "pkcs5_pbkdf2"; }; + option "storedkey", exit, action { *(const char**)arg = "storedkey"; }; + option "randomkey", exit, action { *(const char**)arg = "randomkey"; }; + option "urandomkey", exit, action { *(const char**)arg = "urandomkey"; }; + option "shell_cmd", exit, action { *(const char**)arg = "shell_cmd"; }; + +menu cgd_verifytype; + option "none", exit, action { *(const char**)arg = "none"; }; + option "disklabel", exit, action { *(const char**)arg = "disklabel"; }; + option "ffs", exit, action { *(const char**)arg = "ffs"; }; + option "re-enter", exit, action { *(const char**)arg = "re-enter"; };