@applee It's not just overwriting it during an update, it's overwriting it every boot. So maybe there is an upstream source of it that I could edit instead.
On a desktop system, it would make no sense to overwrite fstab during an update or reboot; it maps the UUIDs of all your drives and partitions to locations within your directory tree. Your install usually sets it up for you, and if you put your home folder on a different partition or drive than the root system, those details would be in fstab. You'd have to modify it manually if, for example, you put several distros on different partitions and have them all share a Documents folder. Mapping SMB shares is just the same, it's just that the for-example Documents folder is on a network server, which is what I'm doing. I believe this is all quite normal, expected Linux behavior.
UBPorts seems to be doing quite a bit of remapping in fstab, from a glance looks like it's mapping the android parts of the tree to the linux parts, and otherwise bringing parts of the tree to places that linux expects. So it makes sense that it would want to update it, as it's a pretty complex mapping. It looks like the UBPorts system doesn't need to map the UUIDs as desktop linux does, as the android blob takes care of that.
But I believe brutally overwriting fstab is subverting part of its purpose. Perhaps less important in a portable context, as you don't have partitions, and wouldn't usually have permanent servers available, but there are use cases.
I have documents and music and videos on my servers which I'd like to access from my devices, when I'm on my home network. To use these with anything besides File Manager, they need to be mapped somewhere in the root tree. I can hack fstab with a script as I'm doing, but that subverts UBPorts in that I have to make the root system r/w. Perhaps there is another way to mount SMB shares dynamically without putting them in fstab, I just don't know it. Obviously the system can do this with pluggable devices. If anybody can point me in that direction, I'd like to learn about it.