From f38b7279c69eaaed7898708d37b2d58c902cfe5c Mon Sep 17 00:00:00 2001
From: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
Date: Fri, 19 Nov 2021 15:59:45 +0100
Subject: [PATCH] boot,pieeprom: use Go 1.14 compatible imports

io/fs.ErrNotExist is not available in Go 1.14, we can use the older name
os.ErrNotExist instead.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
---
 boot/piboot/piboot.go     | 3 +--
 pieeprom/pieeprom_test.go | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/boot/piboot/piboot.go b/boot/piboot/piboot.go
index 6ae72ac..6f21a8e 100644
--- a/boot/piboot/piboot.go
+++ b/boot/piboot/piboot.go
@@ -22,7 +22,6 @@ package piboot
 import (
 	"errors"
 	"fmt"
-	"io/fs"
 	"os"
 	"os/exec"
 	"path/filepath"
@@ -315,7 +314,7 @@ func (pi *PiBoot) PreInstallHandler(ctx *installhandler.HandlerContext) (err err
 	tsPath := filepath.Join(pi.procMountPoint, relTsPath)
 
 	firmwareBuildTs, err := pieeprom.BuildTimestamp(tsPath)
-	if err != nil && !errors.Is(err, fs.ErrNotExist) {
+	if err != nil && !errors.Is(err, os.ErrNotExist) {
 		return err
 	}
 
diff --git a/pieeprom/pieeprom_test.go b/pieeprom/pieeprom_test.go
index ad25430..f5e572e 100644
--- a/pieeprom/pieeprom_test.go
+++ b/pieeprom/pieeprom_test.go
@@ -5,8 +5,8 @@ package pieeprom_test
 
 import (
 	"errors"
-	"io/fs"
 	"io/ioutil"
+	"os"
 	"path/filepath"
 	"testing"
 	"time"
@@ -29,7 +29,7 @@ func (s *eepromSuite) TestBuildTimestamp(c *C) {
 
 	// This is what happens on devices without the EEPROM-based firmware.
 	c.Assert(err, NotNil)
-	c.Check(errors.Is(err, fs.ErrNotExist), Equals, true)
+	c.Check(errors.Is(err, os.ErrNotExist), Equals, true)
 	c.Check(ts.IsZero(), Equals, true)
 
 	// Data obtained from a system with firmware programmed with pieeprom-2021-04-29.bin.
-- 
GitLab