Skip to content

Commit

Permalink
Added interactive installer package in pkg/installer
Browse files Browse the repository at this point in the history
- This patch introduces a new interactive installation mode for EVE-OS.
  It allows users to choose the installation parameters in a text-based
  used interface, which is more user-friendly compared to editing grub.cfg.
- We store the installation parameters in a json file (installer.json),
  which we can then use for bulk installations with similar configurations.

Signed-off-by: Ioannis Sfakianakis <[email protected]>
  • Loading branch information
jsfakian committed Jul 4, 2024
1 parent 00fa62b commit 7ad44db
Show file tree
Hide file tree
Showing 40 changed files with 3,425 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

[codespell]
skip = ./.git/*,*/vendor/*,./conf/v2tlsbaseroot-certificates.pem,./pkg/gpt-tools/patches/*,./pkg/new-kernel/*,./pkg/kernel/*,./pkg/fw/*
ignore-words-list = uptodate,synopsys
ignore-words-list = uptodate,synopsys,crate
10 changes: 8 additions & 2 deletions images/rootfs.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ onboot:
capabilities:
- CAP_SYS_ADMIN
- CAP_NET_ADMIN
# Interactive installer must preseed storage-init
# If you change the order of interactive-installer don't forget to
# change path to the "002-interactive-installer" in "pkg/mkimage-raw-efi/config"
- name: interactive-installer
image: INTERACTIVE_INSTALLER_TAG
command: ["/bin/sh", "-c", "/sbin/run-installer.sh </dev/console >/dev/console 2>&1"]
# If you change the order of storage-init don't forget to
# change path to the "002-installer" in "pkg/mkimage-raw-efi/Dockerfile" and
# change path to the "003-installer" in "pkg/mkimage-raw-efi/Dockerfile" and
# "pkg/mkverification-raw-efi/Dockerfile" accordingly:
# storage-init must follow installer
- name: storage-init
Expand All @@ -35,7 +41,7 @@ onboot:
- name: kdump
image: KDUMP_TAG
# If you change the order of pillar-onboot don't forget to
# change path to the "/containers/onboot/004-pillar-onboot/lower" in
# change path to the "/containers/onboot/005-pillar-onboot/lower" in
# "pkg/mkimage-raw-efi/config.json" and "pkg/mkverification-raw-efi/config.json"
# accordingly: 004-pillar-onboot must follow the order number of pillar-onboot
# to prepare services to start
Expand Down
65 changes: 65 additions & 0 deletions pkg/eve/installer/grub-installer.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
function installer_submenus {
menuentry 'interactive mode' {
set_global dom0_extra_args "$dom0_extra_args interactive=true"
}

menuentry 'force rootdelay for slow USB controllers' {
set_global dom0_extra_args "$dom0_extra_args rootdelay=30"
}

menuentry 'do NOT install - collect black box instead' {
set_global dom0_cmdline "$dom0_cmdline eve_blackbox"
}

menuentry 'pause before install' {
set_global dom0_cmdline "$dom0_cmdline eve_pause_before_install"
}

menuentry 'pause after install' {
set_global dom0_cmdline "$dom0_cmdline eve_pause_after_install"
}

menuentry 'skip installing rootfs' {
set_global dom0_cmdline "$dom0_cmdline eve_install_skip_rootfs"
}

menuentry 'skip installing config' {
set_global dom0_cmdline "$dom0_cmdline eve_install_skip_config"
}

menuentry 'skip installing persist' {
set_global dom0_cmdline "$dom0_cmdline eve_install_skip_persist"
}

menuentry 'set the target installation disk' {
set_global dom0_cmdline "$dom0_cmdline eve_install_disk=$eve_install_disk"
}

menuentry 'set the target persist disk' {
set_global dom0_cmdline "$dom0_cmdline eve_persist_disk=$eve_persist_disk"
}
}

function set_global {
set $1="$2"
export $1
}

install_part="$cmddevice"
if [ -n "$install_part" -a -f "($install_part)/rootfs.img" -a -f "($install_part)/initrd.img" ]; then
cat -s boot_uid "($install_part)/boot/.uuid"
set_global rootfs_root "($install_part)/rootfs.img"
set_global initrd "($install_part)/initrd.img ($install_part)/installer.img ($install_part)/rootfs.img"
set_global rootfs_title_suffix "-installer"
set_global do_extra_submenus "installer_submenus"
set_global dom0_extra_args "find_boot=$boot_uid root=/initrd.image overlaytmpfs getty"
set_global root "loop0"
set_global eve_flavor kvm

loopback loop0 "$rootfs_root"
if [ -f "($install_part)/config.img" ]; then
loopback loop1 "($install_part)/config.img"
set_global config_grub_cfg "(loop1)/grub-installer.cfg"
fi
configfile (loop0)/EFI/BOOT/grub-installer.cfg
fi
1 change: 1 addition & 0 deletions pkg/grub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@ CMD []
WORKDIR /EFI/BOOT
COPY --from=grub-build /grub-lib/BOOT* ./
COPY rootfs.cfg grub.cfg
COPY rootfs-installer.cfg grub-installer.cfg
Loading

0 comments on commit 7ad44db

Please sign in to comment.