Skip to content

Commit

Permalink
Merged branch master into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Lopez committed Oct 24, 2016
2 parents ae3b48e + a342142 commit 399d530
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 18 deletions.
36 changes: 36 additions & 0 deletions U-boot/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
============================================================
Title: README

Author: Jose Lopez

Date: 2016-10-13

Email address: joselj@ugr.es

Description: Brief readme file to use uboot-mkimage.sh

============================================================

To make use of uboot-mkimage.sh, you will need a copy of the ugr-scripts
repository which is available at https://github.com/TimingKeepers/ugr-scripts

The script can be found at <repo_directory>/U-boot/uboot-mkimage.sh


First of all, you will need to export an environment variable:

$ export SCRIPT_BASE_FOLDER=/absolute/path/to/repository/ugr-scripts


Then, if you have a uramimage.image.gz file and you want to unpack it to some
location, just run:

$ ./uboot-mkimage.sh -u -r /absolute/path/where/image/will/be/unpacked -i /absolute/path/to/uramdisk.image.gz


Or the other way around (packing rootfs to a file):

$ ./uboot-mkimage.sh -p -r /absolute/path/where/image/will/be/unpacked -i /absolute/path/to/uramdisk.image.gz


Easy!
40 changes: 22 additions & 18 deletions U-boot/uboot-mkimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,29 @@
#

#include util.sh

function help_msg {
echo -e "-------------------------------------------------------------------"
echo -e "$(basename $0) -p -u -r <rootfs> -i <image>"
echo -e ""
echo -e "Options:"
echo -e "\t-m: Mode (pack|unpack)"
echo -e "\t-c: Compress mode (none|gzip)"
echo -e "\t-r: Root filesystem folder"
echo -e "\t-i: Image name without extension"
echo -e "\t-h: Print help message"
echo -e ""
echo -e "Variable SCRIPT_BASE_FOLDER must contain repository parent folder"
echo -e ""
echo -e "-------------------------------------------------------------------"
echo -e "Copyright (C) 2015, University of Granada"
echo -e "Miguel Jimenez Lopez <klyone@ugr.es>"
echo -e "GPLv2 License or later"
echo -e "-------------------------------------------------------------------"
}

if [ -z ${SCRIPT_BASE_FOLDER} ] ; then
help_msg
echo "ERROR: SCRIPT_BASE_FOLDER var not defined!"
exit -1
fi
Expand Down Expand Up @@ -49,24 +71,6 @@ function uboot_image_pack {
esac
}

function help_msg {
echo_norm "-------------------------------------------------------------------"
echo_norm "$(basename $0) -p -u -r <rootfs> -i <image>"
echo_norm ""
echo_norm "Options:"
echo_norm "\t-m: Mode (pack|unpack)"
echo_norm "\t-c: Compress mode (none|gzip)"
echo_norm "\t-r: Root filesystem folder"
echo_norm "\t-i: Image name without extension"
echo_norm "\t-h: Print help message"
echo_norm ""
echo_norm "-------------------------------------------------------------------"
echo_norm "Copyright (C) 2015, University of Granada"
echo_norm "Miguel Jimenez Lopez <klyone@ugr.es>"
echo_norm "GPLv2 License or later"
echo_norm "-------------------------------------------------------------------"
}

while getopts ":m:c:r:i:h" opt; do
case $opt in
m)
Expand Down

0 comments on commit 399d530

Please sign in to comment.