Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
meta-vesta
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vesta
meta-vesta
Commits
ae0825a5
Commit
ae0825a5
authored
7 years ago
by
David Mondou
Browse files
Options
Downloads
Patches
Plain Diff
Added ability to read custom serial numbers.
parent
17ba8816
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
recipes-core/initscripts/files/hostname.sh
+38
-4
38 additions, 4 deletions
recipes-core/initscripts/files/hostname.sh
recipes-core/rigtools/rigtools.bb
+2
-2
2 additions, 2 deletions
recipes-core/rigtools/rigtools.bb
with
40 additions
and
6 deletions
recipes-core/initscripts/files/hostname.sh
+
38
−
4
View file @
ae0825a5
...
...
@@ -15,10 +15,10 @@ get_sn () {
local
base
=
$1
local
arena
=
$(
get_fuse HW_OCOTP_GP
$base
7
)
if
[[
${
arena
:0:2
}
==
"00"
]]
;
then
# starts with "00", so doesn't start with ascii hex value
# starts with "00", so doesn't start with ascii hex value
arena
=
${
arena
:2
}
else
# doesn't start with "00", so starts with ascii hex value
# doesn't start with "00", so starts with ascii hex value
arena
=
$(
printf
"
\x
${
arena
:0:2
}${
arena
:2
}
"
)
fi
...
...
@@ -28,11 +28,45 @@ get_sn () {
echo
"
$arena$build
-
$unit
"
}
if
[[
"
$(
cat
/sys/fsl_otp/HW_OCOTP_GP37
)
"
==
"0x0"
]]
;
then
#Read create custom serial number from fuses
get_custom_sn
()
{
local
fuse_70
=
`
cat
/sys/fsl_otp/HW_OCOTP_GP70
`
local
fuse_71
=
`
cat
/sys/fsl_otp/HW_OCOTP_GP71
`
local
fuse_72
=
`
cat
/sys/fsl_otp/HW_OCOTP_GP72
`
local
strhex
#Check for empty fuse bank
if
[
${
fuse_72
}
!=
"0x0"
]
;
then
strhex
=
${
fuse_72
:2:8
}
fi
#Check for empty fuse bank
if
[
${
fuse_71
}
!=
"0x0"
]
;
then
strhex
=
${
strhex
}${
fuse_71
:2:8
}
fi
strhex
=
${
strhex
}${
fuse_70
:2:8
}
local
i
=
1
max
=
$((
${#
strhex
}
+
1
))
#convert hex string to ascii string
while
[
$i
-lt
$max
]
do
hex
=
'\x'
`
echo
$strhex
|
cut
-c
$i
-
$((
i
+
1
))
`
custom_sn
=
$custom_sn$hex
i
=
$((
i
+
2
))
done
echo
-e
$custom_sn
}
if
[[
"
$(
cat
/sys/fsl_otp/HW_OCOTP_GP70
)
"
!=
"0x0"
]]
;
then
hostname
$(
get_custom_sn
)
elif
[[
"
$(
cat
/sys/fsl_otp/HW_OCOTP_GP37
)
"
==
"0x0"
]]
;
then
# No unit serial number set, use board serial number
hostname
$(
get_sn 34
)
.
$url
else
# unit serial number set, use it
hostname
$(
get_sn 37
)
.
$url
fi
This diff is collapsed.
Click to expand it.
recipes-core/rigtools/rigtools.bb
+
2
−
2
View file @
ae0825a5
...
...
@@ -4,7 +4,7 @@ SUMMARY = "Rigado's general purpose tool"
DESCRIPTION = "A tool for the gateway which changes functionality based on how it is linked"
# The latest commit
SRCREV = "
313aef4435f7a03cfde79c2e480f3768d195e284
"
SRCBRANCH ?= "v2.
0
.0"
SRCREV = "
27ca31691fdd0a2e1aa5989e9fa9e22001b643e6
"
SRCBRANCH ?= "v2.
1
.0"
require recipes-core/rigtools/rigtools.inc
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment