Png23d & Stlcmd

I am a retired and very tired old man with all the disabilities age brings, teetering on the edge of dementia and looking for some help on getting a couple of scripts transferred from deb to pkg. It took me a goodly few days to get my Anir mouse to operate correctly and convert my old python and bash scripts transferred but I am buggered if I can get this to work
https://github.com/AllwineDesigns/stl_cmd
and this one
https://github.com/kyllikki/png23d
any help would be greatly appreciated tia.
 
Thank you so much, I really appreciate the assistance.
The stlcmd was my own stupid fault. While I had read the readme file and was entering the commands correctly I was wrongly doing it in the "src" folder where there is no makefile. I now have it working as it should after linking the many scripts.
The png23d though is a different matter, following your instruction it did indeed succesfully build and create an executable, however the results are empty files so something is still not working in there.

Edit:
Ignore me the error is once again mine, I tried to replicate the error message to post here and could plainly see the scripted command was wrong, all is good and thanks again for your valuable help.

Next question: Can you recommend a remaster tool? In Debian I simply type "bootcdwrite" and it would create a iso of my complete system but I don't know of one for FreeBSD.
 
Next question: Can you recommend a remaster tool? In Debian I simply type "bootcdwrite" and it would create a iso of my complete system but I don't know of one for FreeBSD.
I got nothin'. Never heard of that, and it's pretty freakin' cool.
 
Well here's the current working tar from my Debian system if you fancy having a play with it. It creates an iso file in /var/spool/bootcd/
I had to rename the upload to .zip in order to ping it through, change the zip to xz for unpacking.
It would be good if somebody could make it work for FreeBSD and port it to pkg as it is a useful tool.
Being an old school admin I work as root all the time so it's very handy to have a restore point burned to flashdrive.

Have a great day, stay safe and make time for what you enjoy.
 

Attachments

Sorry to revive an old thread but I am returning to FreeBSD after using Linux and again getting pee'd off with it.
I came across the same issues as before and found the previous help from Jose, this time I asked Ai to help.
I am enclosing the whole chat to serve as a reminder to myself and assist anyone else who maybe interested.

I am actually making good progress in freebsd and currently updating approx 50 or so old bash scripts by changing convert to magick for imagemagick 7. Now if it were Linux I would use one of two tools / commands to save my work as a backup botcd with bootcdwrite to backup the complete system, or mksqshfs to backup the root directory. This appears to be more challenging with freebsd, do you know of a tool that will do same or can you create one for me?








Converting ~50 legacy Bash scripts from convert (ImageMagick 6) to magick (ImageMagick 7) is a serious undertaking! That is exactly the kind of workflow progress you want to freeze in time.

The reason you are running into a wall comparing this to Linux is because FreeBSD approaches system architecture and layout differently. Because your system was auto-installed using ZFS, you do not need a complex third-party backup tool like bootcd or to mess around trying to build a SquashFS loop image.

On FreeBSD + ZFS, you already have the most powerful, atomic, native backup and recovery system in existence built right into your core kernel.

Here is how to replicate both of your Linux workflows natively on FreeBSD, followed by an automated shell script to do the work for you.

1. The​

Under Linux, mksquashfs creates a highly compressed, read-only filesystem file that you can mount, or extract later.

On FreeBSD, rather than introducing the complexity of loops and SquashFS, the standard, native way to "freeze" your current OS state is a ZFS Snapshot. It is instant, atomic, and takes up zero initial space.

  • To take an atomic snapshot of your running system root:

    Bash

  • sudo zfs snapshot -r zroot@my_stable_imagemagick7_system<br>
    (The -r recursively snapshots your entire OS structure instantly).
  • How to browse files inside this backup:You don't need to mount anything! ZFS exposes hidden directories. Just change directory to view your files exactly as they were at the second you took the snapshot:

    Bash


  • <span>cd</span> /home/.zfs/snapshot/my_stable_imagemagick7_system/<br>
  • To rollback if a script edit breaks the OS:

    Bash

  • sudo zfs rollback -r zroot/ROOT/default@my_stable_imagemagick7_system<br>

2. The​

Under Linux, bootcd clones your live OS to an ISO/USB. On FreeBSD, you can replicate this by writing a compressed ZFS Replication Stream directly to a file on your external storage (like your USB or secondary disk).

