/update/mbr: strip p suffix from mmcblk0p

This commit is contained in:
Michael Stapelberg 2018-07-13 23:53:46 +02:00
parent 835dae6a18
commit d8206c507c

View File

@ -9,6 +9,7 @@ import (
"net/http" "net/http"
"os" "os"
"regexp" "regexp"
"strings"
"sync" "sync"
"syscall" "syscall"
"time" "time"
@ -151,7 +152,7 @@ func initUpdate() error {
} }
http.HandleFunc("/update/boot", nonConcurrentUpdateHandler(mustFindRootDevice()+"1")) 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/root", nonConcurrentUpdateHandler(mustFindRootDevice()+inactiveRootPartition))
http.HandleFunc("/update/switch", nonConcurrentSwitchHandler(inactiveRootPartition)) http.HandleFunc("/update/switch", nonConcurrentSwitchHandler(inactiveRootPartition))
// bakery updates only the boot partition, which would reset the active root // bakery updates only the boot partition, which would reset the active root