Skip to content

Commit b45f9ea

Browse files
committed
Add: systemd-boot configs
1 parent 2f2d0ba commit b45f9ea

5 files changed

Lines changed: 67 additions & 2 deletions

File tree

alteriso5/work/task-bootmode-uefi-systemd.go

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"path"
77

88
"github.com/FascodeNet/alterlinux/alteriso5/work/boot"
9+
"github.com/Hayao0819/nahi/cputils"
910
osutils "github.com/Hayao0819/nahi/futils"
1011
)
1112

@@ -90,13 +91,34 @@ var makeCommonSystemdBootConfig *BuildTask = NewBuildTask("makeCommonSystemdBoot
9091
if err := os.MkdirAll(path.Join(workLoaderDir, "entries"), 0755); err != nil {
9192
return err
9293
}
94+
profileEfibootDir := path.Join(w.profile.Base, "efiboot")
9395

94-
// cpTasks := utils.CopyTask{
96+
cpTasks := []cputils.CopyTask{
97+
{
98+
Source: path.Join(profileEfibootDir, "loader", "loader.conf"),
99+
Dest: path.Join(workLoaderDir, "loader.conf"),
100+
},
101+
{
102+
Source: path.Join(profileEfibootDir, "loader", "entries"),
103+
Dest: path.Join(workLoaderDir, "entries"),
104+
},
105+
}
95106

96-
// }
107+
if err := cputils.CopyAll(cpTasks...); err != nil {
108+
return err
109+
}
97110

98111
return nil
112+
})
99113

114+
var makeCommonSystemdBootConfigIsofs *BuildTask = NewBuildTask("makeCommonSystemdBootConfigIsofs", func(w Work) error {
115+
return nil
116+
})
117+
118+
var makeCommonSystemdBootConfigEsp *BuildTask = NewBuildTask("makeCommonSystemdBootConfigEsp", func(w Work) error {
119+
120+
// mcopy -i "${efibootimg}" -s "${work_dir}/loader" ::/
121+
return nil
100122
})
101123

102124
var makeUefiX64SystemdBootEsp *BuildTask = NewBuildTask("makeUefiX64SystemdBootEsp", func(w Work) error {
@@ -113,14 +135,41 @@ var makeUefiX64SystemdBootEsp *BuildTask = NewBuildTask("makeUefiX64SystemdBootE
113135
}
114136

115137
// Copy systemd-boot EFI binary to the default/fallback boot path
138+
// mcopy -i "${efibootimg}" \
139+
// "${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi" ::/EFI/BOOT/BOOTx64.EFI
116140

117141
// Copy systemd-boot configuration files
142+
if err := w.RunOnce(makeCommonSystemdBootConfigEsp); err != nil {
143+
return err
144+
}
118145

119146
// shellx64.efi is picked up automatically when on /
120147

121148
return nil
122149
})
123150

124151
var makeUefiX64SystemdBootElTorito *BuildTask = NewBuildTask("makeUefiX64SystemdBootElTorito", func(w Work) error {
152+
if err := w.RunOnce(makeCommonSystemdBootConfig); err != nil {
153+
return err
154+
}
155+
156+
if err := w.RunOnce(makeUefiX64SystemdBootEsp); err != nil {
157+
return err
158+
}
159+
160+
// Additionally set up systemd-boot in ISO 9660. This allows creating a medium for the live environment by using
161+
// manual partitioning and simply copying the ISO 9660 file system contents.
162+
// This is not related to El Torito booting and no firmware uses these files.
163+
// _msg_info "Preparing an /EFI directory for the ISO 9660 file system..."
164+
// install -d -m 0755 -- "${isofs_dir}/EFI/BOOT"
165+
166+
// Copy systemd-boot EFI binary to the default/fallback boot path
167+
// install -m 0644 -- "${pacstrap_dir}/usr/lib/systemd/boot/efi/systemd-bootx64.efi" \
168+
// "${isofs_dir}/EFI/BOOT/BOOTx64.EFI"
169+
170+
if err := w.RunOnce(makeCommonSystemdBootConfigIsofs); err != nil {
171+
return err
172+
}
173+
125174
return nil
126175
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
title Arch Linux install medium (x86_64, UEFI)
2+
sort-key 01
3+
linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux
4+
initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img
5+
options archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID%
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
title Arch Linux install medium (x86_64, UEFI) with speech
2+
sort-key 02
3+
linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux
4+
initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img
5+
options archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID% accessibility=on
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
title Memtest86+
2+
sort-key 03
3+
efi /boot/memtest86+/memtest.efi

profile/efiboot/loader/loader.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
timeout 15
2+
default 01-archiso-x86_64-linux.conf
3+
beep on

0 commit comments

Comments
 (0)