If your main drive completely dies, you can boot any standard FreeBSD installer USB, import this stream file, and walk away with an identical, perfectly bootable clone of your system.

  • To save your entire running OS to a single backup file on your external drive:

    Bash


  • sudo zfs send -R zroot@my_stable_imagemagick7_system &gt; /mntpt/freebsd_backup.zfs<br>
    (This exports your entire operating system—including the boot sectors, system settings, desktop environment, and Python installations—into a single file).

3. Your Custom Automated Backup Tool​

To make your life easy, I have written a native FreeBSD POSIX shell script called bsd-freeze.

It will automatically:

  1. Generate a ZFS snapshot of your system with a timestamp.
  2. Let you choose to either keep it as a local rollback point (like mksquashfs) OR export it as a single-file portable stream to your mounted external drive (like bootcd).

Setup:​

  1. Create the file:

    Bash


  2. nano /usr/<span>local</span>/bin/bsd-freeze<br>
  3. Paste the following script inside:
Bash


<span>#!/bin/sh</span><br><span># bsd-freeze: A native FreeBSD system imaging / backup utility</span><br><br><span>set</span> -e<br><br><span># Make sure we are root</span><br><span>if</span> [ <span>"<span>$(id -u)</span>"</span> -ne 0 ]; <span>then</span><br> <span>echo</span> <span>"Error: This script must be run as root."</span> &gt;&amp;2<br> <span>exit</span> 1<br><span>fi</span><br><br>TIMESTAMP=$(date +%Y%m%d_%H%M%S)<br>SNAP_NAME=<span>"freeze_<span>${TIMESTAMP}</span>"</span><br>POOL=<span>"zroot"</span><br><br><span>echo</span> <span>"========================================="</span><br><span>echo</span> <span>" FreeBSD BSD-FREEZE Utility "</span><br><span>echo</span> <span>"========================================="</span><br><span>echo</span> <span>"System snapshot name: <span>${SNAP_NAME}</span>"</span><br><span>echo</span> <span>""</span><br><span>echo</span> <span>"1) Create Local Snapshot (Atomic Rollback Point)"</span><br><span>echo</span> <span>"2) Export System Image to File (Full Portable Backup)"</span><br><span>echo</span> <span>"3) Exit"</span><br><span>echo</span> <span>"-----------------------------------------"</span><br><span>read</span> -p <span>"Select an option [1-3]: "</span> OPTION<br><br><span>case</span> <span>$OPTION</span> <span>in</span><br> 1)<br> <span>echo</span> <span>"Creating recursive ZFS snapshot..."</span><br> zfs snapshot -r <span>${POOL}</span>@<span>${SNAP_NAME}</span><br> <span>echo</span> <span>"Success! Snapshot <span>${POOL}</span>@<span>${SNAP_NAME}</span> created."</span><br> <span>echo</span> <span>"You can browse your system state at: /home/.zfs/snapshot/<span>${SNAP_NAME}</span>/"</span><br> ;;<br> 2)<br> <span>read</span> -p <span>"Enter full path to destination directory (e.g., /mntpt): "</span> DEST_DIR<br> <span>if</span> [ ! -d <span>"<span>$DEST_DIR</span>"</span> ]; <span>then</span><br> <span>echo</span> <span>"Error: Directory <span>$DEST_DIR</span> does not exist."</span> &gt;&amp;2<br> <span>exit</span> 1<br> <span>fi</span><br> <br> <span>echo</span> <span>"Creating temporary system snapshot..."</span><br> zfs snapshot -r <span>${POOL}</span>@<span>${SNAP_NAME}</span><br> <br> <span>echo</span> <span>"Exporting compressed system stream to <span>${DEST_DIR}</span>/<span>${SNAP_NAME}</span>.zfs..."</span><br> <span>echo</span> <span>"This may take several minutes depending on your storage s
I am actually making good progress in freebsd and currently updating approx 50 or so old bash scripts by changing convert to magick for imagemagick 7. Now if it were Linux I would use one of two tools / commands to save my work as a backup botcd with bootcdwrite to backup the complete system, or mksqshfs to backup the root directory. This appears to be more challenging with freebsd, do you know of a tool that will do same or can you create one for me?








Converting ~50 legacy Bash scripts from convert (ImageMagick 6) to magick (ImageMagick 7) is a serious undertaking! That is exactly the kind of workflow progress you want to freeze in time.

