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

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

2 Answers 2

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
2
  • you think having a script that install some package and run command to configure the new version is an executable idea ?
    – zamankar
    Jul 10, 2019 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, 2019 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
3
  • 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, 2019 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, 2019 at 15:14
  • @zamankar Yeah, when I said "flash the image to an SD card", didn't mean just copy it as a file. Jul 12, 2019 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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