some progress on disk encryption and btrfs

main
Ricard Illa 2022-10-19 15:29:16 +02:00
parent 7f6720185f
commit 7825adce0b
4 changed files with 43 additions and 1 deletions

View File

@ -54,6 +54,12 @@ all:
fstype: "none"
opts: "bind"
passno: "0"
- path: "/mnt/btr_pool"
src: "/dev/mapper/disk0"
fstype: "btrfs"
opts: "subvolid=5,noatime"
passno: "0"
rpi_cfg:
- "enable_uart=1"
- "otg_mode=1"
@ -61,9 +67,13 @@ all:
- name: "WDC WDS400T1R0A"
target: "disk0"
source_uuid: "202c924c-ee53-4321-9efd-1f776e939702"
key: "/luks_key.asc:gpg"
remdev: "/dev/mmcblk0p2"
- name: "Samsung SSD 870"
target: "disk1"
source_uuid: "a243ac31-094c-4fe2-bced-6e4311a16487"
source_uuid: "247ea237-54ce-45d2-9974-04344c06aba4"
key: "/luks_key.asc:gpg"
remdev: "/dev/mmcblk0p2"
caladan:
ansible_host: caladan

View File

@ -0,0 +1,11 @@
#!/sbin/openrc-run
name="btrfs-scan"
depend() {
before localmount
}
start() {
/sbin/btrfs device scan
}

View File

@ -31,3 +31,20 @@
name: dmcrypt
enabled: true
runlevel: boot
- name: copy btrfs-scan init script
copy:
dest: /etc/init.d/btrfs-scan
src: btrfs-scan
mode: '0755'
- name: add btrfs-scan init script to lbu
lbu:
include: /etc/init.d/btrfs-scan
when: use_lbu
- name: enable btrfs-scan at boot
service:
name: btrfs-scan
enabled: true
runlevel: boot

View File

@ -3,5 +3,9 @@
# {{ entry.name }}
target='{{ entry.target }}'
source='/dev/disk/by-uuid/{{ entry.source_uuid }}'
{% if entry.key is defined %}key={{ entry.key }}
{% endif %}
{% if entry.remdev is defined %}remdev={{ entry.remdev }}
{% endif %}
{% endfor %}