Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
4a2820f8
Commit
4a2820f8
authored
Apr 26, 2018
by
Igor Pecovnik
Browse files
Added DTB switching for Odroid XU4 family
parent
ce5b9f01
Changes
3
Show whitespace changes
Inline
Side-by-side
debian-config-functions
100755 → 100644
View file @
4a2820f8
...
...
@@ -194,15 +194,21 @@ function aval_kernel ()
#
# check if board has alternative kernels
#
function
aval_
cubox
()
function
aval_
dtbs
()
{
if
[[
$LINUXFAMILY
==
cubox
]]
;
then
local
width
=
80
LIST
=(
"imx6dl-hummingboard.dtb"
"HB Solo/DualLite"
"imx6dl-hummingboard-emmc-som-v15.dtb"
"HB Solo/DualLite v1.5 with eMMC"
"imx6dl-hummingboard-som-v15.dtb"
"HB Solo/DualLite v1.5"
\
"imx6dl-hummingboard2.dtb"
"HB2 Solo/DualLite"
"imx6dl-hummingboard2-emmc-som-v15.dtb"
"HB2 Solo/DualLite v1.5 with eMMC"
"imx6dl-hummingboard2-som-v15.dtb"
"HB2 Solo/DualLite v1.5"
\
"imx6q-hummingboard.dtb"
"HB Dual/Quad"
"imx6q-hummingboard-emmc-som-v15.dtb"
"HB Dual/Quad v1.5 with eMMC"
"imx6q-hummingboard-som-v15.dtb"
"HB Dual/Quad v1.5"
\
"imx6q-hummingboard2.dtb"
"HB2 Dual/Quad"
"imx6q-hummingboard2-emmc-som-v15.dtb"
"HB2 Dual/Quad v1.5 with eMMC"
"imx6q-hummingboard2-som-v15.dtb"
"HB2 Dual/Quad v1.5"
\
"imx6dl-cubox-i.dtb"
"Cubox-i Solo/DualLite"
"imx6dl-cubox-i-emmc-som-v15.dtb"
"Cubox-i Solo/DualLite v1.5 with eMMC"
"imx6dl-cubox-i-som-v15.dtb"
"Cubox-i Solo/DualLite v1.5"
\
"imx6q-cubox-i.dtb"
"Cubox-i Dual/Quad"
"imx6q-cubox-i-emmc-som-v15.dtb"
"Cubox-i Dual/Quad v1.5 with eMMC"
"imx6q-cubox-i-som-v15.dtb"
"Cubox-i Dual/Quad v1.5"
)
else
local
width
=
52
LIST
=(
"xu4"
"Odroid XU4"
"xu3"
"Odroid XU3"
"xu3l"
"Odroid XU3 Lite"
"hc1"
"Odroid HC1/HC2"
)
fi
LIST_LENGHT
=
$((${#
LIST
[@]
}
/
2
))
;
if
[
"
$LIST_LENGHT
"
-eq
1
]
;
then
...
...
@@ -210,7 +216,7 @@ function aval_cubox ()
else
exec
3>&1
TARGET_BOARD
=
$(
dialog
--cancel-label
"Cancel"
--backtitle
"
$BACKTITLE
"
--no-collapse
\
--title
"Select board configuration"
--clear
--menu
""
$((
6
+
${
LIST_LENGHT
}))
80
25
"
${
LIST
[@]
}
"
2>&1 1>&3
)
--title
"Select
optimised
board configuration"
--clear
--menu
""
$((
6
+
${
LIST_LENGHT
}))
${
width
}
25
"
${
LIST
[@]
}
"
2>&1 1>&3
)
exitstatus
=
$?
;
exec
3>&-
fi
...
...
debian-config-jobs
100755 → 100644
View file @
4a2820f8
...
...
@@ -1136,16 +1136,17 @@ function jobs ()
;;
# Switch to alternative
kernel
s
# Switch to alternative
configuration
s
#
"DTB"
)
if
!
is_package_manager_running
;
then
aval_
cubox
aval_
dtbs
if
[[
$exitstatus
=
0
]]
;
then
BOX_LENGHT
=
$((${#
TARGET_BOARD
}
+
2
4
))
;
BOX_LENGHT
=
$((${#
TARGET_BOARD
}
+
2
8
))
;
dialog
--title
"Switching board config"
--backtitle
"
$BACKTITLE
"
--yes-label
"Reboot"
--no-label
"Cancel"
--yesno
"
\n
Reboot to
$TARGET_BOARD
settings?"
7
$BOX_LENGHT
if
[[
$?
=
0
]]
;
then
sed
-i
"s/^fdt_file=.*/fdt_file=
$TARGET_BOARD
/"
/boot/armbianEnv.txt
&&
grep
-q
"fdt_file=
$TARGET_BOARD
"
/boot/armbianEnv.txt
||
echo
"fdt_file=
$TARGET_BOARD
"
>>
/boot/armbianEnv.txt
sed
-i
"s/^fdt_file=.*/fdt_file=
$TARGET_BOARD
/"
/boot/armbianEnv.txt 2> /dev/null
&&
grep
-q
"fdt_file=
$TARGET_BOARD
"
/boot/armbianEnv.txt 2> /dev/null
||
echo
"fdt_file=
$TARGET_BOARD
"
>>
/boot/armbianEnv.txt
[[
"
$LINUXFAMILY
"
=
odroidxu4
]]
&&
sed
-i
"s/^fdt_file/board_name/"
/boot/armbianEnv.txt
reboot
;
fi
fi
...
...
debian-config-submenu
100755 → 100644
View file @
4a2820f8
...
...
@@ -49,6 +49,7 @@ while true; do
[[
-d
${
OVERLAYDIR
}
]]
&&
\
LIST+
=(
"Hardware"
"Toggle hardware configuration: UART, I2C, etc."
)
[[
"
$LINUXFAMILY
"
=
cubox
&&
"
$BRANCH
"
=
"next"
]]
&&
LIST+
=(
"DTB"
"Switch board .dtb configuration"
)
[[
"
$LINUXFAMILY
"
=
odroidxu4
&&
"
$BRANCH
"
=
"next"
]]
&&
LIST+
=(
"DTB"
"Select optimised board configuration"
)
[[
-f
/usr/bin/bin2fex
&&
"
$LINUXFAMILY
"
=
sun
*
i
&&
"
$BRANCH
"
=
"default"
]]
&&
LIST+
=(
"Fexedit"
"Board (fex) settings editor"
)
[[
$(
apt-cache search
--names-only
'^linux-'
$(
lsb_release
-cs
)
'-root.*.'
$BOARD
''
|
sed
's/.*(\(.*\))/\1/'
|
awk
'{print $1}'
\
|
wc
-l
)
-gt
1
&&
-z
"
${
mark
}
"
]]
&&
LIST+
=(
"Switch"
"Switch to alternative kernels"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment