Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yocto-ktn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
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
KED Software Projects
Yocto
yocto-ktn
Commits
8bc4215e
Commit
8bc4215e
authored
9 years ago
by
Armin Mueck
Browse files
Options
Downloads
Patches
Plain Diff
added sd card scripts
parent
b4dac457
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/cp_mmcbootloader_to_sd.sh
+68
-0
68 additions, 0 deletions
scripts/cp_mmcbootloader_to_sd.sh
scripts/make-sd-card.sh
+64
-0
64 additions, 0 deletions
scripts/make-sd-card.sh
with
132 additions
and
0 deletions
scripts/cp_mmcbootloader_to_sd.sh
0 → 100755
+
68
−
0
View file @
8bc4215e
#!/bin/bash
ROT
=
"
\0
33[1;31m"
GRUEN
=
"
\0
33[1;32m"
BLAU
=
"
\0
33[1;34m"
SCHWARZ
=
"
\0
33[1;30m"
WEISS
=
"
\0
33[0;39m"
SD_DEVICE
=
sdb
#SOURCE_PATH=~/yocto-exceet/mmcbootloader
SOURCE_PATH
=
${
PWD
}
/tmp/deploy/images
U_BOOT_IMAGE
=
$SOURCE_PATH
/u-boot.imx
###############################################################################
# Funktionen
###############################################################################
function
print_error
()
{
echo
-e
"
$ROT$1$WEISS
"
exit
-1
}
function
print_warning
()
{
echo
-e
"
$ROT$1$WEISS
"
}
function
check_file
()
{
if
[
-f
$1
]
;
then
echo
"
$2
(Datei
$1
) gefunden"
else
print_error
"
$2
(Datei
$1
) nicht gefunden"
fi
}
function
check_blockdevice
()
{
if
[
-b
$1
]
;
then
echo
"
$2
(Datei
$1
) gefunden"
else
print_error
"
$2
(Datei
$1
) nicht gefunden"
fi
}
###############################################################################
date1
=
$(
date
+
"%s"
)
check_file
$U_BOOT_IMAGE
"U-Boot Bootloader"
check_blockdevice /dev/
$SD_DEVICE
"SD-Card Partition"
echo
-e
"kopiere
$U_BOOT_IMAGE
nach /dev/
$SD_DEVICE
..."
dd
if
=
$U_BOOT_IMAGE
of
=
/dev/
$SD_DEVICE
conv
=
fsync
bs
=
512
seek
=
2
echo
-e
-n
$BLAU
date2
=
$(
date
+
"%s"
)
diff
=
$((
date2-
$date1
))
echo
-e
"Skriptende! Zeit:
$diff
Sekunde(n)"
echo
-e
-n
$WEISS
This diff is collapsed.
Click to expand it.
scripts/make-sd-card.sh
0 → 100755
+
64
−
0
View file @
8bc4215e
#!/bin/bash
ROT
=
"
\0
33[1;31m"
GRUEN
=
"
\0
33[1;32m"
BLAU
=
"
\0
33[1;34m"
SCHWARZ
=
"
\0
33[1;30m"
WEISS
=
"
\0
33[0;39m"
SD_DEVICE
=
sdb
SOURCE_PATH
=
tmp/deploy/images
#SD_IMAGE=$SOURCE_PATH/image-exceet-mx6ssielaff.sdcard
SD_IMAGE
=
$SOURCE_PATH
/image-exceet-mx6sexceet.sdcard
#SD_IMAGE=$SOURCE_PATH/image-exceet-mx6dexceet.sdcard
###############################################################################
# Funktionen
###############################################################################
function
print_error
()
{
echo
-e
"
$ROT$1$WEISS
"
exit
-1
}
function
print_warning
()
{
echo
-e
"
$ROT$1$WEISS
"
}
function
check_file
()
{
if
[
-f
$1
]
;
then
echo
"
$2
(Datei
$1
) gefunden"
else
print_error
"
$2
(Datei
$1
) nicht gefunden"
fi
}
###############################################################################
date1
=
$(
date
+
"%s"
)
# untersuche, ob Partitionen gemountet sind, wenn ja, umount
for
i
in
$(
mount |
sed
-n
-e
"/
\/
dev
\/
${
SD_DEVICE
}
/p"
)
;
do
sdx
=
$(
echo
"
$i
"
|
grep
"/dev/
$SD_DEVICE
"
)
if
[
$sdx
]
;
then
echo
"unmount von
$sdx
"
umount
$sdx
fi
done
echo
-e
-n
$BLAU
echo
-e
"Erzeuge SD-Karte aus Image:
$PWD
/
$SD_IMAGE
"
dd
if
=
$SD_IMAGE
of
=
/dev/
$SD_DEVICE
bs
=
1M
conv
=
fsync
date2
=
$(
date
+
"%s"
)
diff
=
$((
date2-
$date1
))
echo
-e
"Dateien auf SD-Karte kopiert! Zeit:
$diff
Sekunde(n)"
echo
-e
-n
$WEISS
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