From d8206c507c805fb1a2f19ef185be343a8fd7fcbe Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 13 Jul 2018 23:53:46 +0200 Subject: [PATCH] /update/mbr: strip p suffix from mmcblk0p --- update.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update.go b/update.go index b2f1c76..35fb484 100644 --- a/update.go +++ b/update.go @@ -9,6 +9,7 @@ import ( "net/http" "os" "regexp" + "strings" "sync" "syscall" "time" @@ -151,7 +152,7 @@ func initUpdate() error { } http.HandleFunc("/update/boot", nonConcurrentUpdateHandler(mustFindRootDevice()+"1")) - http.HandleFunc("/update/mbr", nonConcurrentUpdateHandler(mustFindRootDevice())) + http.HandleFunc("/update/mbr", nonConcurrentUpdateHandler(strings.TrimSuffix(mustFindRootDevice(), "p"))) http.HandleFunc("/update/root", nonConcurrentUpdateHandler(mustFindRootDevice()+inactiveRootPartition)) http.HandleFunc("/update/switch", nonConcurrentSwitchHandler(inactiveRootPartition)) // bakery updates only the boot partition, which would reset the active root