Skip to content

Commit

Permalink
feat: 2024 update (#49)
Browse files Browse the repository at this point in the history
- update dependencies
- update Go version to 1.18 (to support new deps)
- regenerate proto-generated file with the latest `protoc_gen_go`
- fix linter issues with the latest `golangci-lint`
  • Loading branch information
nezorflame authored Jul 19, 2024
1 parent 684e292 commit efc0ae4
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 134 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
/vendor/
/Godeps/

### Go Workspace ###
go.work
go.work.sum

### vscode ###
.vscode/*
.vscode/
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
Expand Down
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ builds:
goos:
- windows
goarch:
- 386
- "386"
ldflags:
- '-extldflags "-static -s -w"'
- id: build-windows-amd64
Expand All @@ -28,7 +28,7 @@ builds:
goos:
- linux
goarch:
- 386
- "386"
ldflags:
- '-extldflags "-static -s -w"'
- id: build-linux-amd64
Expand Down
80 changes: 38 additions & 42 deletions chromeos_update_engine/update_metadata.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,13 @@

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.13.0
// protoc-gen-go v1.34.2
// protoc v5.27.1
// source: update_metadata.proto

package chromeos_update_engine

import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
Expand All @@ -108,18 +107,14 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4

type InstallOperation_Type int32

const (
InstallOperation_REPLACE InstallOperation_Type = 0 // Replace destination extents w/ attached data.
InstallOperation_REPLACE_BZ InstallOperation_Type = 1 // Replace destination extents w/ attached bzipped data.
// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
InstallOperation_MOVE InstallOperation_Type = 2 // Move source extents to target extents.
// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
InstallOperation_BSDIFF InstallOperation_Type = 3 // The data is a bsdiff binary diff.
// On minor version 2 or newer, these operations are supported:
InstallOperation_SOURCE_COPY InstallOperation_Type = 4 // Copy from source to target partition
Expand Down Expand Up @@ -437,8 +432,9 @@ func (x *PartitionInfo) GetHash() []byte {

// Describe an image we are based on in a human friendly way.
// Examples:
// dev-channel, x86-alex, 1.2.3, mp-v3
// nplusone-channel, x86-alex, 1.2.4, mp-v3, dev-channel, 1.2.3
//
// dev-channel, x86-alex, 1.2.3, mp-v3
// nplusone-channel, x86-alex, 1.2.4, mp-v3, dev-channel, 1.2.3
//
// All fields will be set, if this message is present.
type ImageInfo struct {
Expand Down Expand Up @@ -1031,11 +1027,11 @@ type DynamicPartitionMetadata struct {
unknownFields protoimpl.UnknownFields

// All updatable groups present in |partitions| of this DeltaArchiveManifest.
// - If an updatable group is on the device but not in the manifest, it is
// not updated. Hence, the group will not be resized, and partitions cannot
// be added to or removed from the group.
// - If an updatable group is in the manifest but not on the device, the group
// is added to the device.
// - If an updatable group is on the device but not in the manifest, it is
// not updated. Hence, the group will not be resized, and partitions cannot
// be added to or removed from the group.
// - If an updatable group is in the manifest but not on the device, the group
// is added to the device.
Groups []*DynamicPartitionGroup `protobuf:"bytes,1,rep,name=groups" json:"groups,omitempty"`
// Whether dynamic partitions have snapshots during the update. If this is
// set to true, the update_engine daemon creates snapshots for all dynamic
Expand Down Expand Up @@ -1099,9 +1095,9 @@ type DeltaArchiveManifest struct {
// kernel and rootfs partitions. For major version = 2 see the |partitions|
// field.
//
// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
InstallOperations []*InstallOperation `protobuf:"bytes,1,rep,name=install_operations,json=installOperations" json:"install_operations,omitempty"`
// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
KernelInstallOperations []*InstallOperation `protobuf:"bytes,2,rep,name=kernel_install_operations,json=kernelInstallOperations" json:"kernel_install_operations,omitempty"`
// (At time of writing) usually 4096
BlockSize *uint32 `protobuf:"varint,3,opt,name=block_size,json=blockSize,def=4096" json:"block_size,omitempty"`
Expand All @@ -1115,13 +1111,13 @@ type DeltaArchiveManifest struct {
// Only present in major version = 1. Partition metadata used to validate the
// update. For major version = 2 see the |partitions| field.
//
// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
OldKernelInfo *PartitionInfo `protobuf:"bytes,6,opt,name=old_kernel_info,json=oldKernelInfo" json:"old_kernel_info,omitempty"`
// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
NewKernelInfo *PartitionInfo `protobuf:"bytes,7,opt,name=new_kernel_info,json=newKernelInfo" json:"new_kernel_info,omitempty"`
// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
OldRootfsInfo *PartitionInfo `protobuf:"bytes,8,opt,name=old_rootfs_info,json=oldRootfsInfo" json:"old_rootfs_info,omitempty"`
// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
NewRootfsInfo *PartitionInfo `protobuf:"bytes,9,opt,name=new_rootfs_info,json=newRootfsInfo" json:"new_rootfs_info,omitempty"`
// old_image_info will only be present for delta images.
OldImageInfo *ImageInfo `protobuf:"bytes,10,opt,name=old_image_info,json=oldImageInfo" json:"old_image_info,omitempty"`
Expand Down Expand Up @@ -1183,15 +1179,15 @@ func (*DeltaArchiveManifest) Descriptor() ([]byte, []int) {
return file_update_metadata_proto_rawDescGZIP(), []int{9}
}

// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
func (x *DeltaArchiveManifest) GetInstallOperations() []*InstallOperation {
if x != nil {
return x.InstallOperations
}
return nil
}

// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
func (x *DeltaArchiveManifest) GetKernelInstallOperations() []*InstallOperation {
if x != nil {
return x.KernelInstallOperations
Expand Down Expand Up @@ -1220,31 +1216,31 @@ func (x *DeltaArchiveManifest) GetSignaturesSize() uint64 {
return 0
}

// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
func (x *DeltaArchiveManifest) GetOldKernelInfo() *PartitionInfo {
if x != nil {
return x.OldKernelInfo
}
return nil
}

// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
func (x *DeltaArchiveManifest) GetNewKernelInfo() *PartitionInfo {
if x != nil {
return x.NewKernelInfo
}
return nil
}

// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
func (x *DeltaArchiveManifest) GetOldRootfsInfo() *PartitionInfo {
if x != nil {
return x.OldRootfsInfo
}
return nil
}

// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
func (x *DeltaArchiveManifest) GetNewRootfsInfo() *PartitionInfo {
if x != nil {
return x.NewRootfsInfo
Expand Down Expand Up @@ -1306,7 +1302,7 @@ type Signatures_Signature struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"`
// The DER encoded signature size of EC keys is nondeterministic for
Expand Down Expand Up @@ -1351,7 +1347,7 @@ func (*Signatures_Signature) Descriptor() ([]byte, []int) {
return file_update_metadata_proto_rawDescGZIP(), []int{1, 0}
}

// Deprecated: Do not use.
// Deprecated: Marked as deprecated in update_metadata.proto.
func (x *Signatures_Signature) GetVersion() uint32 {
if x != nil && x.Version != nil {
return *x.Version
Expand Down Expand Up @@ -1636,7 +1632,7 @@ func file_update_metadata_proto_rawDescGZIP() []byte {

var file_update_metadata_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_update_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_update_metadata_proto_goTypes = []interface{}{
var file_update_metadata_proto_goTypes = []any{
(InstallOperation_Type)(0), // 0: chromeos_update_engine.InstallOperation.Type
(CowMergeOperation_Type)(0), // 1: chromeos_update_engine.CowMergeOperation.Type
(*Extent)(nil), // 2: chromeos_update_engine.Extent
Expand Down Expand Up @@ -1692,7 +1688,7 @@ func file_update_metadata_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_update_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Extent); i {
case 0:
return &v.state
Expand All @@ -1704,7 +1700,7 @@ func file_update_metadata_proto_init() {
return nil
}
}
file_update_metadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*Signatures); i {
case 0:
return &v.state
Expand All @@ -1716,7 +1712,7 @@ func file_update_metadata_proto_init() {
return nil
}
}
file_update_metadata_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*PartitionInfo); i {
case 0:
return &v.state
Expand All @@ -1728,7 +1724,7 @@ func file_update_metadata_proto_init() {
return nil
}
}
file_update_metadata_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*ImageInfo); i {
case 0:
return &v.state
Expand All @@ -1740,7 +1736,7 @@ func file_update_metadata_proto_init() {
return nil
}
}
file_update_metadata_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*InstallOperation); i {
case 0:
return &v.state
Expand All @@ -1752,7 +1748,7 @@ func file_update_metadata_proto_init() {
return nil
}
}
file_update_metadata_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*CowMergeOperation); i {
case 0:
return &v.state
Expand All @@ -1764,7 +1760,7 @@ func file_update_metadata_proto_init() {
return nil
}
}
file_update_metadata_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*PartitionUpdate); i {
case 0:
return &v.state
Expand All @@ -1776,7 +1772,7 @@ func file_update_metadata_proto_init() {
return nil
}
}
file_update_metadata_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*DynamicPartitionGroup); i {
case 0:
return &v.state
Expand All @@ -1788,7 +1784,7 @@ func file_update_metadata_proto_init() {
return nil
}
}
file_update_metadata_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*DynamicPartitionMetadata); i {
case 0:
return &v.state
Expand All @@ -1800,7 +1796,7 @@ func file_update_metadata_proto_init() {
return nil
}
}
file_update_metadata_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*DeltaArchiveManifest); i {
case 0:
return &v.state
Expand All @@ -1812,7 +1808,7 @@ func file_update_metadata_proto_init() {
return nil
}
}
file_update_metadata_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_update_metadata_proto_msgTypes[10].Exporter = func(v any, i int) any {
switch v := v.(*Signatures_Signature); i {
case 0:
return &v.state
Expand Down
16 changes: 11 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
module github.com/ssut/payload-dumper-go

go 1.14
go 1.18

require (
github.com/dustin/go-humanize v1.0.0
github.com/golang/protobuf v1.4.2
github.com/dustin/go-humanize v1.0.1
github.com/spencercw/go-xz v0.0.0-20181128201811-c82a2123b492
github.com/vbauerster/mpb/v5 v5.3.0
google.golang.org/protobuf v1.25.0
github.com/vbauerster/mpb/v5 v5.4.0
google.golang.org/protobuf v1.34.2
)

require (
github.com/VividCortex/ewma v1.1.1 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
golang.org/x/sys v0.22.0 // indirect
)
Loading

0 comments on commit efc0ae4

Please sign in to comment.