-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·46 lines (37 loc) · 1.65 KB
/
init.sh
File metadata and controls
executable file
·46 lines (37 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# filepath: /home/ubuntu/Documents/studio/embedded-linux-buildroot/embedded-linux-buildroot/init.sh
set -e
echo "------------------------------------------------"
echo " Buildroot Build Environment Initializer "
echo " "
echo " Version 1.0 - 28/06/2025 "
echo " Developed by Walid Amriou "
echo "------------------------------------------------"
echo "--> Starting Buildroot environment setup"
# Update package lists
echo "--> Updating package lists"
sudo apt update
# Install required packages
echo "--> Installing required packages: build-essential, git, bc, bison, flex, unzip, wget, cpio, python3, rsync, file"
sudo apt install -y build-essential git bc bison flex unzip wget cpio python3 rsync file
# Check for sudo rights
if [[ $EUID -ne 0 ]]; then
echo "--> You are not running as root. Sudo will be used for privileged commands."
fi
# Check if Buildroot submodule exists
if [ ! -d "./buildroot" ]; then
echo "--> Initializing Buildroot submodule"
git submodule update --init --recursive
else
echo "--> Buildroot submodule already initialized"
fi
# Advise user to configure git identity if not set
GIT_NAME=$(git config --get user.name || true)
GIT_EMAIL=$(git config --get user.email || true)
if [[ -z "$GIT_NAME" || -z "$GIT_EMAIL" ]]; then
echo "--> WARNING: Git user.name and/or user.email not set."
echo "--> Please set them with:"
echo " git config --global user.name \"Your Name\""
echo " git config --global user.email \"you@example.com\""
fi
echo "--> Buildroot environment setup complete. You can now run ./build.sh"