You are not logged in.

#1 2014-01-08 20:34:46

Rexilion
Member
Registered: 2013-12-23
Posts: 784

[HOWTO] tmpfs as root

This is mostly a howto. But also a request for comments.

What I basically wanted is a tmpfs as / and then boot etc home opt usr and var attached below on a btrfs lv. Create tmp media root mnt as a normal directory (on the root tmpfs). The upside of this setup is that you can mount many of the lv's as ro (alle except for var and home).

I also wanted to use the mkinitcpio infrastructure. But it was apparently not designed for this kind of setup. I spend all morning gazing at it's scripts and infrastructure to finally come up with a nice (non-hacky) way of making this work. This should work across updates!

/etc/mkinitcpio.conf

HOOKS="base udev autodetect modconf lvm2 block filesystems btrfs build_system keyboard fsck shutdown"

I added lvm2 for the tools
I added btrfs for the kernel module
I added build_system as a custom script (more on this below)
I added shutdown since my /usr is seperately mounted (as per wiki instructions)

/etc/initcpio/hooks/build_system

#!/usr/bin/ash

run_hook() {
	poll_block() {
		if echo $1 | grep -q '^/dev'
			then while ! [ -b $1 ]
				do sleep 1s
			done
		fi
	}

	poll_block /dev/mapper/main-swap
	echo $(mountpoint -x /dev/mapper/main-swap) > /sys/power/resume # attempt to remount from swap /dev/mapper/main-swap

	# retrieve fstab for mount parameters, allowing fs changes without rebuilding the initrd
	mkdir /mnt
	poll_block /dev/mapper/main-etc
	mount /dev/mapper/main-etc /mnt -o ro
	cp /mnt/fstab /etc
	umount /mnt

	for i in $(cat /etc/fstab | grep -v '^#' | awk '{ print $2 }' | grep '^/new_root' )
		do mkdir -p $i
		poll_block $(cat /etc/fstab | grep $i | awk '{ print $1 }')
		mount $i
	done

	cd /new_root

	ln -s usr/bin bin
	ln -s usr/lib lib
	ln -s usr/lib lib64 # only required for 64bit
	ln -s usr/sbin sbin

	for i in boot media mnt root tmp
		do mkdir $i
		chmod 755 $i
	done

	chmod 700 root
	chmod 777 tmp
	chmod o+t tmp

	cd /
}

# vim: set ft=sh ts=4 sw=4 et:

Above script does in fact all the magic. Create the tmpfs root and populate it with the lv's I want. Exclude run,proc,sys and dev since these are handled by mkinitcpio itself. Note the fact that it's using the /etc/fstab from the actual main system.

/etc/fstab snippet

# init hd
root				/new_root			tmpfs	noauto,rw,noatime,nodev,size=25%,mode=0755,uid=0,gid=0
/dev/mapper/main-etc		/new_root/etc			btrfs	noauto,ro,noatime,nodev,compress=lzo,space_cache,nosuid
/dev/mapper/main-home		/new_root/home			btrfs	noauto,rw,noatime,nodev,compress=lzo,space_cache,nosuid
/dev/mapper/main-opt		/new_root/opt			btrfs	noauto,ro,noatime,nodev,compress=lzo,space_cache,nosuid
/dev/mapper/main-usr		/new_root/usr			btrfs	noauto,ro,noatime,nodev,compress=lzo,space_cache
/dev/mapper/main-linux--src	/new_root/usr/src/linux-git	btrfs	noauto,rw,noatime,nodev,compress=lzo,space_cache,nosuid
/dev/mapper/main-var		/new_root/var			btrfs	noauto,rw,noatime,nodev,compress=lzo,space_cache,nosuid,noexec

To teach mkinitcpio to include the above build_system script in it's infrastructure, you need to create the following file:
/etc/initcpio/install/build_system

#!/bin/bash

build() {
    add_runscript
}

We done yet? No. The main init script seems to assume that root is always some sort of block device residing under /dev. Took me all morning to work around this. The result?

menuentry 'Archlinux' {
	linux	/bzImage quiet mount_handler=echo
	initrd	/initrd.gz
}

The mkinitcpio parses kernel commandline options (huge codeblock) in init_functions called parse_cmdline. Which is called with /proc/cmdline as it's first parameter. So, adding mount_handler=echo on the kernel commandline omits the default mount handler default_mount_handler which will fail if it's not passed a valid block.

This will allow me to have my insance setup *and* reap the benefits of initrd systemd integration. Nice!

