Page 1 of 1

I created a script to write a blank save file (borrowed from sandbox-rw.sh)

Posted: Sat Nov 14, 2020 9:28 am
by s243a

I created a script to write a blank save file.

I borrowed the code from sandbox-rw.sh which is part of the root-fs on woof-CE.

Why I wanted to do this is because I'm running Linux on a ntfs system and I didn't want to extract linux code to a windows file system. I also didn't want to fill up my save fill with stuff that wasn't relevant to the functioning of the OS. You can mount this newly created save file and read/write to it like it's a separate file system.

So far I only tested the script without options, and don't output any usage or help messages.


Re: I created a script to write a blank save file (borrowed from sandbox-rw.sh)

Posted: Sat Nov 14, 2020 2:10 pm
by taersh

You should do

Code: Select all

gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders

to make sure it can be used to choose/load at boot.

This is how I do it:

$1 = path, name and suffix of the save file
$2 = size of the save file
$3 = suffix of the save file

# Create the save file

dd if=/dev/zero of=$1 bs=1M count=$2
yes y | mkfs.$3 $1
sync

# Update the save file
mkdir /tmp/mnt
mount -o loop "$1" /tmp/mnt
mkdir -p /tmp/mnt/etc/gtk-2.0
gdk-pixbuf-query-loaders > /tmp/mnt/etc/gtk-2.0/gdk-pixbuf.loaders
umount /tmp/mnt
rm -r /tmp/mnt


Re: I created a script to write a blank save file (borrowed from sandbox-rw.sh)

Posted: Sat Nov 14, 2020 8:21 pm
by williams2

You can make files with a mountable file system in the file for general purpose use, the file does not need to be mounted as a savefile in an aufs layered file system. The file can be on any file system, including ntfs or fat32.
Any Linux OS can do this, not just Puppy.

For example:

Code: Select all

# dd if=/dev/zero of=/mnt/home/tmp.3fs bs=1M count=1024
# mkfs.ext3 /mnt/home/tmp.3fs
# mount-FULL -o loop /mnt/home/tmp.3fs /mnt/data/
# df -h /mnt/data/
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop3      976M  1.3M  924M   1% /mnt/data
# umount-FULL /mnt/data/
# rm /mnt/home/tmp.3fs

The filename does not need a 3fs extension, it can be any name.

The file can be mounted and unmounted whenever you like, and the file can be copied, moved, deleted, renamed whenever you like (preferably when the file is unmounted).

For example, you could use the space in the file to remaster Puppy, or to compile something.