Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ function buildFilesystem() {
if [[ $fsDownloadOnly == "y" ]]; then
echo "Downloading Buildroot source packages for $arch ..."
make source
status=$?
[[ $status -gt 0 ]] && echo "Failed to download source packages for $arch." && exit $status
cd ..
echo "$arch filesystem packages downloaded. Exiting."
return 0
Expand Down Expand Up @@ -234,7 +236,7 @@ function buildKernel() {
kflags=$(makeFlags "$arch" kernel)
ktarget=bzImage
[[ $arch == arm64 ]] && ktarget=Image
kernelURL="https://www.kernel.org/pub/linux/kernel/v${KERNEL_VERSION:0:1}.x/linux-$KERNEL_VERSION.tar.xz"
kernelURL="https://cdn.kernel.org/pub/linux/kernel/v${KERNEL_VERSION:0:1}.x/linux-$KERNEL_VERSION.tar.xz"
echo "Preparing kernel $KERNEL_VERSION on $arch build:"
[[ -d kernelsource$arch ]] && rm -rf "kernelsource$arch"
if [[ ! -f linux-$KERNEL_VERSION.tar.xz ]]; then
Expand Down
15 changes: 8 additions & 7 deletions dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ declare -ar common_dependencies=(
"bzip2"
"findutils"
"autoconf"
"automake"
"libtool"
"autopoint"
)

declare -ar deb_dependencies=(
"libelf-dev"
"xz-utils"
"g++"
"libncurses-dev"
"autopoint"
)

declare -ar rhel_dependencies=(
Expand All @@ -42,6 +43,7 @@ declare -ar rhel_dependencies=(
"xz"
"gcc-c++"
"ncurses-devel"
"gettext-devel"
)


Expand All @@ -62,15 +64,15 @@ function checkDependencies() {
"debian" | "ubuntu")
dependencies=("${common_dependencies[@]}" "${deb_dependencies[@]}")
package_manager="sudo apt install -y"
pkgmgr() {
dpkg -l
pkginstalled() {
dpkg -s "$1" 2> /dev/null | grep -q "^Status:.*ok installed"
}
;;
"rhel" | "rocky" | "fedora")
dependencies=("${common_dependencies[@]}" "${rhel_dependencies[@]}")
package_manager="sudo dnf install -y"
pkgmgr() {
rpm -qa --qf "ii %{NAME}\n"
pkginstalled() {
rpm -q --whatprovides "$1" > /dev/null 2>&1
}
if [[ $running_os == "rhel" || $running_os == "rocky" ]]; then
__epel_repo_message
Expand All @@ -85,8 +87,7 @@ function checkDependencies() {

missing_packages=""
for package in "${dependencies[@]}"; do
pkgmgr | awk '{print $2}' | cut -d':' -f1 | grep -qe "${package}"
if [[ $? -ne 0 ]]; then
if ! pkginstalled "${package}"; then
missing_packages="${missing_packages} ${package}"
fi
done
Expand Down