Skip to content

Commit 73f9da7

Browse files
committed
feat: Add custom splash.png
1 parent 7eb7546 commit 73f9da7

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

alteriso/src/internal/archiso/profile_gen.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,26 @@ func (p *Profile) generateProfileDefSh(outDir string) error {
5858
return nil
5959
}
6060

61+
func (p *Profile) copySplashImage(outDir string) error {
62+
if futils.Exists(path.Join(p.Path, "splash.png")) {
63+
src := path.Join(p.Path, "splash.png")
64+
dsts := []string{
65+
path.Join(outDir, "syslinux", "splash.png"),
66+
}
67+
for _, dst := range dsts {
68+
if futils.Exists(dst) {
69+
if err := os.Remove(dst); err != nil {
70+
return errors.Wrap(err)
71+
}
72+
}
73+
if err := cp.Copy(src, dst); err != nil {
74+
return errors.Wrap(err)
75+
}
76+
}
77+
}
78+
return nil
79+
}
80+
6181
func (p *Profile) GenArchisoProfile(outDir string) error {
6282
tempDir, err := os.MkdirTemp(os.TempDir(), "alteriso-*")
6383
defer func() {
@@ -69,6 +89,7 @@ func (p *Profile) GenArchisoProfile(outDir string) error {
6989

7090
tasks := []func(outDir string) error{
7191
p.generateBootloaderConfigs,
92+
p.copySplashImage,
7293
p.generateProfileDefSh,
7394
p.copyInjecter,
7495
p.copyAirootfs,

0 commit comments

Comments
 (0)