Skip to content

Commit

Permalink
Fix path for common ISO generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev committed Jun 18, 2024
1 parent 0da661c commit 33c9702
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 25 deletions.
25 changes: 9 additions & 16 deletions iso/scripts/common_iso_generation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ WORKDIR="/usr/src/app"
ISO_BUILD_PATH="${WORKDIR}/dappnode-iso"
DAPPNODE_ISO_PREFIX="Dappnode-"

add_dappnode_files() {
local iso_build_path=$1
local workdir=$2

echo "[INFO] Creating necessary directories and copying files..."
mkdir -p ${iso_build_path}/dappnode
cp -r ${workdir}/scripts ${iso_build_path}/dappnode
cp -r ${workdir}/dappnode/* ${iso_build_path}/dappnode
}

download_iso() {
local iso_path=$1
local iso_name=$2
Expand Down Expand Up @@ -67,14 +57,17 @@ prepare_boot_process() {
dd if="${iso_path}" bs=${block_size} count=1 of="${mbr_output_path}"
}

download_third_party_packages() {
echo "[INFO] Downloading third-party packages..."
sed '1,/^\#\!ISOBUILD/!d' ${WORKDIR}/scripts/dappnode_install_pre.sh >/tmp/vars.sh
# shellcheck disable=SC1091
source /tmp/vars.sh
add_dappnode_files_to_iso_build() {
local iso_build_path=$1
local workdir=$2

echo "[INFO] Creating necessary directories and copying files..."
mkdir -p ${iso_build_path}/dappnode
cp -r ${workdir}/scripts ${iso_build_path}/dappnode
cp -r ${workdir}/dappnode/* ${iso_build_path}/dappnode
}

# TODO: Is this ok for Ubuntu?
# TODO: Is this ok for Ubuntu? Check what this is for
handle_checksums() {
echo "Fix md5 sum..."
# shellcheck disable=SC2046
Expand Down
7 changes: 4 additions & 3 deletions iso/scripts/generate_dappnode_iso_debian.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
set -e

source /usr/src/app/iso/scripts/common_iso_generation.sh
SCRIPTS_DIR=$(dirname "${BASH_SOURCE[0]}")

source ${SCRIPTS_DIR}/common_iso_generation.sh

# Source = https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.5.0-amd64-netinst.iso
BASE_ISO_NAME="debian-12.5.0-amd64-netinst.iso"
Expand Down Expand Up @@ -89,8 +91,7 @@ verify_download "${BASE_ISO_PATH}" "${BASE_ISO_SHASUM}"
clean_old_files "${ISO_BUILD_PATH}" "${DAPPNODE_ISO_PREFIX}"
extract_iso "${BASE_ISO_PATH}" "${ISO_BUILD_PATH}"
prepare_boot_process "${BASE_ISO_PATH}" "${ISO_BUILD_PATH}/isolinux/isohdpfx.bin"
download_third_party_packages
add_dappnode_files "${ISO_BUILD_PATH}" "${WORKDIR}"
add_dappnode_files_to_iso_build "${ISO_BUILD_PATH}" "${WORKDIR}"
customize_debian_preseed "${ISO_BUILD_PATH}" "${WORKDIR}"
configure_boot_menu "${ISO_BUILD_PATH}" "${WORKDIR}"
handle_checksums # TODO: Check if it fits both ubuntu and debian
Expand Down
9 changes: 3 additions & 6 deletions iso/scripts/generate_dappnode_iso_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/bin/bash
set -e

source /usr/src/app/iso/scripts/common_iso_generation.sh
SCRIPTS_DIR=$(dirname "${BASH_SOURCE[0]}")

DAPPNODE_SCRIPTS_PATH="/usr/src/app/scripts"
VARS_FILE="/tmp/vars.sh"
TMP_INITRD="/tmp/makeinitrd"
source ${SCRIPTS_DIR}/common_iso_generation.sh

BASE_ISO_NAME=ubuntu-24.04-live-server-amd64.iso
BASE_ISO_PATH="/images/${BASE_ISO_NAME}"
Expand Down Expand Up @@ -69,8 +67,7 @@ clean_old_files "${ISO_BUILD_PATH}" "${DAPPNODE_ISO_PREFIX}"
extract_iso "${BASE_ISO_PATH}" "${ISO_BUILD_PATH}"
prepare_boot_process "${BASE_ISO_PATH}" "${ISO_BUILD_PATH}/mbr"
get_efi_partition "${BASE_ISO_PATH}" "${ISO_BUILD_PATH}/efi"
download_third_party_packages
add_dappnode_files "${ISO_BUILD_PATH}" "${WORKDIR}"
add_dappnode_files_to_iso_build "${ISO_BUILD_PATH}" "${WORKDIR}"
add_ubuntu_autoinstall "/usr/src/app/iso/preseeds/ubuntu" "${ISO_BUILD_PATH}"
configure_boot_menu
handle_checksums
Expand Down

0 comments on commit 33c9702

Please sign in to comment.