Refactor built-ufd to match new Linux builds
|
|
@ -37,8 +37,6 @@ ITEMS = {
|
|||
),
|
||||
'Linux': (
|
||||
('/arch', '/'),
|
||||
('/EFI/boot', '/EFI/'),
|
||||
('/syslinux', '/'),
|
||||
),
|
||||
'Main Kit': (
|
||||
('/', f'/{KIT_NAME_FULL}/'),
|
||||
|
|
@ -56,6 +54,25 @@ ITEMS = {
|
|||
('/sources/boot.wim', '/sources/'),
|
||||
),
|
||||
}
|
||||
ITEMS_FROM_LIVE = {
|
||||
'WizardKit UFD base': (
|
||||
('/usr/share/WizardKit/', '/'),
|
||||
),
|
||||
'rEFInd': (
|
||||
('/usr/share/refind/drivers_x64/', '/EFI/Boot/drivers_x64/'),
|
||||
('/usr/share/refind/icons/', '/EFI/Boot/icons/'),
|
||||
('/usr/share/refind/refind_x64.efi', '/EFI/Boot/'),
|
||||
),
|
||||
'Syslinux': (
|
||||
('/usr/lib/syslinux/bios/', '/syslinux/'),
|
||||
),
|
||||
'Memtest86': (
|
||||
('/usr/share/memtest86-efi/', '/EFI/Memtest86/'),
|
||||
),
|
||||
'Wimboot': (
|
||||
('/usr/share/wimboot/', '/syslinux/'),
|
||||
),
|
||||
}
|
||||
ITEMS_HIDDEN = (
|
||||
# Linux (all versions)
|
||||
'arch',
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ from wk.cfg.ufd import (
|
|||
BOOT_FILES,
|
||||
IMAGE_BOOT_ENTRIES,
|
||||
ITEMS,
|
||||
ITEMS_FROM_LIVE,
|
||||
ITEMS_HIDDEN,
|
||||
SOURCES,
|
||||
)
|
||||
|
|
@ -170,14 +171,25 @@ def build_ufd() -> None:
|
|||
message='Removing Linux...',
|
||||
function=remove_arch,
|
||||
)
|
||||
# Copy boot files
|
||||
ui.print_standard(' ')
|
||||
ui.print_info('Boot Files')
|
||||
for s_section, s_items in ITEMS_FROM_LIVE.items():
|
||||
s_section = pathlib.Path(s_section)
|
||||
try_print.run(
|
||||
message=f'Copying {s_section}...',
|
||||
function=copy_source,
|
||||
source=s_section,
|
||||
items=s_items,
|
||||
from_live=True,
|
||||
overwrite=True,
|
||||
)
|
||||
os.rename('/mnt/UFD/EFI/Boot/refind_x64.efi', '/mnt/UFD/EFI/Boot/bootx64.efi')
|
||||
|
||||
|
||||
# Copy sources
|
||||
ui.print_standard(' ')
|
||||
ui.print_info('Copy Sources')
|
||||
try_print.run(
|
||||
'Copying Memtest86...', io.recursive_copy,
|
||||
'/usr/share/memtest86-efi/', '/mnt/UFD/EFI/Memtest86/', overwrite=True,
|
||||
)
|
||||
for s_label, s_path in sources.items():
|
||||
try_print.run(
|
||||
message=f'Copying {s_label}...',
|
||||
|
|
@ -273,9 +285,9 @@ def confirm_selections(update=False) -> None:
|
|||
ui.print_standard(' ')
|
||||
|
||||
|
||||
def copy_source(source, items, overwrite=False) -> None:
|
||||
def copy_source(source, items, from_live=False, overwrite=False) -> None:
|
||||
"""Copy source items to /mnt/UFD."""
|
||||
is_image = source.is_file()
|
||||
is_image = not from_live and source.is_file()
|
||||
items_not_found = False
|
||||
|
||||
# Mount source if necessary
|
||||
|
|
@ -284,7 +296,14 @@ def copy_source(source, items, overwrite=False) -> None:
|
|||
|
||||
# Copy items
|
||||
for i_source, i_dest in items:
|
||||
i_source = f'{"/mnt/Source" if is_image else source}{i_source}'
|
||||
if from_live:
|
||||
# Don't prepend source
|
||||
pass
|
||||
elif is_image:
|
||||
i_source = f'/mnt/Source{i_source}'
|
||||
else:
|
||||
# Prepend source
|
||||
i_source = f'{source}{i_source}'
|
||||
i_dest = f'/mnt/UFD{i_dest}'
|
||||
try:
|
||||
io.recursive_copy(i_source, i_dest, overwrite=overwrite)
|
||||
|
|
@ -548,7 +567,7 @@ def update_boot_entries(ufd_dev, images=None) -> None:
|
|||
'sed',
|
||||
'--in-place',
|
||||
'--regexp-extended',
|
||||
f's#archisolabel={ISO_LABEL}#archisodevice=/dev/disk/by-uuid/{uuids[0]}#',
|
||||
f's/___+/{uuids[0]}/',
|
||||
*configs,
|
||||
]
|
||||
run_program(cmd)
|
||||
|
|
|
|||
|
|
@ -80,6 +80,16 @@ function copy_live_env() {
|
|||
mkdir -p "$PROFILE_DIR/airootfs/usr/local/bin"
|
||||
rsync -aI "$ROOT_DIR/scripts/" "$PROFILE_DIR/airootfs/usr/local/bin/"
|
||||
|
||||
echo "Copying WizardKit UFD files..."
|
||||
rsync -aI "$ROOT_DIR/setup/ufd/" "$PROFILE_DIR/airootfs/usr/share/WizardKit/"
|
||||
cp "$ROOT_DIR/images/rEFInd.png" "$PROFILE_DIR/airootfs/usr/share/WizardKit/EFI/Boot/rEFInd.png"
|
||||
cp "$ROOT_DIR/images/Syslinux.png" "$PROFILE_DIR/airootfs/usr/share/WizardKit/syslinux/syslinux.png"
|
||||
|
||||
echo "Copying Memtest86+ files..."
|
||||
rsync -aI "/boot/memtest86+/memtest.bin" "$PROFILE_DIR/airootfs/usr/share/WizardKit/syslinux/"
|
||||
rsync -aI "/boot/memtest86+/memtest.efi" "$PROFILE_DIR/airootfs/usr/share/WizardKit/EFI/Memtest86+/"
|
||||
mv "$PROFILE_DIR/airootfs/usr/share/WizardKit/EFI/Memtest86+"/{memtest.efi,bootx64.efi}
|
||||
|
||||
# Pre-compile Python scripts
|
||||
unset PYTHONPYCACHEPREFIX
|
||||
python -m compileall "$PROFILE_DIR/airootfs/usr/local/bin/"
|
||||
|
|
@ -118,6 +128,7 @@ function update_live_env() {
|
|||
|
||||
# Boot config
|
||||
cp "$ROOT_DIR/images/Syslinux.png" "$PROFILE_DIR/syslinux/splash.png"
|
||||
sed -i -r "s/___+/${KIT_NAME_FULL}/" "$PROFILE_DIR/airootfs/usr/share/WizardKit/syslinux/syslinux.cfg"
|
||||
|
||||
# MOTD
|
||||
sed -i -r "s/KIT_NAME_SHORT/$KIT_NAME_SHORT/" "$PROFILE_DIR/profiledef.sh"
|
||||
|
|
|
|||
|
|
@ -11,3 +11,4 @@ smartmontools-svn
|
|||
ttf-font-awesome-4
|
||||
udevil
|
||||
wd719x-firmware
|
||||
wimboot-bin
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ man-db
|
|||
man-pages
|
||||
mdadm
|
||||
mediainfo
|
||||
memtest86+
|
||||
memtest86-efi
|
||||
mesa-demos
|
||||
mesa-utils
|
||||
|
|
@ -103,7 +102,6 @@ nvme-cli
|
|||
open-iscsi
|
||||
openbox
|
||||
openssh
|
||||
openssh
|
||||
opensuperclone-git
|
||||
otf-font-awesome-4
|
||||
p7zip
|
||||
|
|
@ -171,6 +169,7 @@ volumeicon
|
|||
wd719x-firmware
|
||||
wezterm-terminfo
|
||||
which
|
||||
wimboot-bin
|
||||
wimlib
|
||||
wmctrl
|
||||
xarchiver
|
||||
|
|
@ -178,6 +177,7 @@ xf86-input-libinput
|
|||
xf86-video-amdgpu
|
||||
xf86-video-fbdev
|
||||
xf86-video-nouveau
|
||||
xf86-video-qxl
|
||||
xf86-video-vesa
|
||||
xfsprogs
|
||||
xorg-server
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ curl
|
|||
dos2unix
|
||||
git
|
||||
gtk3
|
||||
memtest86+
|
||||
memtest86+-efi
|
||||
p7zip
|
||||
perl-rename
|
||||
pv
|
||||
|
|
|
|||
BIN
setup/ufd/EFI/Boot/icons/dgpu.png
Normal file
|
After Width: | Height: | Size: 3 KiB |
BIN
setup/ufd/EFI/Boot/icons/wk_arch.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
setup/ufd/EFI/Boot/icons/wk_mac_10.11.png
Normal file
|
After Width: | Height: | Size: 338 KiB |
BIN
setup/ufd/EFI/Boot/icons/wk_mac_10.13.png
Normal file
|
After Width: | Height: | Size: 373 KiB |
BIN
setup/ufd/EFI/Boot/icons/wk_mac_10.15.png
Normal file
|
After Width: | Height: | Size: 320 KiB |
BIN
setup/ufd/EFI/Boot/icons/wk_mac_11.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
setup/ufd/EFI/Boot/icons/wk_memtest.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
setup/ufd/EFI/Boot/icons/wk_win.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
87
setup/ufd/EFI/Boot/refind.conf
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
# refind.conf
|
||||
|
||||
timeout 0
|
||||
scanfor manual
|
||||
showtools firmware,reboot,shutdown
|
||||
default_selection Linux
|
||||
csr_values 10,77
|
||||
#use_graphics_for osx,linux,windows
|
||||
|
||||
# Theme
|
||||
banner rEFInd.png
|
||||
banner_scale fillscreen
|
||||
selection_big selection_big.png
|
||||
selection_small selection_small.png
|
||||
hideui arrows,badges
|
||||
|
||||
# Entries
|
||||
menuentry "Linux" {
|
||||
icon /EFI/boot/icons/wk_arch.png
|
||||
loader /arch/boot/x86_64/vmlinuz-linux
|
||||
initrd /arch/boot/intel_ucode.img
|
||||
initrd /arch/boot/amd_ucode.img
|
||||
initrd /arch/boot/x86_64/initramfs-linux.img
|
||||
options "archisobasedir=arch archisodevice=/dev/disk/by-uuid/_______ copytoram loglevel=3"
|
||||
submenuentry "Linux (CLI)" {
|
||||
add_options "nox"
|
||||
}
|
||||
}
|
||||
|
||||
menuentry "MemTest86+" {
|
||||
icon /EFI/boot/icons/wk_memtest.png
|
||||
options "nobigstatus nopause"
|
||||
loader /EFI/Memtest86+/bootx64.efi
|
||||
submenuentry "Memtest86+ (Open Source)" {
|
||||
loader /EFI/Memtest86+/bootx64.efi
|
||||
}
|
||||
submenuentry "Memtest86 (Passmark)" {
|
||||
loader /EFI/Memtest86/bootx64.efi
|
||||
options
|
||||
}
|
||||
}
|
||||
|
||||
#UFD-MACOS-10.11#menuentry "macOS (El Capitan)" {
|
||||
#UFD-MACOS-10.11# icon /EFI/boot/icons/wk_mac_10.11.png
|
||||
#UFD-MACOS-10.11# volume "PARTUUID"
|
||||
#UFD-MACOS-10.11# loader /System/Library/CoreServices/secretboot.efi
|
||||
#UFD-MACOS-10.11# graphics
|
||||
#UFD-MACOS-10.11# submenuentry "Mac MemTest" {
|
||||
#UFD-MACOS-10.11# add_options "-s"
|
||||
#UFD-MACOS-10.11# }
|
||||
#UFD-MACOS-10.11#}
|
||||
|
||||
#UFD-MACOS-10.13#menuentry "macOS (High Sierra)" {
|
||||
#UFD-MACOS-10.13# icon /EFI/boot/icons/wk_mac_10.13.png
|
||||
#UFD-MACOS-10.13# volume "PARTUUID"
|
||||
#UFD-MACOS-10.13# loader /System/Library/CoreServices/secretboot.efi
|
||||
#UFD-MACOS-10.13# graphics
|
||||
#UFD-MACOS-10.13# submenuentry "Mac MemTest" {
|
||||
#UFD-MACOS-10.13# add_options "-s"
|
||||
#UFD-MACOS-10.13# }
|
||||
#UFD-MACOS-10.13#}
|
||||
|
||||
#UFD-MACOS-10.15#menuentry "macOS (Catalina)" {
|
||||
#UFD-MACOS-10.15# icon /EFI/boot/icons/wk_mac_10.15.png
|
||||
#UFD-MACOS-10.15# volume "PARTUUID"
|
||||
#UFD-MACOS-10.15# loader /System/Library/CoreServices/secretboot.efi
|
||||
#UFD-MACOS-10.15# graphics
|
||||
#UFD-MACOS-10.15# submenuentry "Mac MemTest" {
|
||||
#UFD-MACOS-10.15# add_options "-s"
|
||||
#UFD-MACOS-10.15# }
|
||||
#UFD-MACOS-10.15#}
|
||||
|
||||
#UFD-WINPE#menuentry "WindowsPE" {
|
||||
#UFD-WINPE# ostype windows
|
||||
#UFD-WINPE# icon /EFI/boot/icons/wk_win.png
|
||||
#UFD-WINPE# loader /EFI/microsoft/bootx64.efi
|
||||
#UFD-WINPE#}
|
||||
|
||||
#UFD-DGPU#menuentry "Mac dGPU Disable Tool" {
|
||||
#UFD-DGPU# icon /EFI/boot/icons/dgpu.png
|
||||
#UFD-DGPU# loader /dgpu/vmlinuz-linux
|
||||
#UFD-DGPU# initrd /arch/boot/intel_ucode.img
|
||||
#UFD-DGPU# initrd /arch/boot/amd_ucode.img
|
||||
#UFD-DGPU# initrd /dgpu/initramfs-linux.img
|
||||
#UFD-DGPU# options "archisobasedir=dgpu archisolabel=%ARCHISO_LABEL% nomodeset"
|
||||
#UFD-DGPU#}
|
||||
|
||||
BIN
setup/ufd/EFI/Boot/selection_big.png
Normal file
|
After Width: | Height: | Size: 538 B |
BIN
setup/ufd/EFI/Boot/selection_small.png
Normal file
|
After Width: | Height: | Size: 720 B |
21
setup/ufd/syslinux/linux.cfg
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
LABEL wk_linux
|
||||
TEXT HELP
|
||||
A live Linux environment
|
||||
* HW diagnostics, file-based backups, data recovery, etc
|
||||
ENDTEXT
|
||||
MENU LABEL Linux
|
||||
LINUX /arch/boot/x86_64/vmlinuz-linux
|
||||
INITRD /arch/boot/intel-ucode.img,/arch/boot/amd-ucode.img,/arch/boot/x86_64/initramfs-linux.img
|
||||
APPEND archisobasedir=arch archisodevice=/dev/disk/by-uuid/_______ copytoram loglevel=3
|
||||
|
||||
LABEL wk_linux_cli
|
||||
TEXT HELP
|
||||
A live Linux environment (CLI)
|
||||
* HW diagnostics, file-based backups, data recovery, etc
|
||||
ENDTEXT
|
||||
MENU LABEL Linux (CLI)
|
||||
LINUX /arch/boot/x86_64/vmlinuz-linux
|
||||
INITRD /arch/boot/intel-ucode.img,/arch/boot/amd-ucode.img,/arch/boot/x86_64/initramfs-linux.img
|
||||
APPEND archisobasedir=arch archisodevice=/dev/disk/by-uuid/_______ copytoram nox
|
||||
SYSAPPEND 3
|
||||
|
||||
7
setup/ufd/syslinux/memtest.cfg
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# http://www.memtest.org/
|
||||
LABEL memtest
|
||||
MENU LABEL Memtest86+
|
||||
TEXT HELP
|
||||
Perform RAM diagnostics
|
||||
ENDTEXT
|
||||
LINUX memtest.bin
|
||||
53
setup/ufd/syslinux/syslinux.cfg
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
SERIAL 0 115200
|
||||
UI vesamenu.c32
|
||||
MENU TITLE _______
|
||||
MENU BACKGROUND syslinux.png
|
||||
|
||||
MENU WIDTH 80
|
||||
MENU MARGIN 10
|
||||
MENU ROWS 15
|
||||
MENU VSHIFT 2
|
||||
MENU TABMSGROW 22
|
||||
MENU CMDLINEROW 22
|
||||
MENU HELPMSGROW 24
|
||||
MENU HELPMSGENDROW -1
|
||||
MENU TABMSG
|
||||
|
||||
# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
|
||||
|
||||
MENU COLOR screen 30;44 #a0000000 #a0000000 none
|
||||
MENU COLOR border 30;44 #a0000000 #a0000000 none
|
||||
MENU COLOR title 1;36;44 #9033ccff #a0000000 none
|
||||
MENU COLOR sel 7;37;40 #e0ffffff #a0000000 std
|
||||
MENU COLOR disabled 37;44 #50ffffff #a0000000 none
|
||||
MENU COLOR unsel 37;44 #50ffffff #a0000000 none
|
||||
MENU COLOR help 37;40 #c0ffffff #a0000000 none
|
||||
MENU COLOR tabmsg 30;44 #a0000000 #a0000000 none
|
||||
MENU COLOR cmdmark 1;36;44 #9033ccff #a0000000 none
|
||||
MENU COLOR cmdline 37;40 #c0ffffff #a0000000 none
|
||||
MENU COLOR timeout_msg 37;40 #80ffffff #a0000000 none
|
||||
MENU COLOR timeout 1;37;40 #c0ffffff #a0000000 none
|
||||
MENU COLOR msg07 37;40 #90ffffff #a0000000 none
|
||||
MENU COLOR tabmsg 31;40 #30ffffff #a0000000 none
|
||||
|
||||
# Start entries
|
||||
MENU SEPARATOR
|
||||
|
||||
MENU CLEAR
|
||||
|
||||
DEFAULT wk_linux
|
||||
TIMEOUT 0
|
||||
|
||||
INCLUDE linux.cfg
|
||||
INCLUDE memtest.cfg
|
||||
#UFD-WINPE#INCLUDE winpe.cfg
|
||||
|
||||
MENU SEPARATOR
|
||||
|
||||
LABEL reboot
|
||||
MENU LABEL Reboot
|
||||
COM32 reboot.c32
|
||||
|
||||
LABEL poweroff
|
||||
MENU LABEL Power Off
|
||||
COM32 poweroff.c32
|
||||
8
setup/ufd/syslinux/winpe.cfg
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
LABEL wk_winpe
|
||||
TEXT HELP
|
||||
A live Windows environment
|
||||
* Create partition backups, Install Windows, etc
|
||||
ENDTEXT
|
||||
MENU LABEL Windows PE
|
||||
COM32 linux.c32
|
||||
APPEND wimboot gui initrdfile=/sources/bootmgr,/sources/BCD,/sources/boot.sdi,/sources/boot.wim
|
||||