2

I am using Hypriot as OS . I have done modifications to some file and script,and i have add new service on boot . I would like to know if i have a newer version of Hypriot how can i update my customised OS to newer version without losing modification ? Or should i create a script that modify the new operating system ?

Thank you in advance

zamankar
  • 21
  • 1

2 Answers2

2

Debian is able to upgrade to a new version but it is not an easy task for the upgrade procedure. It has to decide how to upgrade options you have modified and/or set. If it doesn't know it will ask you what to do. Usually it will present the old configuration as default but it may not be always the best decision. This also implies that you will not get exactly the same installation than from a new installation of the new version. But the result is mostly very good. But you may miss new features from the new version because it tries to use the old configuration as already said.

You should clone your current installation on a spare SD Card and do the upgrade. If it doesn't show the expected result you can try again. When you have changed the settings in /etc/apt/ to the new repositories then the commands to upgrade are:

rpi ~$ sudo apt update
rpi ~$ sudo apt full-upgrade
Ingo
  • 42,107
  • 20
  • 85
  • 197
  • you think having a script that install some package and run command to configure the new version is an executable idea ? – zamankar Jul 10 '19 at 12:13
  • @zamankar I do not understand. Do you mean to flash the new version and configure it with a script? This may be possible but you have to make the installation at least one time manual to create the script. – Ingo Jul 10 '19 at 12:56
1

A rather straightforward approach would be:

  • flash your original (old, no modifications) image to a spare SD card
  • diff between the no-modification image and your current image
  • flash the new image (again, no modifications) to the spare SD card
  • apply the changes you've done to the old image to the new image with patch

If you don't have the above-mentioned tools, you can install them (on Debian) with

apt-get install diffutils patch
Dmitry Grigoryev
  • 27,928
  • 6
  • 53
  • 144
  • After applying diff i have this output "Binary files hypriotos-rpi-v1.9.0.img and MYOS.img differ" and if i use patch it gives me "patch: **** Only garbage was found in the patch input." – zamankar Jul 09 '19 at 14:58
  • 1
    Yikes! Don't use diff / patch on the binary image. Use them on individual files or sets of files. – goldilocks Jul 09 '19 at 15:14
  • @zamankar Yeah, when I said "flash the image to an SD card", didn't mean just copy it as a file. – Dmitry Grigoryev Jul 12 '19 at 06:43