Last edited by Rexilion (2014-01-08 20:35:44)


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#2 2014-01-08 21:25:06

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [HOWTO] tmpfs as root

What's the point of making root tmpfs if you're just going to mount real filesystems on top of it?

Other things...

- Your poll_block function looks like a really poor implementation of resolve_device.
- You have hardcoded references to your own volume names. Not really useful for others. If you want to make this generic, see what the usr hook does at runtime.

I added btrfs for the kernel module

Redundant with the filesystems hook. The btrfs hook is only for initramfs which lack udev and which need to support multi-device filesystems.

adding mount_handler=echo on the kernel commandline omits the default mount handler default_mount_handler which will fail if it's not passed a valid block.

You could easily save the user from having to do this manually by exporting it in your runtime hook. I'd suggest 'true' over 'echo' to avoid spurious output.

This will allow me to have my insance setup *and* reap the benefits of initrd systemd integration. Nice!

But you aren't using systemd in your initramfs...

Offline

#3 2014-01-08 22:02:53

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [HOWTO] tmpfs as root

Thank you for your swift responce and constructive reply.

falconindy wrote:

What's the point of making root tmpfs if you're just going to mount real filesystems on top of it?

It's not that I'm mounting a fs of a real block device on / . I mostly did this to reduce the amount of lv's.

Other things...

falconindy wrote:

- Your poll_block function looks like a really poor implementation of resolve_device.

I know it existed and my implementation is inferior. However, I did not understand it's complete logic at first hence that is why I'm not using it. The whole tents of a second granularity makes things rather complicated. And why is udevd_running being checked? If it's not running, the function would return immediatly (after one last desperate check).

Room for improvement on my side, but this requires some more study to grasp the implications.

falconindy wrote:

- You have hardcoded references to your own volume names. Not really useful for others. If you want to make this generic, see what the usr hook does at runtime.

This is mostly meant as a generic approach to configuring non-logical setups. My example was to demonstrate mkinitcpio's flexibility with regards to these kind of setups.

The /usr hook implicitly assumes that /new_root/etc/fstab is already available. I could adapt my logic to include fsck as well. But since it's all btrfs I did not care.

falconindy wrote:

I added btrfs for the kernel module
Redundant with the filesystems hook. The btrfs hook is only for initramfs which lack udev and which need to support multi-device filesystems.

mkinitcpio did not detect btrfs as a requirement. Adding the btrfs kernel module was done using this method. Otherwise the kernel will simply not know about the filesystem's existence.

falconindy wrote:

adding mount_handler=echo on the kernel commandline omits the default mount handler default_mount_handler which will fail if it's not passed a valid block.
You could easily save the user from having to do this manually by exporting it in your runtime hook. I'd suggest 'true' over 'echo' to avoid spurious output.

Yes, I could have done this in build_system as well. I was not sure if busybox would accept an argument for true. I could have tested that, but this is just to get it running.

Thanks!

falconindy wrote:

This will allow me to have my insance setup *and* reap the benefits of initrd systemd integration. Nice!
But you aren't using systemd in your initramfs...

This was more of a todo thing. According to the wiki:

As of systemd 207, this hook does not work as intended when combined with lvm2 and may break your boot.

I'm holding this off for later. I played with SystemD already and wrote my own unit/service files. This will be something for later.


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#4 2014-01-09 15:09:21

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [HOWTO] tmpfs as root

It's not that I'm mounting a fs of a real block device on / . I mostly did this to reduce the amount of lv's.

But what do you lose by putting / and /usr on the same LV versus mounting / as tmpfs and /usr on top of that? In general, what are you trying to achieve with such fine grained splitting of your filesystem?

And why is udevd_running being checked? If it's not running, the function would return immediatly (after one last desperate check).

If udevd isn't running when resolve_device is called, there's a 99% chance that the device will never show up. Ignoring some edge cases, your /dev is static without udev running. So, waiting is pointless.

mkinitcpio did not detect btrfs as a requirement. Adding the btrfs kernel module was done using this method. Otherwise the kernel will simply not know about the filesystem's existence.

Well, you need to hack around the fact that your root isn't a real filesystem (though you could just include btrfs in MODULES rather than HOOKS). But, your /usr filesystem is btrfs, so mkinitcpio should pick this up, whitelist it, and include it even in images that include autodetect. I'm quite sure this logic works. If it doesn't, let's fix it.

thefuckingwiki wrote:

As of systemd 207, this hook does not work as intended when combined with lvm2 and may break your boot.

