diff --git a/arch/wasm/kernel/binfmt_wasm.c b/arch/wasm/kernel/binfmt_wasm.c index b98bb16a2c8864..89bebfe770aa72 100644 --- a/arch/wasm/kernel/binfmt_wasm.c +++ b/arch/wasm/kernel/binfmt_wasm.c @@ -11,16 +11,16 @@ static struct linux_binfmt wasm_format = { static int load_wasm_binary(struct linux_binprm *bprm) { - if (strncmp(bprm->buf, "\0asm", 4)) { - return -ENOEXEC; - } + if (strncmp(bprm->buf, "\0asm", 4)) { + return -ENOEXEC; + } set_binfmt(&wasm_format); finalize_exec(bprm); - // TODO: read file, instantiate module, call with args + // TODO: read file, instantiate module, call with args - BUG(); + BUG(); return 0; } diff --git a/block/bdev.c b/block/bdev.c index 45d3ef363a72df..c27bca4dc66c8c 100644 --- a/block/bdev.c +++ b/block/bdev.c @@ -721,7 +721,6 @@ static int blkdev_get_part(struct block_device *part, fmode_t mode) out_blkdev_put: blkdev_put_whole(bdev_whole(part), mode); - pr_info("%s() = %d\n", __func__, ret); return ret; } @@ -750,8 +749,6 @@ struct block_device *blkdev_get_no_open(dev_t dev) "block device autoloading is deprecated and will be removed.\n"); } - pr_info("inode: %p %i\n", inode, dev); - if (!inode) return NULL; @@ -804,9 +801,8 @@ struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder) return ERR_PTR(ret); bdev = blkdev_get_no_open(dev); - if (!bdev){ - pr_info("%s: no bdev\n", __func__); - return ERR_PTR(-ENXIO);} + if (!bdev) + return ERR_PTR(-ENXIO); disk = bdev->bd_disk; if (mode & FMODE_EXCL) { @@ -859,7 +855,6 @@ struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder) disk_unblock_events(disk); put_blkdev: blkdev_put_no_open(bdev); - pr_info("%s() = %d", __func__, ret); return ERR_PTR(ret); } EXPORT_SYMBOL(blkdev_get_by_dev); @@ -892,8 +887,6 @@ struct block_device *blkdev_get_by_path(const char *path, fmode_t mode, if (error) return ERR_PTR(error); - pr_info("%s: %s -> %d\n", __func__, path, dev); - bdev = blkdev_get_by_dev(dev, mode, holder); if (!IS_ERR(bdev) && (mode & FMODE_WRITE) && bdev_read_only(bdev)) { blkdev_put(bdev, mode); @@ -1000,7 +993,6 @@ int lookup_bdev(const char *pathname, dev_t *dev) if (!may_open_dev(&path)) goto out_path_put; - pr_info("rdev: %p %d %x\n", inode, inode->i_rdev, inode->i_mode); *dev = inode->i_rdev; error = 0; out_path_put: diff --git a/block/partitions/core.c b/block/partitions/core.c index a9ed7a0351fc6d..e4f6f56cadc41c 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -449,7 +449,6 @@ int bdev_add_partition(struct gendisk *disk, int partno, sector_t start, mutex_lock(&disk->open_mutex); if (!disk_live(disk)) { - pr_warn("bdev not live\n"); ret = -ENXIO; goto out; } @@ -581,7 +580,6 @@ static bool blk_add_partition(struct gendisk *disk, part = add_partition(disk, p, from, size, state->parts[p].flags, &state->parts[p].info); - pr_info("add_partition() = %p\n", part); if (IS_ERR(part)) { if (PTR_ERR(part) != -ENXIO) { printk(KERN_ERR " %s: p%d could not be added: %pe\n", @@ -667,9 +665,8 @@ int bdev_disk_changed(struct gendisk *disk, bool invalidate) lockdep_assert_held(&disk->open_mutex); - if (!disk_live(disk)){ - pr_warn("bdev not live\n"); - return -ENXIO;} + if (!disk_live(disk)) + return -ENXIO; rescan: if (disk->open_partitions) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 41ad6ace4fd902..dbbe2cebb89171 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define DEBUG /* * drivers/base/dd.c - The core device/driver interactions. * diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index efd447f1cfff0b..7d320f799ca1e0 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -3,9 +3,6 @@ * * Copyright 2007 Rusty Russell IBM Corporation */ -#define DEBUG -#define pr_fmt(fmt) "vring: " fmt - #include #include #include @@ -1387,7 +1384,7 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq, err = virtqueue_add_indirect_packed(vq, sgs, total_sg, out_sgs, in_sgs, data, gfp); if (err != -ENOMEM) { - // END_USE(vq); + END_USE(vq); return err; } diff --git a/init/do_mounts.c b/init/do_mounts.c index d6517b6623a46d..2d705b9c84007c 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -372,9 +372,7 @@ static int __init do_mount_root(const char *name, const char *fs, strncpy(data_page, data, PAGE_SIZE); } - pr_info("mounting root\n"); ret = init_mount(name, "/root", fs, flags, data_page); - pr_info("init_mount: %d\n", ret); if (ret) goto out; diff --git a/usr/Makefile b/usr/Makefile index cad3407b81b948..bd3dda2d08e406 100644 --- a/usr/Makefile +++ b/usr/Makefile @@ -12,6 +12,12 @@ compress-$(CONFIG_INITRAMFS_COMPRESSION_LZO) := lzo compress-$(CONFIG_INITRAMFS_COMPRESSION_LZ4) := lz4 compress-$(CONFIG_INITRAMFS_COMPRESSION_ZSTD) := zstd +ifndef CONFIG_WASM +obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o + +$(obj)/initramfs_data.o: $(obj)/initramfs_inc_data +endif + ramfs-input := $(CONFIG_INITRAMFS_SOURCE) cpio-data := diff --git a/usr/initramfs_data.S b/usr/initramfs_data.S new file mode 100644 index 00000000000000..cd67edc38797b8 --- /dev/null +++ b/usr/initramfs_data.S @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + initramfs_data includes the compressed binary that is the + filesystem used for early user space. + Note: Older versions of "as" (prior to binutils 2.11.90.0.23 + released on 2001-07-14) dit not support .incbin. + If you are forced to use older binutils than that then the + following trick can be applied to create the resulting binary: + + + ld -m elf_i386 --format binary --oformat elf32-i386 -r \ + -T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o + ld -m elf_i386 -r -o built-in.a initramfs_data.o + + For including the .init.ramfs sections, see include/asm-generic/vmlinux.lds. + + The above example is for i386 - the parameters vary from architectures. + Eventually look up LDFLAGS_BLOB in an older version of the + arch/$(ARCH)/Makefile to see the flags used before .incbin was introduced. + + Using .incbin has the advantage over ld that the correct flags are set + in the ELF header, as required by certain architectures. +*/ + +.section .init.ramfs,"a" +__irf_start: +.incbin "usr/initramfs_inc_data" +__irf_end: +.section .init.ramfs.info,"a" +.globl __initramfs_size +__initramfs_size: +#ifdef CONFIG_64BIT + .quad __irf_end - __irf_start +#else + .long __irf_end - __irf_start +#endif