Changeset View
Changeset View
Standalone View
Standalone View
sys/ddb/db_textdump.c
Context not available. | |||||
void | void | ||||
textdump_dumpsys(struct dumperinfo *di) | textdump_dumpsys(struct dumperinfo *di) | ||||
{ | { | ||||
struct kerneldumpcrypto *kdc; | |||||
off_t dumplen, trailer_offset; | off_t dumplen, trailer_offset; | ||||
if (di->blocksize != TEXTDUMP_BLOCKSIZE) { | if (di->blocksize != TEXTDUMP_BLOCKSIZE) { | ||||
Context not available. | |||||
textdump_error = 0; | textdump_error = 0; | ||||
/* | /* | ||||
* Disable EKCD because we don't provide encrypted textdumps. | |||||
*/ | |||||
kdc = di->kdc; | |||||
di->kdc = NULL; | |||||
/* | |||||
* Position the start of the dump so that we'll write the kernel dump | * Position the start of the dump so that we'll write the kernel dump | ||||
* trailer immediately before the end of the partition, and then work | * trailer immediately before the end of the partition, and then work | ||||
* our way back. We will rewrite this header later to reflect the | * our way back. We will rewrite this header later to reflect the | ||||
Context not available. | |||||
*/ | */ | ||||
textdump_offset = di->mediasize - sizeof(kdh); | textdump_offset = di->mediasize - sizeof(kdh); | ||||
textdump_saveoff(&trailer_offset); | textdump_saveoff(&trailer_offset); | ||||
mkdumpheader(&kdh, TEXTDUMPMAGIC, KERNELDUMP_TEXT_VERSION, 0, TEXTDUMP_BLOCKSIZE); | mkdumpheader(&kdh, TEXTDUMPMAGIC, KERNELDUMP_TEXT_VERSION, 0, 0, | ||||
TEXTDUMP_BLOCKSIZE); | |||||
(void)textdump_writenextblock(di, (char *)&kdh); | (void)textdump_writenextblock(di, (char *)&kdh); | ||||
/* | /* | ||||
Context not available. | |||||
* size. | * size. | ||||
*/ | */ | ||||
dumplen = trailer_offset - (textdump_offset + TEXTDUMP_BLOCKSIZE); | dumplen = trailer_offset - (textdump_offset + TEXTDUMP_BLOCKSIZE); | ||||
mkdumpheader(&kdh, TEXTDUMPMAGIC, KERNELDUMP_TEXT_VERSION, dumplen, | mkdumpheader(&kdh, TEXTDUMPMAGIC, KERNELDUMP_TEXT_VERSION, dumplen, 0, | ||||
TEXTDUMP_BLOCKSIZE); | TEXTDUMP_BLOCKSIZE); | ||||
(void)textdump_writenextblock(di, (char *)&kdh); | (void)textdump_writenextblock(di, (char *)&kdh); | ||||
textdump_restoreoff(trailer_offset); | textdump_restoreoff(trailer_offset); | ||||
Context not available. | |||||
else | else | ||||
printf("Textdump complete.\n"); | printf("Textdump complete.\n"); | ||||
textdump_pending = 0; | textdump_pending = 0; | ||||
/* | |||||
* Restore EKCD status. | |||||
*/ | |||||
di->kdc = kdc; | |||||
} | } | ||||
/*- | /*- | ||||
Context not available. |