diff/patch rootfs
Oleg Goldshmidt
pub at goldshmidt.org
Thu Jul 10 09:54:26 IDT 2014
Erez D <erez0001 at gmail.com> writes:
> hello
>
> i am dealing with rootfs images i install on embedded linux
>
> from time to time i update the rootfs - add some file, remove other,
> update others, mknod etc ...
>
> currently, when i do this, i need to reinstall the image
>
> i am looking to create a patch, i can patch an old rootfs to update it
>
> however, diff does not handle create file, remove file, special files
> and binary files very well
>
> i am looking for a tool that can do that.
>
> anyone ?
>
> btw: distro is emdebian/debian on armel
Proper (IMHO) solution - package your updates (in .deb in your case, I
presume). This includes modifying existing packages if you need to roll
your own stuff - to avoid clashes.
Barring that, rsync is the first thing that comes to my mind.
I assume I don't need to remind you to be very, very careful, especially
with --delete. ;-)
I suppose if you screw up an update you can still reinstall as today,
right?
Possible enhancements (going on a tangent here):
I don't know your circumstances, nor am I familiar with emdebian, but
personally I'd prefer to get as much as possible packaged from the
distro and not touch rootfs by hand, and keep my own stuff on a separate
partition (that I can clobber, e.g., with rsync, even multiple times if
things go wrong).
I realize this may not be an option, so back to rootfs. Have you
considered having 2 partitions side-by-side and swapping old for new
(that you have, e.g., rsync'ed, etc.) with the possibility of rolling
back? Once new is running you can update old, too, if it is needed to
prepare for the next upgrade. The second partition will cost you some
space, of course...
--
Oleg Goldshmidt | pub at goldshmidt.org
More information about the Linux-il
mailing list