Resize a Save File (draft code - don't use yet)
I'm running Fatdog64 on a computer that has no linux partitions. I have a savefile for my basic fatdog system, and I have a second save file for general data, which is not mounted as part of the boot process. This second save file, I might for instance use for git based project and other coding experiments.
Fatdog won't let you resize a savefile unless you running in ram mode without a save file. Puppy I think only offers to resize the current save file and only on the next boot. I chose to modify the puppy scripts and I'm testing here on fatdog 64. The script is meant to resize a save file that you aren't using, but you could try it on a running save file and see what happens! Just back up first!
The core components of the script are:
1. Appending zeros to the save file:
Code: Select all
dd if=/dev/zero bs=1024 count=$KILOBIG >> "${SAVEPATH}"
and then using resize2fs to resize the file system based on this larger file:
Code: Select all
resize2fs -pf "$SAVEFILE_LOOP"
On puppy these are done in 0initrd/sbin/load_ext_file lines #39 and #172 respectively.
The actual amount and gui to resize it is found in the scipt:
woof-CE/woof-code/rootfs-skeleton/usr/sbin/resizepfile.sh
I've combined these two scripts into a single script. It is almost working. I need to add code to unmount the save file and then remount it prior to the call to "resize2fs". There are aslo some broken icons in the gui. As a side note, FD64-811 didn't have the scripts in /usr/lib/gtkdialog, so I copied these from fossapup64.
Anyway, here is my draft code: