Skip to content

Commit

Permalink
Add code snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
ophub committed Feb 11, 2022
1 parent 1d7f472 commit d6d35e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
14 changes: 8 additions & 6 deletions rebuild
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,13 @@ clean_tmp() {
loop_rebuild() {
cd ${make_path}

k=1
j=1
for b in ${build_armbian[*]}; do

i=1
for x in ${build_kernel[*]}; do
for k in ${build_kernel[*]}; do
{
echo -n "(${k}.${i}) Start building Armbian [ ${b} - ${x} ]. "
echo -n "(${j}.${i}) Start building Armbian [ ${b} - ${k} ]. "
now_remaining_space=$(df -hT ${PWD} | grep '/dev/' | awk '{print $5}' | sed 's/.$//' | awk -F "." '{print $1}')
if [[ "${now_remaining_space}" -le "2" ]]; then
echo "Remaining space is less than 2G, exit this build. \n"
Expand All @@ -668,7 +668,7 @@ loop_rebuild() {

# The loop variable assignment
soc="${b}"
kernel="${x}"
kernel="${k}"

# Execute the following functions in sequence
make_image
Expand All @@ -677,12 +677,12 @@ loop_rebuild() {
copy_files
clean_tmp

echo -e "(${k}.${i}) Armbian build successfully. \n"
echo -e "(${j}.${i}) Armbian build successfully. \n"
let i++
}
done

let k++
let j++
done
}

Expand All @@ -693,6 +693,7 @@ echo -e "Welcome to Rebuild Armbian for Amlogic s9xxx tv box!"
echo -e "Server CPU configuration information: \n$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c) \n"
echo -e "Server memory usage: \n$(free -h) \n"
echo -e "Server space usage before starting to compile: \n$(df -hT ${PWD}) \n"
#
# Initialize variables and download the kernel
init_var "${@}"
find_rebuild && echo -e "Armbian rebuild file: [ ${armbian_rebuild_name} ], Version: [ ${armbian_rebuild_version} ]"
Expand All @@ -701,6 +702,7 @@ echo -e "Armbian SoC List: [ $(echo ${build_armbian[*]} | tr "\n" " ") ]"
echo -e "Kernel List: [ $(echo ${build_kernel[*]} | tr "\n" " ") ] \n"
# Loop to rebuild armbian firmware
loop_rebuild
#
# Show server end information
echo -e "Server space usage after compilation: \n$(df -hT ${PWD}) \n"
# All process completed
Expand Down
13 changes: 7 additions & 6 deletions recompile
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,10 @@ clean_tmp() {
loop_recompile() {
cd ${make_path}

k=1
for x in ${build_kernel[*]}; do
j=1
for k in ${build_kernel[*]}; do
# kernel_version, such as [ 5.4.170 ]
kernel_version="${x}"
kernel_version="${k}"
# kernel_verpatch, such as [ 5.4 ]
kernel_verpatch="$(echo ${kernel_version} | awk -F '.' '{print $1"."$2}')"
# kernel_sub, such as [ 170 ]
Expand All @@ -555,7 +555,7 @@ loop_recompile() {
packit_kernel
clean_tmp

let k++
let j++
done
}

Expand All @@ -567,15 +567,16 @@ echo -e "Welcome to compile kernel! \n"
echo -e "Server CPU configuration information: \n$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c) \n"
echo -e "Server memory usage: \n$(free -h) \n"
echo -e "Server space usage before starting to compile: \n$(df -hT ${PWD}) \n"
#
# Initialize variables and download the kernel source code
init_var "${@}"
[[ "${auto_kernel}" == "true" ]] && query_version
echo -e "Kernel from: [ ${code_owner} ]"
echo -e "Kernel List: [ $(echo ${build_kernel[*]} | tr "\n" " ") ]"
echo -e "Ready, start compile kernel... \n"
echo -e "Kernel List: [ $(echo ${build_kernel[*]} | tr "\n" " ") ] \n"
# Check the toolchain and loop to compile the kernel
toolchain_check
loop_recompile
#
# Show server end information
echo -e "${INFO} Server space usage after compilation: \n$(df -hT ${PWD}) \n"
# All process completed
Expand Down

0 comments on commit d6d35e2

Please sign in to comment.