#!/bin/sh . /lib/partman/lib/base.sh rootfstype=$(df -T /target | grep /target | awk '{print $2}') case $rootfstype in # No swapfile btrfs) if [ ! -f /target/swap/swapfile ]; then return 0 fi ;; *) if [ ! -f /target/swapfile ]; then return 0 fi ;; esac case $rootfstype in btrfs) printf "%-41s %-15s %-7s %-15s %-7s %s\n" /swap/swapfile none swap sw 0 0 >> /target/etc/fstab ;; *) printf "%-41s %-15s %-7s %-15s %-7s %s\n" /swapfile none swap sw 0 0 >> /target/etc/fstab ;; esac