-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhosts.yml
90 lines (78 loc) · 3.57 KB
/
hosts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
all:
hosts:
# Device "foo" with the following features:
# - Bluetooth PAN
# - Ethernet over USB
foo.local:
bt_pan: # default CIDR: 10.11.10.10/29
usb_gadget:
ethernet: # default CIDR: 10.10.10.10/29
serial:
# Device "bar" with everything configurable configured
bar.local:
bt_pan:
cidr: 10.11.10.20/29
devices:
- { mac: 00:11:22:33:44:55, pin: '*', trusted: true }
- { mac: 66:77:88:99:00:11, pin: '1234' }
options:
# Class syntax, see https://www.ampedrftech.com/datasheets/cod_definition.pdf
# 0x0104: Computer, 0x0108: Server, 0x020c: Smartphone, 0x0300: LAN / Access point
- { option: Class, value: "0x0108" }
- { option: DiscoverableTimeout, value: "0" } # unit: seconds, 0 = always discoverable, default: 180
device_info:
model: MacPro7,1@ECOLOR=226,226,224
pretty_hostname: Pretty Pi
usb_gadget:
# Allowed values: host, peripheral, otg
# Default: unset, which behaves like otg
# Best explained at http://trac.gateworks.com/wiki/linux/OTG#OTGModeselection
# In short:
# - Use 'peripheral' to force the USB controller to
# act as a USB device with the configured gadget functions.
# - Leave unset or use 'otg' to have the USB controller
# act as a USB device if connected with a regular USB cable, and
# as a USB host if connected with a USB OTG cable.
# - Using 'host' makes no sense as that would render
# setting up USB gadget functions useless.
dr_mode: peripheral
product: "Pretty Pi Appliance" # default: device model, for example "Raspberry Pi Zero W Rev 1.1"
manufacturer: "Pretty Pi Foundation" # default: "Raspberry Pi Foundation"
serialnumber: "1234567890" # default: MD5 of CPU serial
ethernet:
cidr: 10.10.10.20/29
# MAC address for the Raspberry Pi's network interface, default: random
device_mac: 11:11:11:11:11:11
# MAC address for the host's network interface, default: random
host_mac: 22:22:22:22:22:22
serial: # no further options
# Custom mass_storage function,
# see kernel.org/doc/html/latest/usb/gadget-testing.html#mass-storage-function.
# - The value can be an inline script or the path to a script file.
# - The script is responsible to set the function up.
# - The working directory is the already created function directory,
# for example /sys/kernel/config/usb_gadget/g1/functions/mass_storage.usb0
# - Steps that have to be run after the gadget is enabled, need to be
# printed to FD1 (stdout).
mass_storage: |
#!/usr/bin/env bash
# create disk image
if [ ! -f /data/hdd.img ]; then
mkdir -p /data
fallocate -l 1GB /data/hdd.img
mkfs.exfat -v -L 'RaspiDrive' -f /data/hdd.img
fi
# create mass storage gadget,
echo 1 >stall
echo /data/hdd.img > lun.0/file
echo 'SanDisk Cruzer Edge 1.20' > lun.0/inquiry_string
echo 1 > lun.0/removable
# post enable step: echo "Storage enabled"
cat <<POST_ENABLE
echo "Storage enabled"
POST_ENABLE
# Custom HDMI settings applied to /boot/config.txt
hdmi: { group: 2, mode: 87, cvt: 800 480 60 6 0 0 0, drive: 1 } # HAMTYSAN 7-inch display
# No splash screen
plymouth_theme: false