+ if [ "$(id -u)" -ne 0 ]
+ then
+ Error "you are not root"
+ fi
+}
+
+Mount_device ()
+{
+ case "${SNAP_DEV}" in
+ "")
+ # create a temp
+ mount -t tmpfs -o rw tmpfs "${MOUNTP}"
+ ;;
+
+ *)
+ if [ -b "${SNAP_DEV}" ]
+ then
+ try_mount "${SNAP_DEV}" "${MOUNTP}" rw
+ fi
+ ;;
+ esac
+}
+
+Entry_is_modified ()
+{
+ # Returns true if file exists and it is also present in "cow" directory
+ # This means it is modified in respect to read-only media, so it deserve
+ # to be saved
+
+ entry="${1}"
+
+ if [ -e "${entry}" ] || [ -L "${entry}" ]
+ then
+ if [ -e "${DEF_SNAP_COW}/${entry}" ] || [ -L "${DEF_SNAP_COW}/${entry}" ]
+ then
+ return 0
+ fi
+ fi
+ return 1
+}
+
+Do_filelist ()
+{
+ # BUGS: supports only cpio.gz types, and do not handle deleted files yet
+
+ TMP_FILELIST=$1
+ if [ -f "${SNAP_LIST}" ]