why is the ustate variable set to 7 ?

144 views
Skip to first unread message

esad ergül

unread,
Jul 11, 2022, 10:05:20 AM7/11/22
to swupdate
Hello

I am using dual copy approach with on a Debian based system. Grub2 is used as bootloader.  In the preinstall and postinstall scripts I want to see what happened in the grub environment block. I noticed that during the update the bootloader variable ustate is set to 7. But when the update is done, then it can be seen that ustate is set to 1 normally because the update was installed successfully. 
My question is why ustate is set to 7 during the update?


root@Demo:~$ grub-editenv list
ustate=0
saved_entry=0
root@Demo:~$ grub-editenv list
ustate=0
saved_entry=0
root@Demo:~$ grub-editenv list
ustate=0
saved_entry=0
root@Demo:~$ grub-editenv list
ustate=0
saved_entry=0
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=7
saved_entry=0
recovery_status=in_progress
root@Demo:~$ grub-editenv list
ustate=1
next_entry=1
saved_entry=0
root@Demo:~$ grub-editenv list
ustate=1
next_entry=1
saved_entry=0
root@Demo:~$

Stefano Babic

unread,
Jul 11, 2022, 5:42:11 PM7/11/22
to esad ergül, swupdate


On 11.07.22 16:05, esad ergül wrote:
> Hello
>
> I am using dual copy approach with on a Debian based system. Grub2 is
> used as bootloader.  In the preinstall and postinstall scripts I want to
> see what happened in the grub environment block. I noticed that during
> the update the bootloader variable ustate is set to 7. But when the
> update is done, then it can be seen that ustate is set to 1 normally
> because the update was installed successfully.
> My question is why ustate is set to 7 during the update?

If you just look into the sources, it is self explained:

https://github.com/sbabic/swupdate/blob/master/include/state.h

Best regards,
Stefano Babic
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+u...@googlegroups.com
> <mailto:swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/swupdate/e409ed5d-dfd3-4aa8-9042-74c7ebe50dben%40googlegroups.com
> <https://groups.google.com/d/msgid/swupdate/e409ed5d-dfd3-4aa8-9042-74c7ebe50dben%40googlegroups.com?utm_medium=email&utm_source=footer>.

esad ergül

unread,
Jul 12, 2022, 2:53:47 AM7/12/22
to swupdate
Hi Stefano,

Thank you, yes it is self explained...

Best regards,
Esad Ergül
Reply all
Reply to author
Forward
0 new messages