Skip to content

Commit

Permalink
Merge pull request #12 from jadonk/master
Browse files Browse the repository at this point in the history
Pull in ISO update
  • Loading branch information
jadonk authored Nov 7, 2016
2 parents 7587b40 + c5f5316 commit 9b8580c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store
*.img
*.img.xz
*.iso
*.iso.xz
56 changes: 43 additions & 13 deletions scripts/generate_img.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ TEMPDIR=$(mktemp -d)
###
imagename="beaglebone-getting-started-$(git log -1 --date=short --pretty=format:%cd)"
image_size_mb="40"
image_format="iso"
###

check_root () {
Expand All @@ -50,9 +51,13 @@ check_for_command () {
detect_software () {
unset NEEDS_COMMAND

check_for_command mkfs.vfat dosfstools
check_for_command partprobe parted
check_for_command kpartx kpartx
if [ "x${image_format}" = "xfat" ] ; then
check_for_command mkfs.vfat dosfstools
check_for_command partprobe parted
check_for_command kpartx kpartx
elif [ "x${image_format}" = "xiso" ] ; then
check_for_command xorriso xorriso
fi

if [ "${NEEDS_COMMAND}" ] ; then
echo ""
Expand Down Expand Up @@ -258,17 +263,31 @@ populate_partition () {
echo "-----------------------------"
}

media="${DIR}/${imagename}.img"
check_root
if [ -f "${media}" ] ; then
rm -rf "${media}" || true
fi
dd if=/dev/zero of="${media}" bs=1024 count=0 seek=$((1024 * ${image_size_mb}))

check_root
detect_software
create_partitions
populate_partition
if [ "x${image_format}" = "xfat" ] ; then
media="${DIR}/${imagename}.img"
check_root
if [ -f "${media}" ] ; then
rm -rf "${media}" || true
fi
dd if=/dev/zero of="${media}" bs=1024 count=0 seek=$((1024 * ${image_size_mb}))

check_root
create_partitions
populate_partition
elif [ "x${image_format}" = "xiso" ] ; then
rm -f ${imagename}.iso
xorrisofs -r -J -o ${imagename}.iso -graft-points \
App=./App \
Drivers=./Drivers \
Docs=./Docs \
scripts=./scripts \
autorun.inf \
LICENSE.txt \
README.htm \
README.md \
START.htm
fi

if [ -f ${imagename}.img ] ; then
echo "-----------------------------"
Expand All @@ -279,5 +298,16 @@ if [ -f ${imagename}.img ] ; then
echo "img: ${imagename}.img.xz"
echo "-----------------------------"

fi

if [ -f ${imagename}.iso ] ; then
echo "-----------------------------"
chown -R 1000:1000 ${imagename}.iso
echo "iso: ${imagename}.iso"
echo "-----------------------------"
#xz -z -8 -v ${imagename}.iso
echo "iso: ${imagename}.iso.xz"
echo "-----------------------------"

fi
#

0 comments on commit 9b8580c

Please sign in to comment.