Script for saving changes to a live usb stick / sdcard
I've written a little script for my eee in order to save the changes to my sd-card... (the merging issue mentioned in the BT-HowTo is integrated, too)
#-------determine on which device the flash-storage is---------
#(I know the following is VERY inefficient and especially SLOW...)
FLASHSTORAGE=$(slocate BT3 |grep sd |grep live |grep root.lzm |cut -d '/' -f 5)
#to set the flash-storage manually comment the above lines and uncomment the following one after typing in your device
#--------------------save the changes----------------------
dir2lzm /mnt/live/memory/changes new-changes.lzm
lzm2dir /mnt/$FLASHSTORAGE/BT3/modules/changes.lzm /tmp/changestmp
lzm2dir new-changes.lzm /tmp/changestmp
dir2lzm /tmp/changestmp changes.lzm
mv /mnt/$FLASHSTORAGE/BT3/modules/changes.lzm /mnt/$FLASHSTORAGE/BT3/changes.lzm.bak
mv changes.lzm /mnt/$FLASHSTORAGE/BT3/modules/
Don't forget to chmod 755 the script
It would be great if anyone points me to a simpler solution for determining the device name of the usb-stick/sd-card/flash-storage
Why not make a save changes partition like every one else?
It's nice to get back to a working BT3 after realizing that all got screwed up ;-).
And with the changes module it's simpler to make an exact copy of the configuration by just copying the file to another media where BT3 is installed
When you have two partitions, one with the bt3 base install and a second with all your changes, what could be easier than wiping out the whole save changes partition and rebooting. Simply copy your changes partition every now and then for a back up. Don't get me wrong I appreciate you sharing your script however I was just wondering why not do it the way backtrack was designed to do it.
I thought about "screwing it up" before running the script that time... so you're just start at the point of your last reboot. But while I' think about it, it would make sense to backup the old changes.lzm before copying the new one... I'll edit it accordingly
I think your missing my point. There is no need for the .lzm at all if you have a separate partition for changes.