diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2023-02-03 08:41:52 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2023-02-03 08:41:52 +0100 |
commit | cb31dfa28b44b9c149417383475e44ce67b670b9 (patch) | |
tree | 12165590e3672650fd889ae5c9c4f7933ad421b1 | |
parent | 17655f8d0d9e298bd4c70023c8468be5911bcc80 (diff) |
Added a function for creating a directory in tempfs
-rw-r--r-- | board/common.sh | 9 | ||||
-rw-r--r-- | board/pulseaudio.sh | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/board/common.sh b/board/common.sh index ecda59d..8153c2b 100644 --- a/board/common.sh +++ b/board/common.sh @@ -6,3 +6,12 @@ remove_text() { echo sed --in-place "s/$2//" $1 sed --in-place "s/$2//" $1 } + +add_tmpfs() { + create_missing_dir "$1" + if ! grep -qE '$1' "${TARGET_DIR}/etc/fstab"; then + cat << __EOF__ >> "${TARGET_DIR}/etc/fstab" +tmpfs $1 tmpfs rw 0 0 +__EOF__ + fi +} diff --git a/board/pulseaudio.sh b/board/pulseaudio.sh index a789bc9..4737a6a 100644 --- a/board/pulseaudio.sh +++ b/board/pulseaudio.sh @@ -5,12 +5,7 @@ ############################## # Create the directory where pulseaudio store its files and put it in tempfs -create_missing_dir "/var/lib/pulse" -if ! grep -qE '/var/lib/pulse' "${TARGET_DIR}/etc/fstab"; then - cat << __EOF__ >> "${TARGET_DIR}/etc/fstab" -tmpfs /var/lib/pulse tmpfs rw 0 0 -__EOF__ -fi +add_tmpfs "/var/lib/pulse" if ! grep -qE '^load-module module-native-protocol-tcp' "${TARGET_DIR}/etc/pulse/system.pa"; then cat << __EOF__ >> "${TARGET_DIR}/etc/pulse/system.pa" |