widthspec.h
docs/stamp-1
docs/version-dev.texi
+Makefile.utilgcry.def
common = grub-core/kern/list.c;
common = grub-core/kern/misc.c;
common = grub-core/kern/partition.c;
+ common = grub-core/lib/crypto.c;
+ common = grub-core/disk/luks.c;
+ common = grub-core/disk/AFSplitter.c;
+ common = grub-core/lib/pbkdf2.c;
+ common = grub-core/commands/extcmd.c;
+ common = grub-core/lib/arg.c;
};
library = {
name = libgrubmods.a;
- cflags = '$(CFLAGS_GCRY)';
- cppflags = '$(CPPFLAGS_GCRY)';
common_nodist = grub_script.tab.c;
common_nodist = grub_script.yy.c;
common_nodist = grub_script.tab.h;
common = grub-core/commands/blocklist.c;
- common = grub-core/commands/extcmd.c;
common = grub-core/commands/ls.c;
common = grub-core/disk/dmraid_nvidia.c;
common = grub-core/disk/loopback.c;
common = grub-core/fs/zfs/zfs_lzjb.c;
common = grub-core/fs/zfs/zfs_sha256.c;
common = grub-core/fs/zfs/zfs_fletcher.c;
- common = grub-core/lib/arg.c;
- common = grub-core/lib/crypto.c;
common = grub-core/lib/envblk.c;
common = grub-core/lib/hexdump.c;
- common = grub-core/lib/libgcrypt-grub/cipher/sha512.c;
- common = grub-core/lib/libgcrypt-grub/cipher/crc.c;
common = grub-core/lib/LzFind.c;
common = grub-core/lib/LzmaEnc.c;
- common = grub-core/lib/pbkdf2.c;
common = grub-core/lib/crc.c;
common = grub-core/normal/datetime.c;
common = grub-core/normal/misc.c;
ldadd = libgrubmods.a;
ldadd = libgrubkern.a;
+ ldadd = libgrubgcry.a;
ldadd = grub-core/gnulib/libgnu.a;
ldadd = '$(LIBLZMA)';
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
ldadd = libgrubmods.a;
ldadd = libgrubkern.a;
+ ldadd = libgrubgcry.a;
ldadd = grub-core/gnulib/libgnu.a;
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
cflags = '$(CFLAGS_GCRY)';
ldadd = libgrubmods.a;
ldadd = libgrubkern.a;
+ ldadd = libgrubgcry.a;
ldadd = grub-core/gnulib/libgnu.a;
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
};
ldadd = libgrubmods.a;
ldadd = libgrubkern.a;
+ ldadd = libgrubgcry.a;
ldadd = grub-core/gnulib/libgnu.a;
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
};
[ "${GRUB_CONTRIB}" = grub-core/contrib ] || ln -s ../contrib grub-core/contrib
fi
-UTIL_DEFS=Makefile.util.def
+UTIL_DEFS='Makefile.util.def Makefile.utilgcry.def'
CORE_DEFS='grub-core/Makefile.core.def grub-core/Makefile.gcry.def'
for extra in contrib/*/Makefile.util.def; do
extern void (*grub_crypto_autoload_hook) (const char *name);
+#ifdef GRUB_UTIL
+void grub_gcry_init_all (void);
+void grub_gcry_fini_all (void);
+#endif
+
+
#endif
/* Initialize all modules. */
grub_init_all ();
+ grub_gcry_init_all ();
grub_lvm_fini ();
grub_mdraid09_fini ();
probe (argument, NULL);
/* Free resources. */
+ grub_gcry_fini_all ();
grub_fini_all ();
grub_util_biosdisk_fini ();
cipher_files = os.listdir (cipher_dir_in)
conf = open (os.path.join ("grub-core", "Makefile.gcry.def"), "w")
conf.write ("AutoGen definitions Makefile.tpl;\n\n")
+confutil = open ("Makefile.utilgcry.def", "w")
+confutil.write ("AutoGen definitions Makefile.tpl;\n\n")
+confutil.write ("library = {\n");
+confutil.write (" name = libgrubgcry.a;\n");
+confutil.write (" cflags = '$(CFLAGS_GCRY)';\n");
+confutil.write (" cppflags = '$(CPPFLAGS_GCRY)';\n");
+confutil.write ("\n");
chlog = ""
+modules = []
# Strictly speaking CRC32/CRC24 work on bytes so this value should be 1
# But libgcrypt uses 64. Let's keep the value for compatibility. Since
% (cipher_file, cipher_file.replace ("-glue.c", ".c"))
else:
modfiles = "lib/libgcrypt-grub/cipher/%s" % cipher_file
+ modules.append (modname)
chmsg = "(GRUB_MOD_INIT(%s)): New function\n" % modname
if nch:
chlognew = "%s\n %s" % (chlognew, chmsg)
conf.write (" name = %s;\n" % modname)
for src in modfiles.split():
conf.write (" common = %s;\n" % src)
+ confutil.write (" common = grub-core/%s;\n" % src)
conf.write (" cflags = '$(CFLAGS_GCRY)';\n");
conf.write (" cppflags = '$(CPPFLAGS_GCRY)';\n");
conf.write ("};\n\n")
infile = os.path.join (cipher_dir_in, "ChangeLog")
outfile = os.path.join (cipher_dir_out, "ChangeLog")
+conf.close ();
+
+initfile = open (os.path.join (cipher_dir_out, "init.c"), "w")
+for module in modules:
+ initfile.write ("extern void grub_%s_init (void);\n" % module)
+ initfile.write ("extern void grub_%s_fini (void);\n" % module)
+initfile.write ("\n")
+initfile.write ("void\n")
+initfile.write ("grub_gcry_init_all (void)\n")
+initfile.write ("{\n")
+for module in modules:
+ initfile.write (" grub_%s_init ();\n" % module)
+initfile.write ("}\n")
+initfile.write ("\n")
+initfile.write ("void\n")
+initfile.write ("grub_gcry_fini_all (void)\n")
+initfile.write ("{\n")
+for module in modules:
+ initfile.write (" grub_%s_fini ();\n" % module)
+initfile.write ("}\n")
+initfile.close ()
+
+confutil.write (" common = grub-core/lib/libgcrypt-grub/cipher/init.c;\n")
+confutil.write ("};\n");
+confutil.close ();
+
f=open (infile, "r")
fw=open (outfile, "w")