The lvm2 hook as it exists right now will never work with systemd (and this has nothing to do with systemd itself). The sd-lvm2 hook exists and is intended for systemd-powered initramfs images.

Offline

#5 2014-01-10 06:40:47

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [HOWTO] tmpfs as root

falconindy wrote:

But what do you lose by putting / and /usr on the same LV versus mounting / as tmpfs and /usr on top of that? In general, what are you trying to achieve with such fine grained splitting of your filesystem?

In this setup, I can mount /usr as ro. If I were to use the /usr as / I would not be easily able to do so since /mnt /root /media would still require rw for mounting / root etc to work. This would require tmpfs mounts for each of these.

Or am I way off here?

falconindy wrote:

And why is udevd_running being checked? If it's not running, the function would return immediatly (after one last desperate check).
If udevd isn't running when resolve_device is called, there's a 99% chance that the device will never show up. Ignoring some edge cases, your /dev is static without udev running. So, waiting is pointless.

I was thinking of other means, like 'lvm vgchange -ay' and all that. This makes sense if you use udev though. One would think a timeout would be sufficient. But this is indeed faster.

falconindy wrote:

Well, you need to hack around the fact that your root isn't a real filesystem (though you could just include btrfs in MODULES rather than HOOKS). But, your /usr filesystem is btrfs, so mkinitcpio should pick this up, whitelist it, and include it even in images that include autodetect. I'm quite sure this logic works. If it doesn't, let's fix it.

It did not work because it was, in fact, a cornercase. I have my own kernel with btrfs build in the current stock arch kernel:

mkinitcpio -g initrd.cpio.gz -k 3.12.6-1-ARCH -S btrfs
gzip -d initrd.cpio.gz
bsdcpio -i < ./initrd.cpio
find . -iname \*btrfs\*

Yields:
./usr/lib/udev/rules.d/64-btrfs.rules

So, it seems to me, that mkinitcpio evaluates the kernel module requirement based on the current running kernel. I have not tested this much though. Not sure if you even want to support this.

thefuckingwiki wrote:

As of systemd 207, this hook does not work as intended when combined with lvm2 and may break your boot.

falconindy wrote:

The lvm2 hook as it exists right now will never work with systemd (and this has nothing to do with systemd itself). The sd-lvm2 hook exists and is intended for systemd-powered initramfs images.

Mixing initcpio hooks should be fairly easy now. When I have time I'll create a back-up and start playing. Thanks!


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#6 2014-01-10 16:36:21

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [HOWTO] tmpfs as root

Or am I way off here?

I'm lost on what the advantage is. Seems needlessly complex.

I have my own kernel with btrfs build in the current stock arch kernel

Not sure what you mean by this. Did you overwrite the -ARCH kernel in place, or did you create a separate build with a new name which lives in its own /usr/lib/modules/... dir? The former means that you get to keep both halves of your broken setup.

So, it seems to me, that mkinitcpio evaluates the kernel module requirement based on the current running kernel.

Nope. Requirements are based on the kernel you're targetting, not the currently running kernel.

I build ext4 into my own kernel and use it for my root. Yet, If i build an image for the -ARCH kernel, I get ext4 as a module as expected:

$ uname -r; zgrep 'EXT4_FS=y' /proc/config.gz
3.12.5-rampage
CONFIG_EXT4_FS=y
$ mkinitcpio -k /boot/vmlinuz-linux -g foo.img -c /dev/null -A base,autodetect,filesystems
...snipped...
$ lsinitcpio foo.img | grep ext4\\.ko
./usr/lib/modules/3.12.6-1-ARCH/kernel/ext4.ko

So, I don't know what you've done without seeing more verbosity. 'mkinitcpio -M -k $kernelver' where $kernelver is a kernel which has btrfs as a module should yield btrfs in the output. There's also the -v flag which gives a lot more detail as to what's included in the build.

Offline

#7 2014-01-11 14:49:00

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [HOWTO] tmpfs as root

(-rampage ? tongue )