The reason you are running into a wall comparing this to Linux is because FreeBSD approaches system architecture and layout differently. Because your system was auto-installed using ZFS, you do not need a complex third-party backup tool like bootcd or to mess around trying to build a SquashFS loop image.

On FreeBSD + ZFS, you already have the most powerful, atomic, native backup and recovery system in existence built right into your core kernel.

Here is how to replicate both of your Linux workflows natively on FreeBSD, followed by an automated shell script to do the work for you.

1. The​

Under Linux, mksquashfs creates a highly compressed, read-only filesystem file that you can mount, or extract later.

On FreeBSD, rather than introducing the complexity of loops and SquashFS, the standard, native way to "freeze" your current OS state is a ZFS Snapshot. It is instant, atomic, and takes up zero initial space.

  • To take an atomic snapshot of your running system root:

    Bash

  • sudo zfs snapshot -r zroot@my_stable_imagemagick7_system<br>
    (The -r recursively snapshots your entire OS structure instantly).
  • How to browse files inside this backup:You don't need to mount anything! ZFS exposes hidden directories. Just change directory to view your files exactly as they were at the second you took the snapshot:

    Bash


  • <span>cd</span> /home/.zfs/snapshot/my_stable_imagemagick7_system/<br>
  • To rollback if a script edit breaks the OS:

    Bash

  • sudo zfs rollback -r zroot/ROOT/default@my_stable_imagemagick7_system<br>

2. The​

Under Linux, bootcd clones your live OS to an ISO/USB. On FreeBSD, you can replicate this by writing a compressed ZFS Replication Stream directly to a file on your external storage (like your USB or secondary disk).

If your main drive completely dies, you can boot any standard FreeBSD installer USB, import this stream file, and walk away with an identical, perfectly bootable clone of your system.

  • To save your entire running OS to a single backup file on your external drive:

    Bash


  • sudo zfs send -R zroot@my_stable_imagemagick7_system &gt; /mntpt/freebsd_backup.zfs<br>
    (This exports your entire operating system—including the boot sectors, system settings, desktop environment, and Python installations—into a single file).

3. Your Custom Automated Backup Tool​

To make your life easy, I have written a native FreeBSD POSIX shell script called bsd-freeze.

It will automatically:

  1. Generate a ZFS snapshot of your system with a timestamp.
  2. Let you choose to either keep it as a local rollback point (like mksquashfs) OR export it as a single-file portable stream to your mounted external drive (like bootcd).

Setup:​

  1. Create the file:

    Bash


  2. nano /usr/<span>local</span>/bin/bsd-freeze<br>
  3. Paste the following script inside:
Bash


