#!/bin/sh ######################################################################## ## ## This script will read /etc/fstab and create an ## equivalent key tree under $ROOT. ## ## The correct way to run it is: ## ## # ./convert-fstab > fstab.xml ## # kdb import fstab.xml ## ## ## To make tests you can do: ## ## $ ROOT=user/test ./convert-fstab ## ## Avi Alkalay ## April 2004 ## ## $Id$ ## ######################################################################## [ -z "$ROOT" ] && ROOT="system/filesystems" num=0 echo "" cat /etc/fstab | while read dev mpoint type options dumpfreq passno; do expr match "$dev" '#.*' > /dev/null && continue test $dev || continue case "$mpoint" in "none") num=$(( $num + 1 )) fsname="$type$num" ;; '/') fsname="roofs" ;; *) fsname=`echo $mpoint | sed -e 's^/^^g'` ;; esac echo " " echo " Device or Label" echo " Mount Point" echo " Filesystem type. See fs(5)" echo " Filesystem specific options. See mount(8)" echo " Dump frequency in days" echo " Pass number on parallel fsck" echo " " echo done echo ""