diff options
author | 2024-01-23 11:50:29 +0100 | |
---|---|---|
committer | 2024-01-23 11:50:29 +0100 | |
commit | 7385ed39a40ca09e66e107b5f47a25d5b0ccbaf7 (patch) | |
tree | 1b9c3895596bb2e6f94b279d75e40d8432a49e47 | |
parent | dc9b0f067bd0b2bd5637841253e0b115c6aa8646 (diff) | |
download | alex-master.tar.gz alex-master.zip |
It's useful to configure the OS before building.
-rw-r--r-- | Makefile | 5 | ||||
-rwxr-xr-x | scripts/check-deps.sh | 52 |
2 files changed, 56 insertions, 1 deletions
@@ -2,7 +2,10 @@ KERNEL_VERSION = 5.11.6 BUSYBOX_VERSION = 1.33.0 SYSLINUX_VERSION = 6.03 -all: busybox linux initrd +all: check-deps busybox linux initrd + +check-deps: + scripts/check-deps.sh initrd: @mkdir -p $@ diff --git a/scripts/check-deps.sh b/scripts/check-deps.sh new file mode 100755 index 0000000..7568e47 --- /dev/null +++ b/scripts/check-deps.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +check_app() +{ + which $1 2>/dev/null 1>/dev/null + local result=$? + + echo -n "Checking $1..." + + if [ $result -gt 0 ]; then + echo 'Not found' + exit 1 + else + echo 'Found' + fi +} + +check_pkg() +{ + $pkg | grep $1 2>/dev/null 1>/dev/null + local result=$? + echo -n "Checking $1..." + + if [ $result -gt 0 ]; then + echo 'Not found' + exit 1 + else + echo 'Found' + fi +} + +fedora() +{ + check_app gcc + check_app make + check_pkg glibc-static +} + +osname=`cat /etc/os-release | grep ^ID= | sed -E 's/.*=(.*)/\1/'` +osver=`cat /etc/os-release | grep ^VERSION_ID= | sed -E 's/.*=(.*)/\1/g'` + +case $osname in + fedora) + pkg="dnf list installed" + fedora + ;; + freebsd) + ;; +esac + +echo +echo 'You can proceed building Alex GNU/Linux' |