thustorage / max

A high-performance file system for multicore CPUs and flash storage
31 stars 11 forks source link

您好,成功编译内核后,在grub界面选择4.2.3max内核进行启动失败,无法进入系统! #5

Open yigexintaibuhaoderen opened 3 weeks ago

yigexintaibuhaoderen commented 3 weeks ago

在grub界面选择4.2.3max内核进行启动后,出现”载入系统内存盘”。但却无法成功进入系统,随后又重新返回grub界面。请问您是否遇到过相似的问题?

liaoxiaojian commented 3 weeks ago

@yigexintaibuhaoderen 你好,没有遇到相似的问题。无法成功进入系统,请问有什么报错没?

yigexintaibuhaoderen commented 3 weeks ago

您好,我通过VM虚拟机分别在ubuntu 19.04 15.10 20.04 进行了内核编译过程 执行make过程中出现: cc1: sorry, unimplemented: ‘-mfentry’ isn’t supported for 32-bit in combination with ‘-fpic’ make[3]: *** [scripts/Makefile.build:294:arch/x86/entry/vdso/vdso32/note.o] 错误 1 make[2]: *** [scripts/Makefile.build:403:arch/x86/entry/vdso] 错误 2 make[1]: *** [scripts/Makefile.build:403:arch/x86/entry] 错误 2 make: *** [Makefile:949:arch/x86] 错误 2 按照报错提示,我修改了Makefile文件,在-mfentry后面添加了-fno-pic,可以正常执行make

随后执行了 make bzImage make modules_install -j24 && make install

update-grub后显示: Sourcing file/etc/default/grub' Sourcing file /etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-6.8.0-40-generic Found initrd image: /boot/initrd.img-6.8.0-40-generic Found linux image: /boot/vmlinuz-5.15.0-25-generic Found initrd image: /boot/initrd.img-5.15.0-25-generic Found linux image: /boot/vmlinuz-4.2.3max Found initrd image: /boot/initrd.img-4.2.3max Found memtest86+ image: /boot/memtest86+.elf Found memtest86+ image: /boot/memtest86+.bin Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry. done 这表示内核已编译安装成功,随后重启选择4.2.3max,便无法进入系统,只能选择其他内核进入。

yigexintaibuhaoderen commented 3 weeks ago

在执行make bzImage 出现 Unsupported relocation type: R_X86_64_PLT32 (4) make[2]: *** [arch/x86/boot/compressed/Makefile:70:arch/x86/boot/compressed/vmlinux.relocs] 错误 1 make[1]: *** [arch/x86/boot/Makefile:111:arch/x86/boot/compressed/vmlinux] 错误 2 make: *** [arch/x86/Makefile:234:bzImage] 错误 2 我按照https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b21ebf2fb4cde1618915a97cc773e287ff49173e 对相应文件进行了修改

liaoxiaojian commented 3 weeks ago

@yigexintaibuhaoderen 虚拟机无法进入4.2.3max,启动内核过程中有啥报错没?

yigexintaibuhaoderen commented 3 weeks ago

@yigexintaibuhaoderen 虚拟机无法进入4.2.3max,启动内核过程中有啥报错没?

没有任何报错 de9512a59ce943b2eb0642ad5849465 选择内核以后出现 a9912d9937751a43cdc1217f7e81e9c 随后回到初始界面 752d27aa49887ee9d917e845f65bced

liaoxiaojian commented 3 weeks ago

@yigexintaibuhaoderen 可能是你给虚拟机编译的initial ramfs有问题。建议在/boot目录下检查下init ramfs的大小

yigexintaibuhaoderen commented 3 weeks ago

@yigexintaibuhaoderen 可能是你给虚拟机编译的initial ramfs有问题。建议在/boot目录下检查下init ramfs的大小

感谢您的解答,还有一点关于源码中的疑问,对于void allocate_data_block(struct f2fs_sb_info *sbi, struct page *page, block_t old_blkaddr, block_t *new_blkaddr, struct f2fs_summary *sum, int type)函数, 我理解的是分配每一个数据块(执行一次allocate_data_block),因此mlog的值在分配每个数据块时都进行了递增,请问这样的理解是否正确?