Skip to content
TEAMOL edited this page Apr 11, 2024 · 1 revision

Welcome to the squashfs-tools wiki! 【How can I compile squashfs into linux kernel 4.18?】 root@bytedance:/0-PXEMaker/linux-5.4.210# make bzImage -j 12 HOSTCC scripts/kconfig/conf.o HOSTLD scripts/kconfig/conf scripts/kconfig/conf --syncconfig Kconfig fs/squashfs/Kconfig:42:warning: choice value used outside its choice group fs/squashfs/Kconfig:48:warning: choice value used outside its choice group fs/squashfs/Kconfig:68:warning: choice value used outside its choice group fs/squashfs/Kconfig:75:warning: choice value used outside its choice group fs/squashfs/Kconfig:89:warning: choice value used outside its choice group DESCEND objtool CALL scripts/atomic/check-atomics.sh CALL scripts/checksyscalls.sh CHK include/generated/compile.h CC lib/zstd/huf_decompress.o CC fs/squashfs/block.o CC lib/zstd/decompress.o CC fs/squashfs/cache.o CC fs/squashfs/dir.o CC fs/squashfs/export.o CC fs/squashfs/file.o CC fs/squashfs/fragment.o CC lib/zstd/entropy_common.o fs/squashfs/block.c: In function ‘squashfs_read_data’: fs/squashfs/block.c:120:24: warning: passing argument 3 of ‘ll_rw_block’ makes integer from pointer without a cast [-Wint-conversion] ll_rw_block(READ, b, bh); ^~ In file included from fs/squashfs/block.c:34: ./include/linux/buffer_head.h:201:28: note: expected ‘int’ but argument is of type ‘struct buffer_head **’ void ll_rw_block(int, int, int, struct buffer_head * bh[]); ^~~ fs/squashfs/block.c:120:3: error: too few arguments to function ‘ll_rw_block’ ll_rw_block(READ, b, bh); ^~~~~~~~~~~ In file included from fs/squashfs/block.c:34: ./include/linux/buffer_head.h:201:6: note: declared here void ll_rw_block(int, int, int, struct buffer_head * bh[]); ^~~~~~~~~~~ fs/squashfs/block.c:152:31: warning: passing argument 3 of ‘ll_rw_block’ makes integer from pointer without a cast [-Wint-conversion] ll_rw_block(READ, b - 1, bh + 1); ~~~^~~ In file included from fs/squashfs/block.c:34: ./include/linux/buffer_head.h:201:28: note: expected ‘int’ but argument is of type ‘struct buffer_head *’ void ll_rw_block(int, int, int, struct buffer_head * bh[]); ^~~ fs/squashfs/block.c:152:3: error: too few arguments to function ‘ll_rw_block’ ll_rw_block(READ, b - 1, bh + 1); ^~~~~~~~~~~ In file included from fs/squashfs/block.c:34: ./include/linux/buffer_head.h:201:6: note: declared here void ll_rw_block(int, int, int, struct buffer_head * bh[]); ^~~~~~~~~~~ fs/squashfs/block.c:189:31: error: ‘PAGE_CACHE_SIZE’ undeclared (first use in this function); did you mean ‘VMACACHE_SIZE’? msblk->stream.avail_out = PAGE_CACHE_SIZE; ^~~~~~~~~~~~~~~ VMACACHE_SIZE fs/squashfs/block.c:189:31: note: each undeclared identifier is reported only once for each function it appears in In file included from ./include/linux/printk.h:7, from ./include/linux/kernel.h:15, from ./include/linux/list.h:9, from ./include/linux/wait.h:7, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from fs/squashfs/block.c:29: ./include/linux/kern_levels.h:5:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘uLong’ {aka ‘long unsigned int’} [-Wformat=] #define KERN_SOH "\001" / ASCII Start Of Header / ^~~~~~ ./include/linux/kern_levels.h:11:18: note: in expansion of macro ‘KERN_SOH’ #define KERN_ERR KERN_SOH "3" / error conditions / ^~~~~~~~ ./include/linux/printk.h:299:9: note: in expansion of macro ‘KERN_ERR’ printk(KERN_ERR pr_fmt(fmt), ##VA_ARGS) ^~~~~~~~ fs/squashfs/squashfs.h:26:27: note: in expansion of macro ‘pr_err’ #define ERROR(s, args...) pr_err("SQUASHFS error: "s, ## args) ^~~~~~ fs/squashfs/block.c:211:4: note: in expansion of macro ‘ERROR’ ERROR("zlib_inflate returned unexpected result" ^~~~~ fs/squashfs/block.c:212:37: note: format string is defined here " 0x%x, srclength %d, avail_in %d," ~^ %ld In file included from ./include/linux/printk.h:7, from ./include/linux/kernel.h:15, from ./include/linux/list.h:9, from ./include/linux/wait.h:7, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from fs/squashfs/block.c:29: ./include/linux/kern_levels.h:5:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘uLong’ {aka ‘long unsigned int’} [-Wformat=] #define KERN_SOH "\001" / ASCII Start Of Header / ^~~~~~ ./include/linux/kern_levels.h:11:18: note: in expansion of macro ‘KERN_SOH’ #define KERN_ERR KERN_SOH "3" / error conditions */ ^~~~~~~~ ./include/linux/printk.h:299:9: note: in expansion of macro ‘KERN_ERR’ printk(KERN_ERR pr_fmt(fmt), ##VA_ARGS) ^~~~~~~~ fs/squashfs/squashfs.h:26:27: note: in expansion of macro ‘pr_err’ #define ERROR(s, args...) pr_err("SQUASHFS error: "s, ## args) ^~~~~~ fs/squashfs/block.c:211:4: note: in expansion of macro ‘ERROR’ ERROR("zlib_inflate returned unexpected result" ^~~~~ fs/squashfs/block.c:213:18: note: format string is defined here " avail_out %d\n", zlib_err, srclength, ~^ %ld In file included from ./include/linux/list.h:9, from ./include/linux/wait.h:7, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from fs/squashfs/block.c:29: ./include/linux/kernel.h:866:2: error: first argument to ‘__builtin_choose_expr’ not a constant __builtin_choose_expr(__safe_cmp(x, y),
^~~~~~~~~~~~~~~~~~~~~ ./include/linux/kernel.h:934:27: note: in expansion of macro ‘__careful_cmp’ #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) ^~~~~~~~~~~~~ fs/squashfs/block.c:247:13: note: in expansion of macro ‘min_t’ avail = min_t(int, in, PAGE_CACHE_SIZE - ^~~~~ make[2]: *** [scripts/Makefile.build:262: fs/squashfs/block.o] Error 1 make[2]: *** Waiting for unfinished jobs.... CC lib/zstd/fse_decompress.o fs/squashfs/dir.c: In function ‘squashfs_readdir’: fs/squashfs/dir.c:106:30: error: ‘struct file’ has no member named ‘f_dentry’; did you mean ‘f_owner’? struct inode inode = file->f_dentry->d_inode; ^~~~~~~~ f_owner fs/squashfs/dir.c: At top level: fs/squashfs/dir.c:234:3: error: ‘const struct file_operations’ has no member named ‘readdir’; did you mean ‘read’? .readdir = squashfs_readdir ^~~~~~~ read fs/squashfs/dir.c:234:13: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init] .readdir = squashfs_readdir ^~~~~~~~~~~~~~~~ fs/squashfs/dir.c:234:13: note: (near initialization for ‘squashfs_dir_ops’) fs/squashfs/dir.c:234:13: error: initialization of ‘ssize_t ()(struct file *, const char *, size_t, loff_t )’ {aka ‘long int ()(struct file *, const char *, long unsigned int, long long int )’} from incompatible pointer type ‘int ()(struct file *, void , int ()(struct dir_context *, const char , int, loff_t, u64, unsigned int))’ {aka ‘int ()(struct file *, void , int ()(struct dir_context *, const char *, int, long long int, long long unsigned int, unsigned int))’} [-Werror=incompatible-pointer-types] fs/squashfs/dir.c:234:13: note: (near initialization for ‘squashfs_dir_ops.write’) CC lib/zstd/zstd_common.o cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:262: fs/squashfs/dir.o] Error 1 fs/squashfs/export.c: In function ‘squashfs_read_inode_lookup_table’: fs/squashfs/export.c:133:23: error: implicit declaration of function ‘kmalloc’; did you mean ‘vmalloc’? [-Werror=implicit-function-declaration] inode_lookup_table = kmalloc(length, GFP_KERNEL); ^~~~~~~ vmalloc fs/squashfs/export.c:133:21: warning: assignment to ‘__le64 *’ {aka ‘long long unsigned int *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion] inode_lookup_table = kmalloc(length, GFP_KERNEL); ^ fs/squashfs/export.c:143:3: error: implicit declaration of function ‘kfree’; did you mean ‘vfree’? [-Werror=implicit-function-declaration] kfree(inode_lookup_table); ^~~~~ vfree cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:262: fs/squashfs/export.o] Error 1 fs/squashfs/file.c: In function ‘read_indexes’: fs/squashfs/file.c:179:26: error: ‘PAGE_CACHE_SIZE’ undeclared (first use in this function); did you mean ‘VMACACHE_SIZE’? __le32 *blist = kmalloc(PAGE_CACHE_SIZE, GFP_KERNEL); ^~~~~~~~~~~~~~~ VMACACHE_SIZE fs/squashfs/file.c:179:26: note: each undeclared identifier is reported only once for each function it appears in In file included from ./include/linux/list.h:9, from ./include/linux/wait.h:7, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from fs/squashfs/file.c:43: ./include/linux/kernel.h:866:2: error: first argument to ‘__builtin_choose_expr’ not a constant __builtin_choose_expr(__safe_cmp(x, y),
^~~~~~~~~~~~~~~~~~~~~ ./include/linux/kernel.h:934:27: note: in expansion of macro ‘__careful_cmp’ #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) ^~~~~~~~~~~~~ fs/squashfs/file.c:187:16: note: in expansion of macro ‘min_t’ int blocks = min_t(int, n, PAGE_CACHE_SIZE >> 2); ^~~~~ fs/squashfs/file.c: In function ‘squashfs_readpage’: fs/squashfs/file.c:383:39: error: ‘PAGE_CACHE_SHIFT’ undeclared (first use in this function); did you mean ‘L1_CACHE_SHIFT’? int mask = (1 << (msblk->block_log - PAGE_CACHE_SHIFT)) - 1; ^~~~~~~~~~~~~~~~ L1_CACHE_SHIFT fs/squashfs/cache.c: In function ‘squashfs_cache_init’: fs/squashfs/cache.c:254:31: error: ‘PAGE_CACHE_SHIFT’ undeclared (first use in this function); did you mean ‘L1_CACHE_SHIFT’? cache->pages = block_size >> PAGE_CACHE_SHIFT; ^~~~~~~~~~~~~~~~ L1_CACHE_SHIFT fs/squashfs/cache.c:254:31: note: each undeclared identifier is reported only once for each function it appears in fs/squashfs/file.c:392:44: error: ‘PAGE_CACHE_SIZE’ undeclared (first use in this function); did you mean ‘VMACACHE_SIZE’? if (page->index >= ((i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> ^~~~~~~~~~~~~~~ VMACACHE_SIZE fs/squashfs/file.c:453:28: warning: left-hand operand of comma expression has no effect [-Wunused-value] bytes -= PAGE_CACHE_SIZE, offset += PAGE_CACHE_SIZE) { ^ In file included from ./include/linux/list.h:9, from ./include/linux/wait.h:7, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from fs/squashfs/file.c:43: ./include/linux/kernel.h:866:2: error: first argument to ‘__builtin_choose_expr’ not a constant __builtin_choose_expr(__safe_cmp(x, y),
^~~~~~~~~~~~~~~~~~~~~ ./include/linux/kernel.h:934:27: note: in expansion of macro ‘__careful_cmp’ #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) ^~~~~~~~~~~~~ fs/squashfs/file.c:455:28: note: in expansion of macro ‘min_t’ int avail = sparse ? 0 : min_t(int, bytes, PAGE_CACHE_SIZE); ^~~~~ fs/squashfs/file.c:468:37: error: ‘KM_USER0’ undeclared (first use in this function); did you mean ‘SI_USER’? pageaddr = kmap_atomic(push_page, KM_USER0); ^~~~~~~~ SI_USER fs/squashfs/file.c:468:14: error: too many arguments to function ‘kmap_atomic’ pageaddr = kmap_atomic(push_page, KM_USER0); ^~~~~~~~~~~ In file included from ./include/linux/pagemap.h:11, from fs/squashfs/file.c:48: ./include/linux/highmem.h:91:21: note: declared here static inline void *kmap_atomic(struct page *page) ^~~~~~~~~~~ fs/squashfs/file.c:471:35: error: macro "kunmap_atomic" passed 2 arguments, but takes just 1 kunmap_atomic(pageaddr, KM_USER0); ^ fs/squashfs/file.c:471:3: error: ‘kunmap_atomic’ undeclared (first use in this function); did you mean ‘kmap_atomic’? kunmap_atomic(pageaddr, KM_USER0); ^~~~~~~~~~~~~ kmap_atomic fs/squashfs/cache.c:273:29: error: ‘PAGE_CACHE_SIZE’ undeclared (first use in this function); did you mean ‘VMACACHE_SIZE’? entry->data[j] = kmalloc(PAGE_CACHE_SIZE, GFP_KERNEL); ^~~~~~~~~~~~~~~ VMACACHE_SIZE fs/squashfs/file.c:477:4: error: implicit declaration of function ‘page_cache_release’; did you mean ‘pagecache_get_page’? [-Werror=implicit-function-declaration] page_cache_release(push_page); ^~~~~~~~~~~~~~~~~~ pagecache_get_page fs/squashfs/file.c:488:13: error: too many arguments to function ‘kmap_atomic’ pageaddr = kmap_atomic(page, KM_USER0); ^~~~~~~~~~~ In file included from ./include/linux/pagemap.h:11, from fs/squashfs/file.c:48: ./include/linux/highmem.h:91:21: note: declared here static inline void *kmap_atomic(struct page *page) ^~~~~~~~~~~ fs/squashfs/file.c:490:34: error: macro "kunmap_atomic" passed 2 arguments, but takes just 1 kunmap_atomic(pageaddr, KM_USER0); ^ fs/squashfs/cache.c: In function ‘squashfs_copy_data’: fs/squashfs/cache.c:305:37: error: ‘PAGE_CACHE_SIZE’ undeclared (first use in this function); did you mean ‘VMACACHE_SIZE’? void *buff = entry->data[offset / PAGE_CACHE_SIZE] ^~~~~~~~~~~~~~~ VMACACHE_SIZE In file included from ./include/linux/list.h:9, from ./include/linux/wait.h:7, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from fs/squashfs/cache.c:47: ./include/linux/kernel.h:866:2: error: first argument to ‘__builtin_choose_expr’ not a constant __builtin_choose_expr(__safe_cmp(x, y),
^~~~~~~~~~~~~~~~~~~~~ ./include/linux/kernel.h:934:27: note: in expansion of macro ‘__careful_cmp’ #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) ^~~~~~~~~~~~~ fs/squashfs/cache.c:307:15: note: in expansion of macro ‘min_t’ int bytes = min_t(int, entry->length - offset, ^~~~~ cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:262: fs/squashfs/file.o] Error 1 fs/squashfs/cache.c: In function ‘squashfs_read_table’: fs/squashfs/cache.c:400:24: error: ‘PAGE_CACHE_SIZE’ undeclared (first use in this function); did you mean ‘VMACACHE_SIZE’? int pages = (length + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; ^~~~~~~~~~~~~~~ VMACACHE_SIZE fs/squashfs/cache.c:400:48: error: ‘PAGE_CACHE_SHIFT’ undeclared (first use in this function); did you mean ‘L1_CACHE_SHIFT’? int pages = (length + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; ^~~~~~~~~~~~~~~~ L1_CACHE_SHIFT make[2]: *** [scripts/Makefile.build:262: fs/squashfs/cache.o] Error 1 make[1]: *** [scripts/Makefile.build:497: fs/squashfs] Error 2 make: *** [Makefile:1734: fs] Error 2 make: *** Waiting for unfinished jobs.... CC lib/xxhash.o AR lib/zstd/built-in.a AR lib/built-in.a root@bytedance:/0-PXEMaker/linux-5.4.210#

Clone this wiki locally