Add bzip2 support

This commit is contained in:
topjohnwu
2017-03-02 05:23:31 +08:00
parent e08d46aa76
commit 2b3b087c29
6 changed files with 80 additions and 8 deletions

View File

@ -49,6 +49,8 @@ void unpack(const char* image) {
case LZOP:
sprintf(name, "%s.%s", RAMDISK_FILE, "lzo");
printf("Unsupported format! Please decompress manually!\n");
// Dump the compressed ramdisk
dump(ramdisk, hdr.ramdisk_size, name);
break;
case XZ:
sprintf(name, "%s.%s", RAMDISK_FILE, "xz");
@ -60,7 +62,7 @@ void unpack(const char* image) {
break;
case BZIP2:
sprintf(name, "%s.%s", RAMDISK_FILE, "bz2");
printf("Unsupported format! Please decompress manually!\n");
bzip2(0, RAMDISK_FILE, ramdisk, hdr.ramdisk_size);
break;
case LZ4:
sprintf(name, "%s.%s", RAMDISK_FILE, "lz4");
@ -70,8 +72,6 @@ void unpack(const char* image) {
// Never happens
break;
}
// Dump the compressed ramdisk, just in case
dump(ramdisk, hdr.ramdisk_size, name);
if (hdr.second_size) {
// Dump second