#!/bin/sh -e

PLACES="$PLACES /cdrom/live/filesystem.squashfs"
PLACES="$PLACES /cdrom/casper/filesystem.squashfs" # Etch support

squashfs_prepare() {
	modprobe squashfs || true
	modprobe loop || true

	#XXX: OEM Services hack to install squashfs kernel module.
	if [ -f /cdrom/extra/squashfs/squashfs.ko ]
	then
		insmod /cdrom/extra/squashfs/squashfs.ko || true
	fi

	mkdir -p /mnt
	umount /mnt > /dev/null 2>&1 || true
	if ! mount -t squashfs -o loop $place /mnt; then
		error "$place has failed to be mounted as squashfs."
		exit 1
	fi

	cd /mnt
}

squashfs_count() {
	echo `print-inodes /mnt`
}
