aboutsummaryrefslogtreecommitdiff
path: root/board/common.sh
blob: 8153c2bb2f5258c6d2c7dee8f15a7069636eff8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
create_missing_dir() {
  test -d "${TARGET_DIR}/$1" || mkdir "${TARGET_DIR}/$1"
}

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
}