# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# This file describes the Underhill root file system layout.

# Add the directories used by various things.
slink /bin       /usr/bin  0755 0 0
slink /sbin      /usr/sbin 0755 0 0
dir /dev         0755 0 0
dir /dev/pts     0755 0 0
dir /etc         0755 0 0
dir /proc        0755 0 0
dir /root        0755 0 0
dir /run         0755 0 0
dir /sys         0755 0 0
dir /var         0755 0 0
dir /var/run     0755 0 0
dir /var/tmp     0755 0 0
dir /tmp         1777 0 0
dir /usr         0755 0 0
dir /usr/bin     0755 0 0
dir /usr/sbin    0755 0 0
dir /lib         0755 0 0
dir /lib/modules 0755 0 0

# Kernel modules are loaded in sort order; put them in directories appropriately
# to ensure they are loaded in dependency order.

dir /lib/modules/000    0755 0 0
dir /lib/modules/001    0755 0 0
dir /lib/modules/999    0755 0 0

file /lib/modules/000/pci-hyperv-intf.ko    ${OPENHCL_MODULES_PATH}/kernel/drivers/pci/controller/pci-hyperv-intf.ko  0644 0 0
file /lib/modules/001/pci-hyperv.ko         ${OPENHCL_MODULES_PATH}/kernel/drivers/pci/controller/pci-hyperv.ko       0644 0 0

# Storvsc is last because it sometimes takes a long time to load and should not
# block other device startup.
file /lib/modules/999/hv_storvsc.ko         ${OPENHCL_MODULES_PATH}/kernel/drivers/scsi/hv_storvsc.ko      0644 0 0

# These nodes are needed for early logging before devfs is mounted.
nod /dev/null      0666 0 0 c 1  3
nod /dev/kmsg      0600 0 0 c 1 11
nod /dev/ttyprintk 0600 0 0 c 5  3
slink /dev/console /dev/ttyprintk  0600 0 0

# Add Underhill and its various alternate entrypoints.
file /bin/openvmm_hcl  ${OPENHCL_OPENVMM_PATH}   0755 0 0
slink /underhill-init       /bin/openvmm_hcl 0755 0 0
slink /bin/underhill-crash  /bin/openvmm_hcl 0755 0 0
slink /bin/underhill-dump   /bin/openvmm_hcl 0755 0 0

# The build information
file /etc/underhill-build-info.json  ${OPENHCL_BUILD_INFO}   0644 0 0
file /etc/kernel-build-info.json     ${OPENHCL_KERNEL_METADATA}   0644 0 0
