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

interpretive language scripts


Moderator: Forum moderators

Post Reply
s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

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

Post 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.

User avatar
taersh
Posts: 951
Joined: Tue Jul 07, 2020 11:13 pm
Location: Germany
Has thanked: 53 times
Been thanked: 119 times

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

Post 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

My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!

williams2
Posts: 1066
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 306 times

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

Post 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.

Post Reply

Return to “Scripts”