How to easily copy changes in one linux filesystem to another ?
I'm using linux (debian based distro) in embedded applications but my question is actually quite generic.
So I start out with some basic linux installation, install new programs, add my own scripts and customize various files according to the application. We then ship the first prototype devices and following customer feedback need to do some changes.
My problem is how can I easily send changes to the customer - without having to send him a full 4GB image for every update ?
The required updates might require changes to existing files, as well as addition or deletion of files in several different directories.
The best way I have found so far is to load the updated image on a prototype device, copy the entire installation to a local folder on my workstation using scp. Then I delete all the major directories in which I know there were no changes to reduce the total size as much as possible. I then send the resulting directory to the customer together with a batch file that runs scp to copy these files over to the target device.
This works fine but there are a number of problems:
- the size of the files to transfer is still larger than really required.
- manual deletion of the unchanged folders is a tedious process and mistakes are easy.
- deletion of files of the target installation is not prossible - only addition and updates are possible.
Is there any way to sort of create a "diff" of two filesystems and "automatically" generate some kind of patch that makes the target filesystem identical to the source ?
How does the customer usually update the device and do they want to change their process ? .. maybe they could set up a local copy of the filesystem and you/they could rsync from yours to theirs over the Internet?
rsync is a good idea but I would prefer to have some kind of update file that can be used offline and stored for later use.
What if you use rsync -avn --delete and dump the output to a log file. The -n tells rsync to do a dry run, meaning nothing is modified on the source or destination. Instead rsync prints out what it WOULD have done. You can then write a simple script to turn this log into a patch and gather all of the files it needs.
That's one clever idea! ...it might be just what I need actually.
Most probably I will need to send one such update this week so I will try this out and let you know how it goes.
Thanks for the detailed reply!
|All times are GMT -5. The time now is 04:41 PM.|