#!/bin/sh

[ -f /target/etc/fstab ] || exit 0

# Don't use tmpfs if a /tmp has already been setup
awk '$2 ~ /^\/tmp/ { exit 1 }' /target/etc/fstab || exit 0

# Don't use it if there is no swap
awk '$3 == "swap" { exit 1 }' /target/etc/fstab && exit 0

# dev, mountpoint, type, options, dump, pass
printf "%-15s %-15s %-7s %-15s %-7s %s\n" tmpfs /tmp tmpfs defaults 0 0 >> /target/etc/fstab
