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

  • What is Hypriot? Does it is a Debian derivative? Do you use apt or apt-get to manage software packages? – Ingo Jul 9 '19 at 11:49
  • yes , if i update software package it's the same like having new version of OS ? – zamankar Jul 9 '19 at 13:34
  • It is debian based and you should be able to upgrade the OS without replacing it. – goldilocks Jul 9 '19 at 14:20
  • What is the command to upgrade the OS ? – zamankar Jul 9 '19 at 14:36

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
  • 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
  • Thank you !!!!! – zamankar Jul 12 '19 at 14:25

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
  • 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 9 '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 9 '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 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.