浏览文件
05-lima-mounts.sh
27 行 · 676 B历史下载| 1 | |
| 2 | |
| 3 | # SPDX-FileCopyrightText: Copyright The Lima Authors |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | |
| 6 | # Populate mounts from the cidata. |
| 7 | # This script is a workaround until nuageinit supports mounts. |
| 8 | |
| 9 | set -eux |
| 10 | |
| 11 | if ! grep -q '#LIMA-START' /etc/fstab; then |
| 12 | "${LIMA_CIDATA_MNT}"/util.FreeBSD/print_cidata_fstab.lua >/etc/fstab.lima.tmp |
| 13 | if [ -s /etc/fstab.lima.tmp ]; then |
| 14 | { |
| 15 | echo "#LIMA-START" |
| 16 | cat /etc/fstab.lima.tmp |
| 17 | echo "#LIMA-END" |
| 18 | } >>/etc/fstab |
| 19 | fi |
| 20 | rm -f /etc/fstab.lima.tmp |
| 21 | fi |
| 22 | |
| 23 | # Run mkdir on every boot, as the mount points may be on tmpfs |
| 24 | awk '/^[^#]/ && $2 != "none" {print $2}' /etc/fstab | while IFS= read -r line; do |
| 25 | mkdir -p "${line}" |
| 26 | done |
| 27 | mount -a |

