function setup_ubuntu {
menuentry "\$1" {
loopback loop \$1
+ set maybe_layerfs_path=''
+ for f in minimal.standard.live.squashfs; do
+ if [ -f "(loop)/casper/\$f" ]; then
+ echo " \$f"
+ set maybe_layerfs_path="layerfs-path=\$f"
+ echo "Setting \$maybe_layerfs_path"
+ fi
+ done
echo "Loading kernel..."
- linux (loop)/casper/vmlinuz* layerfs-path=minimal.standard.live.squashfs boot=casper iso-scan/filename=\$1 \$maybe_to_ram \$maybe_quiet
+ linux (loop)/casper/vmlinuz* \$maybe_layerfs_path boot=casper iso-scan/filename=\$1 \$maybe_to_ram \$maybe_quiet
echo "Loading initrd..."
initrd (loop)/casper/initrd*
}