Lines 61-66
Link Here
|
61 |
#include "mksquashfs.h" |
61 |
#include "mksquashfs.h" |
62 |
#include "global.h" |
62 |
#include "global.h" |
63 |
#include "sort.h" |
63 |
#include "sort.h" |
|
|
64 |
#include "sqlzma.h" |
65 |
#include "sqmagic.h" |
64 |
|
66 |
|
65 |
#ifdef SQUASHFS_TRACE |
67 |
#ifdef SQUASHFS_TRACE |
66 |
#define TRACE(s, args...) do { \ |
68 |
#define TRACE(s, args...) do { \ |
Lines 112-117
unsigned short uid_count = 0, guid_count
Link Here
|
112 |
squashfs_uid uids[SQUASHFS_UIDS], guids[SQUASHFS_GUIDS]; |
114 |
squashfs_uid uids[SQUASHFS_UIDS], guids[SQUASHFS_GUIDS]; |
113 |
int block_offset; |
115 |
int block_offset; |
114 |
int file_count = 0, sym_count = 0, dev_count = 0, dir_count = 0, fifo_count = 0, sock_count = 0; |
116 |
int file_count = 0, sym_count = 0, dev_count = 0, dir_count = 0, fifo_count = 0, sock_count = 0; |
|
|
117 |
struct sqlzma_un un; |
118 |
struct sqlzma_opts sqlzma_opts = { |
119 |
.try_lzma = 1, |
120 |
.dicsize = SQUASHFS_FILE_SIZE |
121 |
}; |
115 |
|
122 |
|
116 |
/* write position within data section */ |
123 |
/* write position within data section */ |
117 |
long long bytes = 0, total_bytes = 0; |
124 |
long long bytes = 0, total_bytes = 0; |
Lines 626-646
unsigned int mangle2(z_stream **strm, ch
Link Here
|
626 |
BAD_ERROR("zlib::compress failed, unknown error %d\n", res); |
633 |
BAD_ERROR("zlib::compress failed, unknown error %d\n", res); |
627 |
} |
634 |
} |
628 |
|
635 |
|
629 |
stream->next_in = (unsigned char *) s; |
636 |
res = sqlzma_cm(&sqlzma_opts, stream, (void *)s, size, (void *)d, |
630 |
stream->avail_in = size; |
637 |
block_size); |
631 |
stream->next_out = (unsigned char *) d; |
|
|
632 |
stream->avail_out = block_size; |
633 |
|
634 |
res = deflate(stream, Z_FINISH); |
635 |
if(res != Z_STREAM_END && res != Z_OK) { |
636 |
if(res == Z_STREAM_ERROR) |
637 |
BAD_ERROR("zlib::compress failed, stream state inconsistent\n"); |
638 |
else if(res == Z_BUF_ERROR) |
639 |
BAD_ERROR("zlib::compress failed, no progress possible\n"); |
640 |
else |
641 |
BAD_ERROR("zlib::compress failed, unknown error %d\n", res); |
642 |
} |
643 |
|
644 |
c_byte = stream->total_out; |
638 |
c_byte = stream->total_out; |
645 |
|
639 |
|
646 |
if(res != Z_STREAM_END || c_byte >= size) { |
640 |
if(res != Z_STREAM_END || c_byte >= size) { |
Lines 739-744
void write_bytes(int fd, long long byte,
Link Here
|
739 |
EXIT_MKSQUASHFS(); |
733 |
EXIT_MKSQUASHFS(); |
740 |
} |
734 |
} |
741 |
|
735 |
|
|
|
736 |
//printf("%d bytes at %Ld\n", bytes, off); |
742 |
if(write(fd, buff, bytes) == -1) { |
737 |
if(write(fd, buff, bytes) == -1) { |
743 |
perror("Write on destination failed"); |
738 |
perror("Write on destination failed"); |
744 |
EXIT_MKSQUASHFS(); |
739 |
EXIT_MKSQUASHFS(); |
Lines 991-1002
int create_inode(squashfs_inode *i_no, s
Link Here
|
991 |
char buff[65536]; |
986 |
char buff[65536]; |
992 |
|
987 |
|
993 |
if((byte = readlink(filename, buff, 65536)) == -1) { |
988 |
if((byte = readlink(filename, buff, 65536)) == -1) { |
994 |
ERROR("Failed to read symlink %d, creating empty symlink\n", filename); |
989 |
ERROR("Failed to read symlink %s, creating empty symlink\n", filename); |
995 |
byte = 0; |
990 |
byte = 0; |
996 |
} |
991 |
} |
997 |
|
992 |
|
998 |
if(byte == 65536) { |
993 |
if(byte == 65536) { |
999 |
ERROR("Symlink %d is greater than 65536 bytes! Creating empty symlink\n", filename); |
994 |
ERROR("Symlink %s is greater than 65536 bytes! Creating empty symlink\n", filename); |
1000 |
byte = 0; |
995 |
byte = 0; |
1001 |
} |
996 |
} |
1002 |
|
997 |
|
Lines 1022-1028
int create_inode(squashfs_inode *i_no, s
Link Here
|
1022 |
SQUASHFS_SWAP_IPC_INODE_HEADER(ipc, inode); |
1017 |
SQUASHFS_SWAP_IPC_INODE_HEADER(ipc, inode); |
1023 |
TRACE("ipc inode, type %s, nlink %d\n", type == SQUASHFS_FIFO_TYPE ? "fifo" : "socket", nlink); |
1018 |
TRACE("ipc inode, type %s, nlink %d\n", type == SQUASHFS_FIFO_TYPE ? "fifo" : "socket", nlink); |
1024 |
} else |
1019 |
} else |
1025 |
BAD_ERROR("Unrecognised inode %d in create_inode\n"); |
1020 |
BAD_ERROR("Unrecognised inode %d in create_inode\n", type); |
1026 |
|
1021 |
|
1027 |
*i_no = MKINODE(inode); |
1022 |
*i_no = MKINODE(inode); |
1028 |
inode_count ++; |
1023 |
inode_count ++; |
Lines 1250-1266
char *get_fragment(char *buffer, struct
Link Here
|
1250 |
int res; |
1245 |
int res; |
1251 |
unsigned long bytes = block_size; |
1246 |
unsigned long bytes = block_size; |
1252 |
char cbuffer[block_size]; |
1247 |
char cbuffer[block_size]; |
|
|
1248 |
enum {Src, Dst}; |
1249 |
struct sized_buf sbuf[] = { |
1250 |
{.buf = (void *)cbuffer, .sz = size}, |
1251 |
{.buf = (void *)buffer, .sz = bytes} |
1252 |
}; |
1253 |
|
1253 |
|
1254 |
read_bytes(fd, disk_fragment->start_block, size, cbuffer); |
1254 |
read_bytes(fd, disk_fragment->start_block, size, cbuffer); |
1255 |
|
1255 |
|
1256 |
if((res = uncompress((unsigned char *) buffer, &bytes, (const unsigned char *) cbuffer, size)) != Z_OK) { |
1256 |
res = sqlzma_un(&un, sbuf + Src, sbuf + Dst); |
1257 |
if(res == Z_MEM_ERROR) |
1257 |
if (res) |
1258 |
BAD_ERROR("zlib::uncompress failed, not enough memory\n"); |
1258 |
BAD_ERROR("%s:%d: res %d\n", __func__, __LINE__, res); |
1259 |
else if(res == Z_BUF_ERROR) |
|
|
1260 |
BAD_ERROR("zlib::uncompress failed, not enough room in output buffer\n"); |
1261 |
else |
1262 |
BAD_ERROR("zlib::uncompress failed, unknown error %d\n", res); |
1263 |
} |
1264 |
} else |
1259 |
} else |
1265 |
read_bytes(fd, disk_fragment->start_block, size, buffer); |
1260 |
read_bytes(fd, disk_fragment->start_block, size, buffer); |
1266 |
|
1261 |
|
Lines 1687-1693
again:
Link Here
|
1687 |
goto restat; |
1682 |
goto restat; |
1688 |
} |
1683 |
} |
1689 |
|
1684 |
|
1690 |
if(file_buffer->fragment = file_buffer->block == frag_block) |
1685 |
file_buffer->fragment = (file_buffer->block == frag_block); |
|
|
1686 |
if(file_buffer->fragment) |
1691 |
queue_put(from_deflate, file_buffer); |
1687 |
queue_put(from_deflate, file_buffer); |
1692 |
else |
1688 |
else |
1693 |
queue_put(from_reader, file_buffer); |
1689 |
queue_put(from_reader, file_buffer); |
Lines 1755-1760
void *reader(void *arg)
Link Here
|
1755 |
for(entry = priority_list[i]; entry; entry = entry->next) |
1751 |
for(entry = priority_list[i]; entry; entry = entry->next) |
1756 |
reader_read_file(entry->dir); |
1752 |
reader_read_file(entry->dir); |
1757 |
} |
1753 |
} |
|
|
1754 |
return NULL; |
1758 |
} |
1755 |
} |
1759 |
|
1756 |
|
1760 |
|
1757 |
|
Lines 1784-1789
void *writer(void *arg)
Link Here
|
1784 |
write_error = TRUE; |
1781 |
write_error = TRUE; |
1785 |
} |
1782 |
} |
1786 |
|
1783 |
|
|
|
1784 |
//printf("%d bytes at %Ld\n", file_buffer->size, off); |
1787 |
if(!write_error && write(fd, file_buffer->data, file_buffer->size) == -1) { |
1785 |
if(!write_error && write(fd, file_buffer->data, file_buffer->size) == -1) { |
1788 |
perror("Write on destination failed"); |
1786 |
perror("Write on destination failed"); |
1789 |
write_error = TRUE; |
1787 |
write_error = TRUE; |
Lines 1926-1932
int progress_bar(long long current, long
Link Here
|
1926 |
int spaces = columns - used - hashes; |
1924 |
int spaces = columns - used - hashes; |
1927 |
|
1925 |
|
1928 |
if(!progress || columns - used < 0) |
1926 |
if(!progress || columns - used < 0) |
1929 |
return; |
1927 |
return 0; |
1930 |
|
1928 |
|
1931 |
printf("\r["); |
1929 |
printf("\r["); |
1932 |
|
1930 |
|
Lines 1939-1944
int progress_bar(long long current, long
Link Here
|
1939 |
printf("] %*lld/%*lld", max_digits, current, max_digits, max); |
1937 |
printf("] %*lld/%*lld", max_digits, current, max_digits, max); |
1940 |
printf(" %3lld%%", current * 100 / max); |
1938 |
printf(" %3lld%%", current * 100 / max); |
1941 |
fflush(stdout); |
1939 |
fflush(stdout); |
|
|
1940 |
return 0; |
1942 |
} |
1941 |
} |
1943 |
|
1942 |
|
1944 |
|
1943 |
|
Lines 2243-2249
void write_file(squashfs_inode *inode, s
Link Here
|
2243 |
|
2242 |
|
2244 |
again: |
2243 |
again: |
2245 |
read_buffer = get_file_buffer(from_deflate); |
2244 |
read_buffer = get_file_buffer(from_deflate); |
2246 |
if(status = read_buffer->error) { |
2245 |
status = read_buffer->error; |
|
|
2246 |
if(status) { |
2247 |
alloc_free(read_buffer); |
2247 |
alloc_free(read_buffer); |
2248 |
goto file_err; |
2248 |
goto file_err; |
2249 |
} |
2249 |
} |
Lines 2635-2641
error:
Link Here
|
2635 |
|
2635 |
|
2636 |
void dir_scan2(squashfs_inode *inode, struct dir_info *dir_info) |
2636 |
void dir_scan2(squashfs_inode *inode, struct dir_info *dir_info) |
2637 |
{ |
2637 |
{ |
2638 |
int squashfs_type; |
2638 |
int squashfs_type = -1; |
2639 |
int duplicate_file; |
2639 |
int duplicate_file; |
2640 |
char *pathname = dir_info->pathname; |
2640 |
char *pathname = dir_info->pathname; |
2641 |
struct directory dir; |
2641 |
struct directory dir; |
Lines 2918-2924
skip_inode_hash_table:
Link Here
|
2918 |
char *get_component(char *target, char *targname) |
2918 |
char *get_component(char *target, char *targname) |
2919 |
{ |
2919 |
{ |
2920 |
while(*target == '/') |
2920 |
while(*target == '/') |
2921 |
*target ++; |
2921 |
target ++; |
2922 |
|
2922 |
|
2923 |
while(*target != '/' && *target!= '\0') |
2923 |
while(*target != '/' && *target!= '\0') |
2924 |
*targname ++ = *target ++; |
2924 |
*targname ++ = *target ++; |
Lines 2974-2980
struct pathname *add_path(struct pathnam
Link Here
|
2974 |
paths->name[i].paths = NULL; |
2974 |
paths->name[i].paths = NULL; |
2975 |
if(use_regex) { |
2975 |
if(use_regex) { |
2976 |
paths->name[i].preg = malloc(sizeof(regex_t)); |
2976 |
paths->name[i].preg = malloc(sizeof(regex_t)); |
2977 |
if(error = regcomp(paths->name[i].preg, targname, REG_EXTENDED|REG_NOSUB)) { |
2977 |
error = regcomp(paths->name[i].preg, targname, REG_EXTENDED|REG_NOSUB); |
|
|
2978 |
if(error) { |
2978 |
char str[1024]; |
2979 |
char str[1024]; |
2979 |
|
2980 |
|
2980 |
regerror(error, paths->name[i].preg, str, 1024); |
2981 |
regerror(error, paths->name[i].preg, str, 1024); |
Lines 3242-3248
void read_recovery_data(char *recovery_f
Link Here
|
3242 |
printf("This program is distributed in the hope that it will be useful,\n");\ |
3243 |
printf("This program is distributed in the hope that it will be useful,\n");\ |
3243 |
printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n");\ |
3244 |
printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n");\ |
3244 |
printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n");\ |
3245 |
printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n");\ |
3245 |
printf("GNU General Public License for more details.\n"); |
3246 |
printf("GNU General Public License for more details.\n");\ |
|
|
3247 |
printf("and LZMA support for slax.org by jro.\n"); |
3246 |
int main(int argc, char *argv[]) |
3248 |
int main(int argc, char *argv[]) |
3247 |
{ |
3249 |
{ |
3248 |
struct winsize winsize; |
3250 |
struct winsize winsize; |
Lines 3261-3266
int main(int argc, char *argv[])
Link Here
|
3261 |
be = FALSE; |
3263 |
be = FALSE; |
3262 |
#endif |
3264 |
#endif |
3263 |
|
3265 |
|
|
|
3266 |
un.un_lzma = 1; |
3264 |
block_log = slog(block_size); |
3267 |
block_log = slog(block_size); |
3265 |
if(argc > 1 && strcmp(argv[1], "-version") == 0) { |
3268 |
if(argc > 1 && strcmp(argv[1], "-version") == 0) { |
3266 |
VERSION(); |
3269 |
VERSION(); |
Lines 3319-3342
int main(int argc, char *argv[])
Link Here
|
3319 |
ERROR("%s: -write-queue should be 1 megabyte or larger\n", argv[0]); |
3322 |
ERROR("%s: -write-queue should be 1 megabyte or larger\n", argv[0]); |
3320 |
exit(1); |
3323 |
exit(1); |
3321 |
} |
3324 |
} |
3322 |
} else if(strcmp(argv[i], "-b") == 0) { |
3325 |
} else if(strcmp(argv[i], "-b") == 0 |
|
|
3326 |
|| strcmp(argv[i], "-lzmadic") == 0) { |
3327 |
long bs; |
3328 |
unsigned int bl; |
3323 |
if(++i == argc) { |
3329 |
if(++i == argc) { |
3324 |
ERROR("%s: -b missing block size\n", argv[0]); |
3330 |
ERROR("%s: -b|-lzmadic missing block size\n", argv[0]); |
3325 |
exit(1); |
3331 |
exit(1); |
3326 |
} |
3332 |
} |
3327 |
block_size = strtol(argv[i], &b, 10); |
3333 |
bs = strtol(argv[i], &b, 10); |
3328 |
if(*b == 'm' || *b == 'M') |
3334 |
if(*b == 'm' || *b == 'M') |
3329 |
block_size *= 1048576; |
3335 |
bs *= 1048576; |
3330 |
else if(*b == 'k' || *b == 'K') |
3336 |
else if(*b == 'k' || *b == 'K') |
3331 |
block_size *= 1024; |
3337 |
bs *= 1024; |
3332 |
else if(*b != '\0') { |
3338 |
else if(*b != '\0') { |
3333 |
ERROR("%s: -b invalid block size\n", argv[0]); |
3339 |
ERROR("%s: -b|-lzmadic invalid size\n", argv[0]); |
3334 |
exit(1); |
3340 |
exit(1); |
3335 |
} |
3341 |
} |
3336 |
if((block_log = slog(block_size)) == 0) { |
3342 |
bl = slog(bs); |
3337 |
ERROR("%s: -b block size not power of two or not between 4096 and 1Mbyte\n", argv[0]); |
3343 |
if(bl == 0) { |
|
|
3344 |
ERROR("%s: -b|-lzmadic size not power of two or not between 4096 and 1Mbyte\n", argv[0]); |
3338 |
exit(1); |
3345 |
exit(1); |
3339 |
} |
3346 |
} |
|
|
3347 |
if (!strcmp(argv[i - 1], "-b")) { |
3348 |
block_size = bs; |
3349 |
block_log = bl; |
3350 |
} |
3351 |
sqlzma_opts.dicsize = bs; |
3340 |
} else if(strcmp(argv[i], "-ef") == 0) { |
3352 |
} else if(strcmp(argv[i], "-ef") == 0) { |
3341 |
if(++i == argc) { |
3353 |
if(++i == argc) { |
3342 |
ERROR("%s: -ef missing filename\n", argv[0]); |
3354 |
ERROR("%s: -ef missing filename\n", argv[0]); |
Lines 3440-3445
int main(int argc, char *argv[])
Link Here
|
3440 |
exit(1); |
3452 |
exit(1); |
3441 |
} |
3453 |
} |
3442 |
root_name = argv[i]; |
3454 |
root_name = argv[i]; |
|
|
3455 |
} else if(strcmp(argv[i], "-nolzma") == 0) { |
3456 |
un.un_lzma = 0; |
3457 |
sqlzma_opts.try_lzma = 0; |
3443 |
} else if(strcmp(argv[i], "-version") == 0) { |
3458 |
} else if(strcmp(argv[i], "-version") == 0) { |
3444 |
VERSION(); |
3459 |
VERSION(); |
3445 |
} else { |
3460 |
} else { |
Lines 3489-3494
printOptions:
Link Here
|
3489 |
ERROR("-ef <exclude_file>\tlist of exclude dirs/files. One per line\n"); |
3504 |
ERROR("-ef <exclude_file>\tlist of exclude dirs/files. One per line\n"); |
3490 |
ERROR("-wildcards\t\tAllow extended shell wildcards (globbing) to be used in\n\t\t\texclude dirs/files\n"); |
3505 |
ERROR("-wildcards\t\tAllow extended shell wildcards (globbing) to be used in\n\t\t\texclude dirs/files\n"); |
3491 |
ERROR("-regex\t\t\tAllow POSIX regular expressions to be used in exclude\n\t\t\tdirs/files\n"); |
3506 |
ERROR("-regex\t\t\tAllow POSIX regular expressions to be used in exclude\n\t\t\tdirs/files\n"); |
|
|
3507 |
ERROR("-lzmadic <dic_size>\tset the LZMA dictionary" |
3508 |
" size to <dic_size>\n" |
3509 |
"\t\t\tDefault value always follow the block" |
3510 |
" size\n" |
3511 |
"\t\t\tUse this alone or AFTER -b option\n"); |
3512 |
ERROR("-nolzma\t\t\tnever try LZMA compression\n"); |
3492 |
exit(1); |
3513 |
exit(1); |
3493 |
} |
3514 |
} |
3494 |
} |
3515 |
} |
Lines 3595-3600
printOptions:
Link Here
|
3595 |
|
3616 |
|
3596 |
be = orig_be; |
3617 |
be = orig_be; |
3597 |
block_log = slog(block_size = sBlk.block_size); |
3618 |
block_log = slog(block_size = sBlk.block_size); |
|
|
3619 |
//sqlzma_opts.dicsize = block_size; |
3598 |
s_minor = sBlk.s_minor; |
3620 |
s_minor = sBlk.s_minor; |
3599 |
noI = SQUASHFS_UNCOMPRESSED_INODES(sBlk.flags); |
3621 |
noI = SQUASHFS_UNCOMPRESSED_INODES(sBlk.flags); |
3600 |
noD = SQUASHFS_UNCOMPRESSED_DATA(sBlk.flags); |
3622 |
noD = SQUASHFS_UNCOMPRESSED_DATA(sBlk.flags); |
Lines 3608-3617
printOptions:
Link Here
|
3608 |
|
3630 |
|
3609 |
initialise_threads(); |
3631 |
initialise_threads(); |
3610 |
|
3632 |
|
|
|
3633 |
i = sqlzma_init(&un, un.un_lzma, 0); |
3634 |
if (i != Z_OK) { |
3635 |
ERROR("%s:%d: %d\n", __func__, __LINE__, i); |
3636 |
EXIT_MKSQUASHFS(); |
3637 |
} |
3638 |
|
3611 |
if(delete) { |
3639 |
if(delete) { |
3612 |
printf("Creating %s %d.%d filesystem on %s, block size %d.\n", |
3640 |
printf("Creating %s %d.%d filesystem on %s, block size %d.\n", |
3613 |
be ? "big endian" : "little endian", SQUASHFS_MAJOR, s_minor, argv[source + 1], block_size); |
3641 |
be ? "big endian" : "little endian", SQUASHFS_MAJOR, s_minor, argv[source + 1], block_size); |
3614 |
bytes = sizeof(squashfs_super_block); |
3642 |
bytes = sizeof(squashfs_super_block); |
|
|
3643 |
if (sqlzma_opts.try_lzma) |
3644 |
printf("lzmadic %u\n", sqlzma_opts.dicsize); |
3615 |
} else { |
3645 |
} else { |
3616 |
unsigned int last_directory_block, inode_dir_offset, inode_dir_file_size, root_inode_size, |
3646 |
unsigned int last_directory_block, inode_dir_offset, inode_dir_file_size, root_inode_size, |
3617 |
inode_dir_start_block, uncompressed_data, compressed_data, inode_dir_inode_number, |
3647 |
inode_dir_start_block, uncompressed_data, compressed_data, inode_dir_inode_number, |
Lines 3635-3645
printOptions:
Link Here
|
3635 |
|
3665 |
|
3636 |
printf("Appending to existing %s %d.%d filesystem on %s, block size %d\n", be ? "big endian" : |
3666 |
printf("Appending to existing %s %d.%d filesystem on %s, block size %d\n", be ? "big endian" : |
3637 |
"little endian", SQUASHFS_MAJOR, s_minor, argv[source + 1], block_size); |
3667 |
"little endian", SQUASHFS_MAJOR, s_minor, argv[source + 1], block_size); |
|
|
3668 |
if (sqlzma_opts.try_lzma) |
3669 |
printf("lzmadic %u\n", sqlzma_opts.dicsize); |
3638 |
printf("All -be, -le, -b, -noI, -noD, -noF, -check_data, no-duplicates, no-fragments, -always-use-fragments and -exportable options ignored\n"); |
3670 |
printf("All -be, -le, -b, -noI, -noD, -noF, -check_data, no-duplicates, no-fragments, -always-use-fragments and -exportable options ignored\n"); |
3639 |
printf("\nIf appending is not wanted, please re-run with -noappend specified!\n\n"); |
3671 |
printf("\nIf appending is not wanted, please re-run with -noappend specified!\n\n"); |
3640 |
|
3672 |
|
3641 |
compressed_data = inode_dir_offset + inode_dir_file_size & ~(SQUASHFS_METADATA_SIZE - 1); |
3673 |
compressed_data = inode_dir_offset + (inode_dir_file_size & ~(SQUASHFS_METADATA_SIZE - 1)); //?? |
3642 |
uncompressed_data = inode_dir_offset + inode_dir_file_size & (SQUASHFS_METADATA_SIZE - 1); |
3674 |
uncompressed_data = inode_dir_offset + (inode_dir_file_size & (SQUASHFS_METADATA_SIZE - 1)); //?? |
3643 |
|
3675 |
|
3644 |
/* save original filesystem state for restoring ... */ |
3676 |
/* save original filesystem state for restoring ... */ |
3645 |
sfragments = fragments; |
3677 |
sfragments = fragments; |
Lines 3733-3739
printOptions:
Link Here
|
3733 |
dir_scan(&inode, "", scan1_encomp_readdir); |
3765 |
dir_scan(&inode, "", scan1_encomp_readdir); |
3734 |
sBlk.root_inode = inode; |
3766 |
sBlk.root_inode = inode; |
3735 |
sBlk.inodes = inode_count; |
3767 |
sBlk.inodes = inode_count; |
3736 |
sBlk.s_magic = SQUASHFS_MAGIC; |
3768 |
sBlk.s_magic = SQUASHFS_MAGIC_LZMA; |
|
|
3769 |
if (!un.un_lzma) |
3770 |
sBlk.s_magic = SQUASHFS_MAGIC; |
3737 |
sBlk.s_major = SQUASHFS_MAJOR; |
3771 |
sBlk.s_major = SQUASHFS_MAJOR; |
3738 |
sBlk.s_minor = s_minor; |
3772 |
sBlk.s_minor = s_minor; |
3739 |
sBlk.block_size = block_size; |
3773 |
sBlk.block_size = block_size; |
Lines 3762-3768
restore_filesystem:
Link Here
|
3762 |
if(exportable) |
3796 |
if(exportable) |
3763 |
TRACE("sBlk->lookup_table_start 0x%llx\n", sBlk.lookup_table_start); |
3797 |
TRACE("sBlk->lookup_table_start 0x%llx\n", sBlk.lookup_table_start); |
3764 |
|
3798 |
|
3765 |
if(sBlk.no_uids = uid_count) { |
3799 |
sBlk.no_uids = uid_count; |
|
|
3800 |
if(sBlk.no_uids) { |
3766 |
if(!swap) |
3801 |
if(!swap) |
3767 |
write_bytes(fd, bytes, uid_count * sizeof(squashfs_uid), (char *) uids); |
3802 |
write_bytes(fd, bytes, uid_count * sizeof(squashfs_uid), (char *) uids); |
3768 |
else { |
3803 |
else { |
Lines 3776-3782
restore_filesystem:
Link Here
|
3776 |
} else |
3811 |
} else |
3777 |
sBlk.uid_start = 0; |
3812 |
sBlk.uid_start = 0; |
3778 |
|
3813 |
|
3779 |
if(sBlk.no_guids = guid_count) { |
3814 |
sBlk.no_guids = guid_count; |
|
|
3815 |
if(sBlk.no_guids) { |
3780 |
if(!swap) |
3816 |
if(!swap) |
3781 |
write_bytes(fd, bytes, guid_count * sizeof(squashfs_uid), (char *) guids); |
3817 |
write_bytes(fd, bytes, guid_count * sizeof(squashfs_uid), (char *) guids); |
3782 |
else { |
3818 |
else { |
Lines 3819-3824
restore_filesystem:
Link Here
|
3819 |
exportable ? "Exportable " : "", be ? "Big endian" : "Little endian", block_size, |
3855 |
exportable ? "Exportable " : "", be ? "Big endian" : "Little endian", block_size, |
3820 |
noD ? "uncompressed" : "compressed", noI ? "uncompressed" : "compressed", |
3856 |
noD ? "uncompressed" : "compressed", noI ? "uncompressed" : "compressed", |
3821 |
no_fragments ? "no" : noF ? "uncompressed" : "compressed", duplicate_checking ? "" : "not "); |
3857 |
no_fragments ? "no" : noF ? "uncompressed" : "compressed", duplicate_checking ? "" : "not "); |
|
|
3858 |
if (sqlzma_opts.try_lzma) |
3859 |
printf("lzmadic %u\n", sqlzma_opts.dicsize); |
3822 |
printf("Filesystem size %.2f Kbytes (%.2f Mbytes)\n", bytes / 1024.0, bytes / (1024.0 * 1024.0)); |
3860 |
printf("Filesystem size %.2f Kbytes (%.2f Mbytes)\n", bytes / 1024.0, bytes / (1024.0 * 1024.0)); |
3823 |
printf("\t%.2f%% of uncompressed filesystem size (%.2f Kbytes)\n", |
3861 |
printf("\t%.2f%% of uncompressed filesystem size (%.2f Kbytes)\n", |
3824 |
((float) bytes / total_bytes) * 100.0, total_bytes / 1024.0); |
3862 |
((float) bytes / total_bytes) * 100.0, total_bytes / 1024.0); |