Add lz4 support

This commit is contained in:
topjohnwu
2017-03-02 04:12:47 +08:00
parent feccc97a14
commit e08d46aa76
9 changed files with 173 additions and 37 deletions

View File

@ -48,6 +48,7 @@ void unpack(const char* image) {
break;
case LZOP:
sprintf(name, "%s.%s", RAMDISK_FILE, "lzo");
printf("Unsupported format! Please decompress manually!\n");
break;
case XZ:
sprintf(name, "%s.%s", RAMDISK_FILE, "xz");
@ -59,9 +60,11 @@ void unpack(const char* image) {
break;
case BZIP2:
sprintf(name, "%s.%s", RAMDISK_FILE, "bz2");
printf("Unsupported format! Please decompress manually!\n");
break;
case LZ4:
sprintf(name, "%s.%s", RAMDISK_FILE, "lz4");
lz4(0, RAMDISK_FILE, ramdisk, hdr.ramdisk_size);
break;
default:
// Never happens