From d342d88c805548823f2f49b80d0df010777414e6 Mon Sep 17 00:00:00 2001 From: lgromero Date: Thu, 30 May 2024 20:38:31 +0200 Subject: [PATCH] refs #401 #404 Adds directories etc and lib that uses oglivecli and adds a new pxe template --- installer/ogboot_installer.py | 12 +++++++++++- tftpboot/ipxe_scripts/templates/pxe_default | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tftpboot/ipxe_scripts/templates/pxe_default diff --git a/installer/ogboot_installer.py b/installer/ogboot_installer.py index 6a0306a..7097929 100755 --- a/installer/ogboot_installer.py +++ b/installer/ogboot_installer.py @@ -321,7 +321,11 @@ def create_ogboot_project(path_opengnsys_base): src_dest = os.path.join(path_opengnsys_base, "src") config_source = os.path.join(WORKDIR, "ogboot/config") - config_dest = os.path.join(path_opengnsys_base, "config") + config_dest = os.path.join(path_opengnsys_base, "config") + + lib_source = os.path.join(WORKDIR, "ogboot/lib") + lib_dest = os.path.join(path_opengnsys_base, "lib") + if os.path.exists(bin_dest): shutil.rmtree(bin_dest) shutil.copytree(bin_source, bin_dest) @@ -334,6 +338,12 @@ def create_ogboot_project(path_opengnsys_base): shutil.rmtree(config_dest) shutil.copytree(config_source, config_dest) + if os.path.exists(lib_dest): + shutil.rmtree(lib_dest) + shutil.copytree(lib_source, lib_dest) + + os.makedirs(os.path.join(INSTALL_TARGET, "etc")) + subprocess.run(["sudo", "chmod", "-R", "755", path_opengnsys_base]) subprocess.run(["sudo", "chown", "-R", "ogboot:ogboot", path_opengnsys_base]) diff --git a/tftpboot/ipxe_scripts/templates/pxe_default b/tftpboot/ipxe_scripts/templates/pxe_default new file mode 100644 index 0000000..e461b30 --- /dev/null +++ b/tftpboot/ipxe_scripts/templates/pxe_default @@ -0,0 +1,19 @@ +#!ipxe +set timeout 0 +set timeout-style hidden + +set ISODIR __OGLIVE__ +set default 0 +set kernelargs __INFOHOST__ +# MenĂº de entrada para seleccionar OgLive +:try_iso +kernel tftp://__SERVERIP__/${ISODIR}/ogvmlinuz ${kernelargs} || goto fallback +initrd tftp://172.17.8.86/${ISODIR}/oginitrd.img +boot + +:fallback +echo "OgLive default" +set ISODIR ogLive +kernel tftp://__SERVERIP__/${ISODIR}/ogvmlinuz ${kernelargs} +initrd tftp://__SERVERIP__/${ISODIR}/oginitrd.img +boot \ No newline at end of file