-
Notifications
You must be signed in to change notification settings - Fork 0
/
orangepi-r1_buster_armhf_vmdb2-0.14.1.yaml
129 lines (101 loc) · 3.47 KB
/
orangepi-r1_buster_armhf_vmdb2-0.14.1.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
# Use like this : sudo vmdb2 orangepi-r1_buster_armhf_vmdb2-0.14.1.yaml --output orangepi-r1_buster_armhf.img --rootfs-tarball buster_armhf_rootfs.tgz --log=stderr
steps:
- mkimg: "{{ output }}"
size: 3G
- mklabel: msdos
device: "{{ output }}"
- mkpart: primary
device: "{{ output }}"
start: 0%
end: 100%
tag: root
- kpartx: "{{ output }}"
- mkfs: ext4
partition: root
- mount: root
- unpack-rootfs: root
- qemu-debootstrap: buster
mirror: http://ftp.de.debian.org/debian
target: root
arch: armhf
components:
- main
- contrib
- non-free
unless: rootfs_unpacked
- apt: install
packages:
- initramfs-tools
tag: root
unless: rootfs_unpacked
- chroot: root
shell: |
echo "deb http://security.debian.org/ buster/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://ftp.de.debian.org/debian buster-updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://ftp.de.debian.org/debian buster-backports main contrib non-free" >> /etc/apt/sources.list
apt-get update
mv /etc/kernel/postinst.d/initramfs-tools /
apt-get install -y -t buster-backports linux-image-armmp-lpae
mv /initramfs-tools /etc/kernel/postinst.d/
unless: rootfs_unpacked
- apt: install
packages:
- flash-kernel
tag: root
unless: rootfs_unpacked
- cache-rootfs: root
unless: rootfs_unpacked
- create-file: /etc/hostname
contents: |+
OrangePiR1
- fstab: root
- create-file: /etc/flash-kernel/db
contents: |+
Machine: Xunlong Orange Pi R1
Kernel-Flavors: armmp armmp-lpae
Boot-Script-Path: /boot/boot.scr
DTB-Id: sun8i-h2-plus-orangepi-r1.dtb
U-Boot-Script-Name: bootscr.sunxi
Required-Packages: u-boot-tools
- create-file: /etc/flash-kernel/machine
contents: |+
Xunlong Orange Pi R1
- root-fs: root
shell: |
mount -o bind /dev/ $ROOT/dev/
- chroot: root
shell: |
sed -i s_errors=remount-ro_noatime,nodiratime,errors=remount-ro_g /etc/fstab
sed -i "s_quiet_root=$(grep ^UUID /etc/fstab | cut -d \ -f 1) net.ifnames=0_g" /etc/default/flash-kernel
update-initramfs -c -k $(ls -l /vmlinuz | sed "s%^.*vmlinuz-\(.*\)$%\1%g")
umount /dev/
rm /etc/flash-kernel/machine
sed -i "s_root:\*:_root::_g" /etc/shadow
- root-fs: root
shell: |
curl -o $ROOT/linux-u-boot-current-orangepi-r1_20.02.1_armhf.deb https://apt.armbian.com/pool/main/l/linux-u-boot-orangepi-r1-current/linux-u-boot-current-orangepi-r1_20.02.1_armhf.deb
- chroot: root
shell: |
dpkg -i linux-u-boot-current-orangepi-r1_20.02.1_armhf.deb
rm linux-u-boot-current-orangepi-r1_20.02.1_armhf.deb
- root-fs: root
shell: |
dd conv=fsync,notrunc if=$ROOT/usr/lib/linux-u-boot-current-orangepi-r1_20.02.1_armhf/u-boot-sunxi-with-spl.bin of={{ output }} bs=1024 seek=8
- create-file: /etc/network/interfaces.d/lo
contents: |+
auto lo
iface lo inet loopback
- create-file: /etc/network/interfaces.d/eth0
contents: |+
auto eth0
iface eth0 inet dhcp
- root-fs: root
shell: |
test -e vmdb2-ansible.yaml || ln -s vmdb2-ansible.yaml.example vmdb2-ansible.yaml
- ansible: root
playbook: vmdb2-ansible.yaml
- root-fs: root
shell: |
diff vmdb2-ansible.yaml.example vmdb2-ansible.yaml && test -L vmdb2-ansible.yaml && rm vmdb2-ansible.yaml
- create-file: /etc/resolv.conf
contents: |