@@ -64,42 +64,42 @@ func selfupdate(ctx context.Context, gusCli *gusapi.APIClient, gusServer, machin
6464
6565 log .Print ("checking target partuuid support" )
6666
67- target , err := updater .NewTarget (uri , http .DefaultClient )
67+ target , err := updater .NewTarget (ctx , uri , http .DefaultClient )
6868 if err != nil {
6969 return fmt .Errorf ("checking target partuuid support: %v" , err )
7070 }
7171
7272 // Start with the root file system because writing to the non-active
7373 // partition cannot break the currently running system.
7474 log .Print ("updating root file system" )
75- if err := target .StreamTo ("root" , readClosers .root ); err != nil {
75+ if err := target .StreamTo (ctx , "root" , readClosers .root ); err != nil {
7676 return fmt .Errorf ("updating root file system: %v" , err )
7777 }
7878 readClosers .root .Close ()
7979
8080 log .Print ("updating boot file system" )
81- if err := target .StreamTo ("boot" , readClosers .boot ); err != nil {
81+ if err := target .StreamTo (ctx , "boot" , readClosers .boot ); err != nil {
8282 return fmt .Errorf ("updating boot file system: %v" , err )
8383 }
8484 readClosers .boot .Close ()
8585
8686 // Only relevant when running on non-Raspberry Pi devices.
8787 // As it does not use an MBR.
8888 log .Print ("updating MBR" )
89- if err := target .StreamTo ("mbr" , readClosers .mbr ); err != nil {
89+ if err := target .StreamTo (ctx , "mbr" , readClosers .mbr ); err != nil {
9090 return fmt .Errorf ("updating MBR: %v" , err )
9191 }
9292 readClosers .mbr .Close ()
9393
9494 readClosers .zip .Close ()
9595
9696 log .Print ("switching to non-active partition" )
97- if err := target .Switch (); err != nil {
97+ if err := target .Switch (ctx ); err != nil {
9898 return fmt .Errorf ("switching to non-active partition: %v" , err )
9999 }
100100
101101 log .Print ("reboot" )
102- if err := target .Reboot (); err != nil {
102+ if err := target .Reboot (ctx ); err != nil {
103103 return fmt .Errorf ("reboot: %v" , err )
104104 }
105105
0 commit comments