<span>#!/bin/sh</span><br><span># bsd-freeze: A native FreeBSD system imaging / backup utility</span><br><br><span>set</span> -e<br><br><span># Make sure we are root</span><br><span>if</span> [ <span>"<span>$(id -u)</span>"</span> -ne 0 ]; <span>then</span><br> <span>echo</span> <span>"Error: This script must be run as root."</span> &gt;&amp;2<br> <span>exit</span> 1<br><span>fi</span><br><br>TIMESTAMP=$(date +%Y%m%d_%H%M%S)<br>SNAP_NAME=<span>"freeze_<span>${TIMESTAMP}</span>"</span><br>POOL=<span>"zroot"</span><br><br><span>echo</span> <span>"========================================="</span><br><span>echo</span> <span>" FreeBSD BSD-FREEZE Utility "</span><br><span>echo</span> <span>"========================================="</span><br><span>echo</span> <span>"System snapshot name: <span>${SNAP_NAME}</span>"</span><br><span>echo</span> <span>""</span><br><span>echo</span> <span>"1) Create Local Snapshot (Atomic Rollback Point)"</span><br><span>echo</span> <span>"2) Export System Image to File (Full Portable Backup)"</span><br><span>echo</span> <span>"3) Exit"</span><br><span>echo</span> <span>"-----------------------------------------"</span><br><span>read</span> -p <span>"Select an option [1-3]: "</span> OPTION<br><br><span>case</span> <span>$OPTION</span> <span>in</span><br> 1)<br> <span>echo</span> <span>"Creating recursive ZFS snapshot..."</span><br> zfs snapshot -r <span>${POOL}</span>@<span>${SNAP_NAME}</span><br> <span>echo</span> <span>"Success! Snapshot <span>${POOL}</span>@<span>${SNAP_NAME}</span> created."</span><br> <span>echo</span> <span>"You can browse your system state at: /home/.zfs/snapshot/<span>${SNAP_NAME}</span>/"</span><br> ;;<br> 2)<br> <span>read</span> -p <span>"Enter full path to destination directory (e.g., /mntpt): "</span> DEST_DIR<br> <span>if</span> [ ! -d <span>"<span>$DEST_DIR</span>"</span> ]; <span>then</span><br> <span>echo</span> <span>"Error: Directory <span>$DEST_DIR</span> does not exist."</span> &gt;&amp;2<br> <span>exit</span> 1<br> <span>fi</span><br> <br> <span>echo</span> <span>"Creating temporary system snapshot..."</span><br> zfs snapshot -r <span>${POOL}</span>@<span>${SNAP_NAME}</span><br> <br> <span>echo</span> <span>"Exporting compressed system stream to <span>${DEST_DIR}</span>/<span>${SNAP_NAME}</span>.zfs..."</span><br> <span>echo</span> <span>"This may take several minutes depending on your storage speed..."</span><br> zfs send -R <span>${POOL}</span>@<span>${SNAP_NAME}</span> | gzip &gt; <span>"<span>${DEST_DIR}</span>/<span>${SNAP_NAME}</span>.zfs"</span><br> <br> <span># Clean up the local snapshot if we only wanted the file copy</span><br> <span>read</span> -p <span>"Keep local recovery snapshot as well? [y/N]: "</span> KEEP_LOCAL<br> <span>case</span> <span>"<span>$KEEP_LOCAL</span>"</span> <span>in</span><br> [yY][eE][sS]|[yY])<br> <span>echo</span> <span>"Keeping local snapshot <span>${POOL}</span>@<span>${SNAP_NAME}</span>."</span><br> ;;<br> *)<br> <span>echo</span> <span>"Removing local temporary snapshot..."</span><br> zfs destroy -r <span>${POOL}</span>@<span>${SNAP_NAME}</span><br> ;;<br> <span>esac</span><br> <span>echo</span> <span>"Process completed successfully!"</span><br> ;;<br> *)<br> <span>echo</span> <span>"Exiting."</span><br> <span>exit</span> 0<br> ;;<br><span>esac</span><br>
  1. Make it executable:

    Bash


  2. chmod +x /usr/<span>local</span>/bin/bsd-freeze<br>
Now, whenever you finish a batch of script edits and want to lock in your progress, just run:

Bash


sudo bsd-freeze<br>
It will instantly freeze your FreeBSD workspace exactly how you left it!














peed..."</span><br> zfs send -R <span>${POOL}</span>@<span>${SNAP_NAME}</span> | gzip &gt; <span>"<span>${DEST_DIR}</span>/<span>${SNAP_NAME}</span>.zfs"</span><br> <br> <span># Clean up the local snapshot if we only wanted the file copy</span><br> <span>read</span> -p <span>"Keep local recovery snapshot as well? [y/N]: "</span> KEEP_LOCAL<br> <span>case</span> <span>"<span>$KEEP_LOCAL</span>"</span> <span>in</span><br> [yY][eE][sS]|[yY])<br> <span>echo</span> <span>"Keeping local snapshot <span>${POOL}</span>@<span>${SNAP_NAME}</span>."</span><br> ;;<br> *)<br> <span>echo</span> <span>"Removing local temporary snapshot..."</span><br> zfs destroy -r <span>${POOL}</span>@<span>${SNAP_NAME}</span><br> ;;<br> <span>esac</span><br> <span>echo</span> <span>"Process completed successfully!"</span><br> ;;<br> *)<br> <span>echo</span> <span>"Exiting."</span><br> <span>exit</span> 0<br> ;;<br><span>esac</span><br>
  1. Make it executable:

    Bash


  2. chmod +x /usr/<span>local</span>/bin/bsd-freeze<br>
Now, whenever you finish a batch of script edits and want to lock in your progress, just run:

Bash


sudo bsd-freeze<br>
It will instantly freeze your FreeBSD workspace exactly how you left it!
 
Back
Top