#!/bin/sh -e
#
# This script is a part of the live-install package to copy ALT Linux system from LiveCD to harddisk
#
# Copyright (C) 2010-2011 Eugene Prokopiev  <enp@altlinux.org>
# Copyright (C) 2011      Michael Pozhidaev <msp@altlinux.org>

THIS=${0##*/}

ROOTDEV="$1"

if [ -z "$ROOTDEV" ]; then
    echo "$THIS:device with root file system is not specified" >&2
    exit 1
fi

#ROOTFS="$(/usr/bin/fstyp "$ROOTDEV")"
ROOTFS=ext4

/bin/cat << EOF
proc		/proc			proc	nosuid,noexec,gid=proc		0 0
devpts		/dev/pts		devpts	nosuid,noexec,gid=tty,mode=620	0 0
tmpfs		/tmp			tmpfs	nosuid				0 0
$ROOTDEV	/		$ROOTFS	relatime	1 1
EOF

for part in `awk '(NR>2){print $4}' /proc/partitions`; do
    if [ "`fstyp /dev/$part`" = "swap" ]; then
        echo "/dev/$part	swap	swap	defaults	0 0"
    fi
done
