Skip to content

Commit

Permalink
Merge pull request armarchindo#24 from armarchindo/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
armarchindo authored Aug 7, 2024
2 parents 6166a4d + efc594c commit bfd3497
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 17 deletions.
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,36 @@ https://github.com/user-attachments/assets/8a8802e7-96b2-4566-85cc-aad165e4f606
- done, the OpenWRT image is located in the `out` folder

### ULO script information
- ULO Repository Template : [ULO Repository](https://github.com/armarchindo/ULO-repository)
- How to change `ULO Repository` at `ULO Builder`
1. Fork [ULO Repository](https://github.com/armarchindo/ULO-repository) on your github
2. You can edit a `firmware`, `rootfs`, `kernel` files at your `ULO Repository`
3. Edit your ULO Script at lines `25`<br>
Change default ULO Repository to your URL Repository, example...
```bash
# DEFAULT REPOSITORY
# Kernel & Firmware Repository
repos="https://github.com/armarchindo/ULO-repository"
```
to
```bash
# YOUR CUSTOM REPOSITORY
# Kernel & Firmware Repository
repos="https://github.com/xxx/ULO-repository"
```
- ULO Command list :
```bash
Usage:
ulo [options]

Options:
-h, --help
-c, --clean
-k set the kernel (-k 6.6.6)
-m set the device (-m s905x2)
-s, --size=SIZE set size (-s 768)
-h, --help : Show this Text
-c, --clean : Cleaning old cache
-u, --update : Update Kernel, ROOTFS, and Firmware files from ULO-Repository
(Will Destroy your old Kernel, ROOTFS, and Firmware files!!!)
-k : set the kernel (-k 5.9.16)
-m : set the device (-m s905x2)
-s, --size=SIZE : set size (-s 768)
```
## About
> Script ULO ini dibuat karena mbah sepuh lagi gabut.
48 changes: 36 additions & 12 deletions ulo
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ out="./out"
minsize=640

# SOC
amlogic="s905x s905x2 s905x3 s905x4"
allwinner="h618-orangepi-zero3 h618-orangepi-zero2w h616-orangepi-zero2 h6-orangepi-lite2 h6-orangepi-3lts h6-orangepi-3 h6-orangepi-1plus h5-orangepi-zeroplus2 h5-orangepi-zeroplus h5-orangepi-prime h5-orangepi-pc2"
rockchip="rk3588s-orangepi-5 rk3588-orangepi-5plus rk3566-orangepi-3b"
amlogic=`ls -l ./core/loader/amlogic | grep s9 | awk '{ print $9 }' | cut -d. -f1`
allwinner=`ls -l ./core/loader/allwinner | grep u-boot-sunxi-with-spl | awk '{ print $9 }' | cut -c 23- | cut -d. -f1`
rockchip=`ls -l ./core/loader/rockchip | grep idbloader | awk '{ print $9 }' | cut -c 11- | cut -d. -f1`

# directory path
device_path="./device"
Expand All @@ -24,6 +24,8 @@ fwdriver_path="./core/root/lib"
# Kernel & Firmware Repository
repos="https://github.com/armarchindo/ULO-repository"

start_cnt=$SECONDS

die() {
echo -e "ERROR.. = $1"
exit 1
Expand Down Expand Up @@ -169,7 +171,7 @@ choose_rootfs() {
choose_kernel() {
local i=0
echo -e "Kernel:" | $lolcat -a -d 5
choose_option "${kernels[*]}" ${#kernels[*]}
choose_option "${kernels[*]}" ${#kernels[*]} "kernel"
local opt=$?
kernel=${kernels[opt]}
kernels=($kernel)
Expand All @@ -179,11 +181,28 @@ choose_kernel() {
choose_option() {
local options=$1
local len=$2
local optx=$3
local cnt=0

for x in ${options[*]}; do
echo -e "($((++i))) => $x "
done

if [ ! $optx ]; then
for x in ${options[*]}; do
echo -e "($((++i))) => $x "
done
else
for x in ${options[*]}; do
local kinfo=`ls core/kernel/${x} | grep dtb | cut -d- -f2`
if [ $kinfo = 'amlogic' ]; then
kinfo='Amlogic '
elif [ $kinfo = 'allwinner' ]; then
kinfo='AllWinner'
elif [ $kinfo = 'rockchip' ]; then
kinfo='Rockchip '
else
kinfo='Undefined'
fi
echo -e "($((++i))) => $kinfo $x "
done
fi

[ "$len" = 1 ] && return 0

Expand Down Expand Up @@ -238,6 +257,7 @@ unpack_openwrt() {
local path="$rootfs_path/$firmware"
local suffix="${firmware##*.}"
common_root="$tmp/core/root"
start_build=$SECONDS

mkdir -p $common_root

Expand Down Expand Up @@ -458,6 +478,7 @@ set_rootsize() {
local cnt=0

while [ $cnt -lt 3 ]; do
echo "Your rootfs size" | $lolcat -a -d 5
echo "Input number (256 512 640 768 1024 1536) default ${minsize}" | $lolcat -a -d 5
read -p "" rootsize
if [ ! "$rootsize" ]; then
Expand Down Expand Up @@ -618,8 +639,8 @@ EOF
echo -e "
======================================================================
----------------------------------------------------------------------
ULO BUILDER
By DBAI
ULO BUILDER
By DBAI
----------------------------------------------------------------------
======================================================================
" | $lolcat -a -d 5
Expand Down Expand Up @@ -714,6 +735,7 @@ done
[ "$rootsize" ] || set_rootsize

unpack_openwrt
echo "Building on progress..." | $lolcat -a -d 5

for kernel in ${kernels[*]}; do
for device in ${devices[*]}; do
Expand All @@ -735,12 +757,14 @@ echo -e "Build Information :
Size = $Total_size M
U-boot = ${uboot}" | $lolcat -a -d 5
echo " Output file = out/$device/$(cat ${rootfs_path}/rootfs.log | cut -d '-' -f1-3)-$device-k$kernel.img.gz" | $lolcat -a -d 5
echo -e ""
echo "Building on progress..." | $lolcat -a -d 5
cleaning 0

pigz -qf $out/$device/$(cat ${rootfs_path}/rootfs.log | cut -d '-' -f1-3)-$device-k$kernel.img || gzip $out/$device/$(cat ${rootfs_path}/rootfs.log | cut -d '-' -f1-3)-$device-k$kernel.img
tot_time=$(($SECONDS - $start_cnt))
build_time=$(($SECONDS - $start_build))

echo " Build Time = $(($build_time/60))m $(($build_time%60))s" | $lolcat -a -d 5
echo " Total Time = $(($tot_time/60))m $(($tot_time%60))s" | $lolcat -a -d 5
echo -e 'Done...' | $lolcat -a -d 5
echo -e ""
chmod -R 777 $out
Expand Down

0 comments on commit bfd3497

Please sign in to comment.