-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvisionfive2.yaml
141 lines (112 loc) · 3.4 KB
/
visionfive2.yaml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
---
steps:
- mkimg: "{{ output }}"
size: 1000M
- mklabel: gpt
device: "{{ output }}"
- mkpart: spl
device: "{{ output }}"
start: 2MiB
end: 4MiB
tag: spl
- mkpart: uboot
device: "{{ output }}"
start: 4MiB
end: 8MiB
tag: uboot
- mkpart: boot
fs-type: 'fat32'
device: "{{ output }}"
start: 8MiB
end: 128MiB
tag: boot
- set_part_flag: "{{ output }}"
flag: boot
tag: boot
- mkpart: root
device: "{{ output }}"
start: 128MiB
end: 100%
tag: root
- kpartx: "{{ output }}"
- mkfs: vfat
partition: boot
label: boot
- mkfs: ext4
partition: root
label: root
- mount: root
- mount: boot
mount-on: root
dirname: '/boot'
- qemu-debootstrap: sid
target: root
mirror: http://deb.debian.org/debian-ports
keyring: /usr/share/keyrings/debian-ports-archive-keyring.gpg
arch: riscv64
- fstab: root
- apt: install
tag: root
packages:
- debian-ports-archive-keyring
- initramfs-tools
- mtd-utils
- ssh
- systemd-timesyncd
- u-boot-menu
- wget
- create-file: /etc/apt/sources.list
contents: |
deb http://deb.debian.org/debian-ports sid main
- create-file: /boot/uEnv.txt
contents: |
kernel_comp_addr_r=0x90000000
kernel_comp_size=0x10000000
- chroot: root
shell: |
mkdir /boot/fw /boot/dtbs
cd /boot/fw
wget https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v2.11.5/u-boot-spl.bin.normal.out
wget https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v2.11.5/visionfive2_fw_payload.img
wget https://raw.githubusercontent.com/thomasdstewart/starfive-visionfive2/main/linux-image-5.15.0-custom_5.15.0-custom-1_riscv64.deb
apt-get install ./linux-image-5.15.0-custom_5.15.0-custom-1_riscv64.deb
rm linux-image-5.15.0-custom_5.15.0-custom-1_riscv64.deb
cp /usr/lib/linux-image-5.15.0-custom/starfive/jh7110-visionfive-v2.dtb /boot/dtbs
echo "U_BOOT_PARAMETERS=\"rw quiet console=ttyS0,115200 earlycon rootwait\"" >> /etc/default/u-boot
echo "U_BOOT_ROOT=\"root=LABEL=root\"" >> /etc/default/u-boot
echo "U_BOOT_FDT=\"dtbs/jh7110-visionfive-v2.dtb\"" >> /etc/default/u-boot
u-boot-update
- chroot: root
shell: |
echo "visionfive2" > /etc/hostname
echo "nameserver 8.8.8.8" > /etc/resolv.conf
- create-file: /etc/network/interfaces.d/end0
contents: |
allow-hotplug end0
iface end0 inet dhcp
- create-file: /etc/network/interfaces.d/end1
contents: |
allow-hotplug end1
iface end1 inet dhcp
- create-file: /etc/systemd/system/generate-ssh-host-keys.service
contents: |
[Unit]
Description=Generate SSH host keys
ConditionPathExistsGlob=!/etc/ssh/ssh_host_*_key
[Service]
Type=oneshot
ExecStart=/usr/sbin/dpkg-reconfigure -fnoninteractive openssh-server
[Install]
RequiredBy=multi-user.target
- chroot: root
shell: |
systemctl enable generate-ssh-host-keys.service
- chroot: root
shell: |
echo "starfive\nstarfive\n" | passwd root
echo "starfive\nstarfive\n" | adduser --comment user user
- chroot: root
shell: |
rm -rf /var/lib/apt/lists
rm -f /etc/machine-id /var/lib/dbus/machine-id
rm -f /etc/ssh/ssh_host_*_key*