[root@Delta ~]# mkinitcpio -k 3.12.6-1-ARCH -g new_init -S btrfs -v
==> Starting build: 3.12.6-1-ARCH
  -> Running build hook: [/usr/lib/initcpio/install/base]
    adding file: /bin/busybox
    adding symlink: /usr/lib/libc.so.6 -> libc-2.18.so
    adding file: /usr/lib/libc-2.18.so
    adding symlink: /lib/ld-linux.so.2 -> ld-2.18.so
    adding file: /usr/lib/ld-2.18.so
    adding symlink: /usr/bin/[ -> busybox
    adding symlink: /usr/bin/[[ -> busybox
    adding symlink: /usr/bin/ash -> busybox
    adding symlink: /usr/bin/awk -> busybox
    adding symlink: /usr/bin/basename -> busybox
    adding symlink: /usr/bin/cat -> busybox
    adding symlink: /usr/bin/chgrp -> busybox
    adding symlink: /usr/bin/chmod -> busybox
    adding symlink: /usr/bin/chown -> busybox
    adding symlink: /usr/bin/chroot -> busybox
    adding symlink: /usr/bin/clear -> busybox
    adding symlink: /usr/bin/cp -> busybox
    adding symlink: /usr/bin/cttyhack -> busybox
    adding symlink: /usr/bin/cut -> busybox
    adding symlink: /usr/bin/dd -> busybox
    adding symlink: /usr/bin/df -> busybox
    adding symlink: /usr/bin/dirname -> busybox
    adding symlink: /usr/bin/dmesg -> busybox
    adding symlink: /usr/bin/du -> busybox
    adding symlink: /usr/bin/echo -> busybox
    adding symlink: /usr/bin/egrep -> busybox
    adding symlink: /usr/bin/env -> busybox
    adding symlink: /usr/bin/expr -> busybox
    adding symlink: /usr/bin/false -> busybox
    adding symlink: /usr/bin/free -> busybox
    adding symlink: /usr/bin/getopt -> busybox
    adding symlink: /usr/bin/grep -> busybox
    adding symlink: /usr/bin/halt -> busybox
    adding symlink: /usr/bin/head -> busybox
    adding symlink: /usr/bin/hexdump -> busybox
    adding symlink: /usr/bin/ifconfig -> busybox
    adding symlink: /usr/bin/init -> busybox
    adding symlink: /usr/bin/install -> busybox
    adding symlink: /usr/bin/ip -> busybox
    adding symlink: /usr/bin/ipaddr -> busybox
    adding symlink: /usr/bin/iplink -> busybox
    adding symlink: /usr/bin/iproute -> busybox
    adding symlink: /usr/bin/iprule -> busybox
    adding symlink: /usr/bin/iptunnel -> busybox
    adding symlink: /usr/bin/kbd_mode -> busybox
    adding symlink: /usr/bin/kill -> busybox
    adding symlink: /usr/bin/killall -> busybox
    adding symlink: /usr/bin/less -> busybox
    adding symlink: /usr/bin/ln -> busybox
    adding symlink: /usr/bin/loadfont -> busybox
    adding symlink: /usr/bin/loadkmap -> busybox
    adding symlink: /usr/bin/losetup -> busybox
    adding symlink: /usr/bin/ls -> busybox
    adding symlink: /usr/bin/md5sum -> busybox
    adding symlink: /usr/bin/mkdir -> busybox
    adding symlink: /usr/bin/mkfifo -> busybox
    adding symlink: /usr/bin/mknod -> busybox
    adding symlink: /usr/bin/mktemp -> busybox
    adding symlink: /usr/bin/mountpoint -> busybox
    adding symlink: /usr/bin/mv -> busybox
    adding symlink: /usr/bin/nc -> busybox
    adding symlink: /usr/bin/netstat -> busybox
    adding symlink: /usr/bin/nslookup -> busybox
    adding symlink: /usr/bin/openvt -> busybox
    adding symlink: /usr/bin/pgrep -> busybox
    adding symlink: /usr/bin/pidof -> busybox
    adding symlink: /usr/bin/ping -> busybox
    adding symlink: /usr/bin/ping6 -> busybox
    adding symlink: /usr/bin/poweroff -> busybox
    adding symlink: /usr/bin/printf -> busybox
    adding symlink: /usr/bin/ps -> busybox
    adding symlink: /usr/bin/pwd -> busybox
    adding symlink: /usr/bin/readlink -> busybox
    adding symlink: /usr/bin/reboot -> busybox
    adding symlink: /usr/bin/rm -> busybox
    adding symlink: /usr/bin/rmdir -> busybox
    adding symlink: /usr/bin/route -> busybox
    adding symlink: /usr/bin/sed -> busybox
    adding symlink: /usr/bin/seq -> busybox
    adding symlink: /usr/bin/setfont -> busybox
    adding symlink: /usr/bin/sh -> busybox
    adding symlink: /usr/bin/sha1sum -> busybox
    adding symlink: /usr/bin/sha256sum -> busybox
    adding symlink: /usr/bin/sha512sum -> busybox
    adding symlink: /usr/bin/sleep -> busybox
    adding symlink: /usr/bin/sort -> busybox
    adding symlink: /usr/bin/stat -> busybox
    adding symlink: /usr/bin/strings -> busybox
    adding symlink: /usr/bin/sync -> busybox
    adding symlink: /usr/bin/tac -> busybox
    adding symlink: /usr/bin/tail -> busybox
    adding symlink: /usr/bin/telnet -> busybox
    adding symlink: /usr/bin/test -> busybox
    adding symlink: /usr/bin/tftp -> busybox
    adding symlink: /usr/bin/touch -> busybox
    adding symlink: /usr/bin/true -> busybox
    adding symlink: /usr/bin/umount -> busybox
    adding symlink: /usr/bin/uname -> busybox
    adding symlink: /usr/bin/uniq -> busybox
    adding symlink: /usr/bin/uptime -> busybox
    adding symlink: /usr/bin/vi -> busybox
    adding symlink: /usr/bin/wc -> busybox
    adding symlink: /usr/bin/wget -> busybox
    adding symlink: /usr/bin/yes -> busybox
    adding file: /usr/sbin/kmod
    adding symlink: /usr/lib/libz.so.1 -> libz.so.1.2.8
    adding file: /usr/lib/libz.so.1.2.8
    adding symlink: /usr/bin/depmod -> kmod
    adding symlink: /usr/bin/insmod -> kmod
    adding symlink: /usr/bin/rmmod -> kmod
    adding symlink: /usr/bin/lsmod -> kmod
    adding symlink: /usr/bin/modprobe -> kmod
    adding symlink: /usr/bin/modinfo -> kmod
    adding file: /usr/sbin/blkid
    adding file: /usr/lib/libblkid.so.1
    adding symlink: /usr/lib/libuuid.so.1 -> libuuid.so.1.3.0
    adding file: /usr/lib/libuuid.so.1.3.0
    adding file: /usr/sbin/mount
    adding symlink: /usr/lib/libmount.so.1 -> libmount.so.1.1.0
    adding file: /usr/lib/libmount.so.1.1.0
    adding file: /usr/sbin/switch_root
    adding file: /init_functions
    adding file: /init
    adding file: /usr/lib/modprobe.d/usb-load-ehci-first.conf
  -> Running build hook: [/usr/lib/initcpio/install/udev]
    adding file: /etc/udev/udev.conf
    adding file: /usr/lib/systemd/systemd-udevd
    adding symlink: /usr/lib/librt.so.1 -> librt-2.18.so
    adding file: /usr/lib/librt-2.18.so
    adding symlink: /usr/lib/libkmod.so.2 -> libkmod.so.2.2.6
    adding file: /usr/lib/libkmod.so.2.2.6
    adding symlink: /usr/lib/libacl.so.1 -> libacl.so.1.1.0
    adding file: /usr/lib/libacl.so.1.1.0
    adding symlink: /usr/lib/libpthread.so.0 -> libpthread-2.18.so
    adding file: /usr/lib/libpthread-2.18.so
    adding symlink: /usr/lib/libattr.so.1 -> libattr.so.1.1.0
    adding file: /usr/lib/libattr.so.1.1.0
    adding file: /usr/bin/udevadm
    adding file: /usr/bin/systemd-tmpfiles
    adding symlink: /usr/lib/libcap.so.2 -> libcap.so.2.24
    adding file: /usr/lib/libcap.so.2.24
    adding file: /usr/lib/udev/rules.d/50-udev-default.rules
    adding file: /usr/lib/udev/rules.d/60-persistent-storage.rules
    adding file: /usr/lib/udev/rules.d/64-btrfs.rules
    adding file: /usr/lib/udev/rules.d/80-drivers.rules
    adding file: /usr/lib/udev/ata_id
    adding file: /usr/lib/udev/scsi_id
    adding file: /hooks/udev
  -> Running build hook: [/usr/lib/initcpio/install/autodetect]
    caching 25 modules
  -> Running build hook: [/usr/lib/initcpio/install/modconf]
    adding dir: /etc/modprobe.d
    adding file: /usr/lib/modprobe.d/bluetooth-usb.conf
    overwriting file: /usr/lib/modprobe.d/usb-load-ehci-first.conf
  -> Running build hook: [/usr/lib/initcpio/install/lvm2]
    adding module: dm-mod
    adding module: dm-snapshot
    adding module: dm-log
    adding module: dm-region-hash
    adding module: dm-mirror
    adding file: /usr/bin/lvm
    adding symlink: /usr/lib/libudev.so.1 -> libudev.so.1.4.0
    adding file: /usr/lib/libudev.so.1.4.0
    adding symlink: /usr/lib/libdl.so.2 -> libdl-2.18.so
    adding file: /usr/lib/libdl-2.18.so
    adding file: /usr/lib/libdevmapper-event.so.1.02
    adding file: /usr/lib/libdevmapper.so.1.02
    adding symlink: /usr/lib/libreadline.so.6 -> libreadline.so.6.2
    adding file: /usr/lib/libreadline.so.6.2
    adding symlink: /usr/lib/libncursesw.so.5 -> libncursesw.so.5.9
    adding file: /usr/lib/libncursesw.so.5.9
    adding file: /usr/bin/lvmetad
    adding file: /usr/bin/dmsetup
    adding file: /usr/lib/udev/rules.d/10-dm.rules
    adding file: /usr/lib/udev/rules.d/13-dm-disk.rules
    adding file: /usr/lib/udev/rules.d/95-dm-notify.rules
    adding file: /usr/lib/udev/rules.d/11-dm-lvm.rules
    adding file: /usr/lib/udev/rules.d/69-dm-lvm-metad.rules
    adding file: /usr/lib/udev/rules.d/11-dm-initramfs.rules
    adding file: /etc/lvm/lvm.conf
    adding file: /hooks/lvm2
  -> Running build hook: [/usr/lib/initcpio/install/block]
    adding module: scsi_mod
    adding module: sd_mod
    adding module: cdrom
    adding module: sr_mod
    adding module: floppy
    adding module: libata
    adding module: pata_via
    adding module: pata_acpi
    adding module: ata_generic
    adding module: usb-common
    adding module: usbcore
    adding module: ehci-hcd
    adding module: ehci_pci
    adding module: uhci_hcd
    adding module: usb_storage
  -> Running build hook: [/usr/lib/initcpio/install/filesystems]
  -> Running build hook: [/etc/initcpio/install/build_system]
    adding file: /hooks/build_system
  -> Running build hook: [/usr/lib/initcpio/install/keyboard]
    adding module: hid
    adding module: hid_generic
    adding module: usbhid
  -> Running build hook: [/usr/lib/initcpio/install/fsck]
==> ERROR: file not found: `fsck.tmpfs'
==> WARNING: No fsck helpers found. fsck will not be run on boot.
  -> Running build hook: [/usr/lib/initcpio/install/shutdown]
    overwriting file: /usr/sbin/cp
    adding file: /usr/sbin/lsblk
    adding file: /usr/sbin/findmnt
    overwriting file: /usr/sbin/umount
    adding file: /shutdown
    adding file: /hooks/shutdown
==> Generating module dependencies
==> Creating gzip initcpio image: /root/new_init
17191 blocks
==> WARNING: errors were encountered during the build. The image may not be complete.
[root@Delta ~]# ls
new_init
[root@Delta ~]# ls new_init | grep -i btrfs
[root@Delta ~]# lsmkinitcpio new_init | grep -i btrfs
bash: lsmkinitcpio: opdracht niet gevonden
[root@Delta ~]# lsinitcpio new_init | grep -i btrfs
./usr/lib/udev/rules.d/64-btrfs.rules
[root@Delta ~]# uname -r
3.13.0-rc7-00055-gef350bb

I disabled the btrfs module as autodetect would still add it (right?).


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#8 2014-01-11 18:51:19

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [HOWTO] tmpfs as root

I think I know why btrfs is not included -> I build my kernel without modules, so hence no /lib/modules/$(uname -r) containing the necessary files.

EDIT: Wait, that cannot be it since the ARCH target kernel is build with modules. Nevermind.

Last edited by Rexilion (2014-01-11 18:51:57)


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#9 2014-01-11 19:45:54

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [HOWTO] tmpfs as root

What does 'findmnt -uno fstype /' show from your custom kernel?

Offline

#10 2014-01-12 07:01:02

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [HOWTO] tmpfs as root

[root@Charlie ~]# findmnt -uno fstype /
tmpfs
[root@Charlie ~]# findmnt -uno fstype /var
btrfs
[root@Charlie ~]# findmnt -uno fstype /etc
btrfs

fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

Board footer

Powered by FluxBB