Skip to content

Commit

Permalink
Add initcpio instructions for 9p boot
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed Jul 29, 2016
1 parent e013825 commit 42d8c02
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/linux-9p-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,47 @@ CONFIG_9P_FS_POSIX_ACL=y
```

A Dockerfile for this build is here: https://github.com/ysangkok/build-v86-9p-linux

Using initcpio
--------------

This allows you to remount the root file system using 9p. No changes are necessary if you only want to mount a 9p filesystem after booting.

Add the following files:

`/etc/initcpio/hooks/9p_root`

```bash
#!/usr/bin/bash

run_hook() {
mount_handler="mount_9p_root"
}

mount_9p_root() {
msg ":: mounting '$root' on real root (9p)"
if ! mount -t 9p "$root" "$1"; then
echo "You are now being dropped into an emergency shell."
launch_interactive_shell
msg "Trying to continue (this will most likely fail) ..."
fi
}
```

<hr>

`/etc/initcpio/install/9p_root`

```bash
#!/bin/bash
build() {
add_runscript
}
```

Change the following options in `/etc/mkinitcpio.conf`:

```bash
MODULES="virtio_pci 9p 9pnet 9pnet_virtio"
HOOKS="base udev autodetect modconf block filesystems keyboard fsck 9p_root" # appended 9p_root
```

0 comments on commit 42d8c02

Please sign in to comment.