Guest kernel has no ext2 or FAT/vfat, so loop-mounted disk images can't be mounted (pmbootstrap install, SD-card/EFI images)

Open Beginner friendly
#934 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
linux

Research direction

The fix is a kernel config change in guest/kernel/kiri.config: add CONFIG_EXT4_USE_FOR_EXT2=y, CONFIG_VFAT_FS=y, CONFIG_FAT_FS=y and the NLS codepages the issue lists. Check the existing *_FS lines in that file first, then confirm the new options with the kernel's config resolution. Done means a guest booted from the rebuilt kernel lists vfat and ext2 in /proc/filesystems and mounts a loop-attached ext2 image.

Written by the indexing model from the issue text.

Description

Kiri version and system

0.2.2 on macOS 27.2 (Apple silicon), guest kernel 6.18.58

What you did

In a privileged container (a kiri machine … --systemd one, Ubuntu 24.04), with a loop-attached disk image:

cat /proc/filesystems | grep -wE 'ext2|ext4|vfat'
L=$(sudo losetup -f --show -P /var/tmp/part.img)   # MBR image, two partitions
M=$(cat /sys/class/block/$(basename $L)p1/dev)
sudo mknod ${L}p1 b ${M%:*} ${M#*:}
sudo mkfs.ext2 -q -F ${L}p1
sudo mount ${L}p1 /mnt/q
What happened
	ext4
mount: /mnt/q: unknown filesystem type 'ext2'.

vfat isn't in /proc/filesystems either, so a FAT partition can't be mounted at all.

What you expected instead

The partitions mount, as they do on OrbStack with the same steps (its /proc/filesystems lists vfat, ext2 and ext4).

Anything that builds or edits a disk image needs this: pmbootstrap install (postmarketOS) puts the boot partition on ext2, and Raspberry Pi / SD-card / EFI system partitions are FAT.

Anything else

On main (15d40fb), guest/kernel/kiri.config has only PROC, EXT4, EROFS, OVERLAY, FUSE and VIRTIO as *_FS options, plus tmpfs. It has no CONFIG_EXT4_USE_FOR_EXT2, CONFIG_VFAT_FS or CONFIG_FAT_FS. The kernel has no modules, so these can't be loaded at runtime.

A small fix that would cover it:

  • CONFIG_EXT4_USE_FOR_EXT2=y: ext2/ext3 through the ext4 driver that's already built in
  • CONFIG_VFAT_FS=y, with CONFIG_NLS_CODEPAGE_437=y and CONFIG_NLS_ISO8859_1=y (vfat's default codepage and iocharset)

#755 (device mapper / dm-crypt) is in the same area.

Dominant language
Rust
Stars
7.5k
Forks
329
Avg merge
10h 44m
Merged PRs (30d)
347

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libracoder/kiri

All issues in libracoder/kiri

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.