Skip to content

Commit 697eb35

Browse files
committed
Add: syslinux configuration
1 parent 4fc21f2 commit 697eb35

23 files changed

Lines changed: 259 additions & 39 deletions

alteriso5/cmd/build/build.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ func build() error {
3030
return err
3131
}
3232

33-
profile := config.DummyProfile()
33+
// Dummy profile
34+
profile := config.Profile{
35+
Base: path.Join(current, "profile"),
36+
InstallDir: "alter",
37+
}
38+
39+
// TODO: Add more targets
3440
target := config.NewTarget("x86_64", outDir)
3541
return work.Build(profile, target)
3642
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package check

alteriso5/cmd/build/check/os.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package check
2+
3+
import (
4+
"errors"
5+
"log/slog"
6+
"runtime"
7+
8+
"github.com/Hayao0819/go-distro"
9+
)
10+
11+
var ErrUnsupportedOS = errors.New("unsupported OS")
12+
13+
func OS() error {
14+
if runtime.GOOS != "linux" {
15+
return ErrUnsupportedOS
16+
}
17+
18+
osdetail := distro.Get()
19+
if id := osdetail.ID(); id != "arch" {
20+
slog.Warn("Unsupported OS: " + id)
21+
}
22+
23+
return nil
24+
}

alteriso5/cmd/build/cmd.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package build
33
import (
44
"fmt"
55
"os"
6-
"time"
76

87
"github.com/FascodeNet/alterlinux/alteriso5/utils"
98
"github.com/spf13/cobra"
@@ -19,7 +18,6 @@ func Cmd() *cobra.Command {
1918
fmt.Println("Received signal:", s)
2019
os.Exit(1)
2120
}, os.Interrupt)
22-
time.Sleep(20 * time.Second)
2321

2422
if err := check(); err != nil {
2523
cmd.PrintErrln(err)
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
package config
22

33
type Profile struct {
4-
Base string
4+
Base string
5+
InstallDir string
56
}
67

7-
88
func ReadProfile(path string) (Profile, error) {
99
return Profile{}, nil
1010
}
11-
12-
func DummyProfile() Profile {
13-
return Profile{}
14-
}

alteriso5/cmd/build/config/target.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ package config
33
type Target struct {
44
Arch string
55
Out string
6+
// ProfileDir string
67
}
78

89
func NewTarget(arch string, out string) Target {
9-
return Target{arch, out}
10+
return Target{
11+
Arch: arch,
12+
Out: out,
13+
// ProfileDir: profile,
14+
}
1015
}

alteriso5/cmd/build/work/airootfs/filesystem.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

alteriso5/cmd/build/work/airootfs/get.go

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
package airootfs
22

33
type SquashFS struct {
4-
Path string
4+
Base string
5+
Out string
6+
Args []string
57
}
68

7-
func (s SquashFS) GetPath() (string, error) {
8-
return s.Path, nil
9-
}
10-
11-
func (s SquashFS) Init() error {
12-
return nil
13-
}
14-
15-
func (s SquashFS) Mount(path string) error {
16-
return nil
17-
}

alteriso5/cmd/build/work/build.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ func (work Work) Build(p config.Profile, t config.Target) error {
99

1010
tasks := []*BuildTask{
1111
makeBaseDirs,
12-
makeChroot,
12+
//makeChroot,
13+
makeBootModes,
1314
}
1415

1516
for _, t := range tasks {

0 commit comments

Comments
 (0)