3 Commits
24.04 ... 24.05

Author SHA1 Message Date
ngn
aabaf9c60b fix: rename matter-iso build function 2024-08-19 01:10:22 +03:00
ngn
7c53eadf9d update: VERSION in Makefile 2024-08-19 00:52:16 +03:00
ngn
bfd7db3136 update: make sure mp-build checks build-essential as a depend 2024-08-19 00:50:31 +03:00
4 changed files with 44 additions and 24 deletions

View File

@ -1,5 +1,5 @@
SUBDIRS := $(wildcard */.)
VERSION = 24.04
VERSION = 24.05
install:
@for dir in $(SUBDIRS) ; do \

View File

@ -8,7 +8,6 @@ Following dependencies are required for these scripts and tools:
- bash
- coreutils
- gcc
- make
- GRUB (please see matter-iso warning)
- gnupg

View File

@ -65,7 +65,7 @@ check_iso_vars() {
return 1
elif [ ! -n "$VERSION" ]; then
return 1
elif ! type build &>/dev/null; then
elif ! type BUILD &>/dev/null; then
return 1
fi
@ -78,8 +78,8 @@ check_iso_vars() {
if ! type "grub-mkrescue" > /dev/null; then
error "You need to install GRUB to create ISO files with grub-mkrescue"
set_indent
info "If you want to create UEFI ISO files make sure you install x64 GRUB or grub-efi"
info "If you want to create BIOS ISO files make sure you install x86 GRUB or grub-bios"
warn "If you want to create UEFI ISO files make sure you install x64 GRUB or grub-efi"
warn "If you want to create BIOS ISO files make sure you install x86 GRUB or grub-bios"
exit 1
fi
@ -191,7 +191,7 @@ if [ ! -z "${PKGS1}" ]; then
fi
info "Running build script"
echo "source /iso.sh && build" > "${tmpdir}/stager.sh"
echo "source /iso.sh && BUILD" > "${tmpdir}/stager.sh"
matter-chroot "${tmpdir}" chmod +x /stager.sh
matter-chroot "${tmpdir}" /stager.sh
check_ret "Build script failed"

View File

@ -105,26 +105,32 @@ clean_dist() {
rm -f "${distpath}/files.tar.gz"
}
# checks/installs a list of depends
check_depends() {
local list=("$@")
if [ "${#list[@]}" == "0" ]; then
info "Got zero depends, skipping depend check"
return 0
fi
# install a list of packages with matt
matt_install(){
if [ "$EUID" -ne 0 ]; then
if type doas > /dev/null; then
DOAS="doas"
elif type sudo > /dev/null; then
DOAS="sudo"
else
error "Failed to find doas or sudo, skipping depend check"
return 0
error "Failed to find doas or sudo, cannot run the install command"
return 1
fi
fi
$DOAS matt install --yes --skip --ignore-none $@
return $?
}
# checks and installs a list of depends
check_depends() {
local list=("$@")
if [ "${#list[@]}" == "0" ]; then
info "Got zero depends, skipping depend check"
return 0
fi
for dep in "${list[@]}"; do
if [ -z "${depends_str}" ]; then
depends_str="${dep}"
@ -133,12 +139,12 @@ check_depends() {
fi
done
depends_uniq=$(echo "${depends_str}" | tr ' ' '\n' | sort | uniq)
depends_count=$(echo "${depends_uniq}" | wc -l)
depends_uniq=$(echo "${depends_uniq}" | tr '\n' ' ')
depends_uniq="$(echo "${depends_str}" | tr ' ' '\n' | sort | uniq)"
depends_count="$(echo "${depends_uniq}" | wc -l)"
depends_uniq="$(echo "${depends_uniq}" | tr '\n' ' ')"
info "Installing ${depends_count} depends"
$DOAS matt install --yes --skip --ignore-none $depends_uniq
matt_install $depends_uniq
return $?
}
@ -202,10 +208,12 @@ if [ ! -d "${TARGET}" ]; then
fi
if [ $OPT_NO_DEPEND -eq 0 ] && ! command -v matt &> /dev/null; then
error "!!! BUILD ON MATTERLINUX !!!"
error "matt is not installed, please build on a MatterLinux system"
error "Do NOT create bug reports if build fails on non-MatterLinux systems"
error "BUILD ON MATTERLINUX!"
set_indent
warn "matt is not installed, please build on a MatterLinux system"
warn "Do NOT create bug reports if build fails on non-MatterLinux systems"
info "Auto enabling NO_DEPEND as depend check will fail without matt"
unset_indent
OPT_NO_DEPEND=1
fi
@ -277,8 +285,21 @@ all_depends+=("${DEPENDS[@]}")
all_depends+=("${BUILD[@]}")
if [ $OPT_NO_DEPEND -eq 0 ]; then
info "Checking all the dependencies"
set_indent
is_essential_installed="$(matt info build-essential --grep | grep INSTALLED)"
is_essential_installed="$(echo "${is_essential_installed}" | cut -d: -f2)"
if [ "${is_essential_installed}" == "0" ]; then
info "Installing build-essential (required for every build)"
matt_install build-essential
check_ret "Failed to install build-essential package"
fi
check_depends "${all_depends[@]}"
check_ret "Failed to check all the dependencies"
unset_indent
fi
# make sure file count and the hash count is the same