You can test version 5.14 if you want
https://github.com/sirlucjan/workbench/tree/master/linux-5.14/uml
Git Clone URL: | https://aur.archlinux.org/linux-usermode.git (read-only, click to copy) |
---|---|
Package Base: | linux-usermode |
Description: | User mode Linux kernel and modules |
Upstream URL: | http://user-mode-linux.sourceforge.net/ |
Keywords: | linux usermode |
Licenses: | GPL2 |
Submitter: | haruue |
Maintainer: | sir_lucjan |
Last Packager: | sir_lucjan |
Votes: | 8 |
Popularity: | 0.083640 |
First Submitted: | 2018-03-07 14:34 (UTC) |
Last Updated: | 2024-11-18 07:55 (UTC) |
You can test version 5.14 if you want
https://github.com/sirlucjan/workbench/tree/master/linux-5.14/uml
I will add at version 5.14
Could you add support for initrd in the config?
diff --git a/PKGBUILD b/PKGBUILD
index 3f97bfd..b0bd672 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -22,7 +22,7 @@ source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${pkgver}.tar.xz"
sha256sums=('330b4c395f858e75ce26a34cc008c121ef8d975736b3ea975ca65081ff93621b'
'SKIP'
- '5b3dc17e96f0e8518549751f690f751de24b20e66853bd650f39c53732ba6889'
+ 'eb210fa0eb1d0a2605e2f5d353163280b93cb1d8a2f21ff86e16bcd4dac76d55'
'05ea4e00d1e99bf8140a21c94e3c42acf17b9debad9c6f5decbe1dd1fe04332c')
validpgpkeys=(
diff --git a/config b/config
index b6b3a63..7b8e56c 100644
--- a/config
+++ b/config
@@ -124,7 +124,15 @@ CONFIG_NET_NS=y
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_SYSFS_DEPRECATED_V2 is not set
# CONFIG_RELAY is not set
-# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_XZ=y
+CONFIG_RD_LZO=y
+CONFIG_RD_LZ4=y
+CONFIG_RD_ZSTD=y
# CONFIG_BOOT_CONFIG is not set
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -1306,8 +1314,28 @@ CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC7 is not set
# CONFIG_LIBCRC32C is not set
# CONFIG_CRC8 is not set
+CONFIG_XXHASH=y
# CONFIG_RANDOM32_SELFTEST is not set
-# CONFIG_XZ_DEC is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_LZ4_DECOMPRESS=y
+CONFIG_ZSTD_DECOMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DECOMPRESS_XZ=y
+CONFIG_DECOMPRESS_LZO=y
+CONFIG_DECOMPRESS_LZ4=y
+CONFIG_DECOMPRESS_ZSTD=y
CONFIG_NO_DMA=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
# CONFIG_DMA_API_DEBUG is not set
Unfortunately, usually UML is not close in config to a "full-fledged" kernel. It is just a testing ground and nothing more.
Thank you! That sent me on the right path of tracking down the problem.
Two things were missing:
The kernel is built without loop device support, and support for most filesystems is also missing. I don't know if this is a problem - I guess I was just expecting a kernel configured closer to the normal Arch Linux kernel.
With the default rootfstype=hostfs
, and without running anything like udevd, /dev
is the host's /dev
. Creating a loop device inside UML without something like udevd requires either mknod
-ing /dev/loop0
or creating it on the host (e.g. with losetup --find
).
Unfortunately if something goes wrong, the error messages are going to be rather misleading, though strace
helps a little.
The reason why files in /proc
were empty was simply that /proc
was also coming from the host. UML hostfs
used the size in stat
(which is always 0 for such virtual files) to count the number of bytes to transfer. mount -t proc proc /proc
fixes this, along with other userspace utilities.
@CyberShadow
Take a look at this and tell me if it works in this scope:
https://christine.website/blog/howto-usermode-linux-2019-07-07
This UML package is compiled in the absolute minimum version and I will rewrite PKGBUILD if needed.
I was hoping of using UML to experiment with in-kernel filesystems implementations. However, not sure what's going wrong, but I can't mount anything inside UML:
$ vmlinux mem=1G root=/dev/root rootfstype=hostfs init=/bin/bash
Core dump limits :
[...]
[root@(none) /]# mount -t tmpfs tmpfs /tmp
[root@(none) /]# cd /tmp
[root@(none) tmp]# truncate -s 256M a
[root@(none) tmp]# mkfs.ext4 -q a
[root@(none) tmp]# mkdir b
[root@(none) tmp]# mount a b
mount: b: mount failed: Operation not permitted.
I get the same "Operation not permitted" error even if vmlinux is running as root on the host. Furthermore, /proc/filesystems
is empty, which doesn't seem right - shouldn't at least hostfs be there?
Will you kindly explain why the lack of a gpg key in your system is reported as an error? If you don't have a key, just add it.
got the following build error (commit 6c8917c19c35):
[... removed for clarity ...]
==> Verifying source file signatures with gpg...
linux-5.5.4.tar ... FAILED (unknown public key 38DBBDC86092693E)
==> ERROR: One or more PGP signatures could not be verified!
got around it by using the --skippgpcheck
flag on makepkg.
Could you make build use more than one thread?
Pinned Comments