From 0308aefb96a01181b7c161f59377328d2a795406 Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Tue, 19 Aug 2008 15:42:02 -0400 Subject: [PATCH] strip common stuff out of mkext3.sh Signed-off-by: Andres Salomon --- mkimg.sh => mkext3.sh | 50 +++---------------------------------------- mkjffs2.sh | 2 +- 2 files changed, 4 insertions(+), 48 deletions(-) rename mkimg.sh => mkext3.sh (81%) mode change 100644 => 100755 diff --git a/mkimg.sh b/mkext3.sh old mode 100644 new mode 100755 similarity index 81% rename from mkimg.sh rename to mkext3.sh index a56e4b7..d08485e --- a/mkimg.sh +++ b/mkext3.sh @@ -15,8 +15,6 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - IMG_NAME="DebOLPC" ROOT_SIZE="512" @@ -24,22 +22,7 @@ IMG_LABEL="DebOLPC" ROOT_DIR="" CRCIMG="./crcimg.pl" - -PREREQ_CMDS="losetup dd parted mke2fs tune2fs grub" - -check_for_cmds() -{ - err=0 - for cmd in $PREREQ_CMDS; do - which $cmd >/dev/null || { - echo "Missing required command '$cmd'!" 1>&2 - err=1 - } - done - if [ "$err" = 1 ]; then - exit 1 - fi -} +. functions.sh # @img - fs image to attach loop device to # @offset - if the image is partitioned, the offset to attach at @@ -112,23 +95,6 @@ mk_bootable_img() parted -s "$img" "set 1 boot on" } -# @mntpt - path to mounted root directory -# @fstype - the root filesystem type (in a form that 'mount' understands) -mk_fstab() -{ - mntpt="$1" - fstype="$2" - - cat >${mntpt}/etc/fstab< ${IMG_NAME}.jffs2.crc -} - - usage() { echo "" 1>&2 @@ -211,7 +168,7 @@ usage() exit 1 } -check_for_cmds +check_for_cmds losetup dd parted mke2fs tune2fs grub || exit 1 while test $# != 0 do @@ -263,5 +220,4 @@ mk_ext3_fs "${IMG_NAME}.ext3.img" "$IMG_LABEL" "$ROOT_DIR" #mount ${IMG_NAME}.ext3 $MOUNT_POINT -o loop,offset=$OS_PART1_BEGIN -t ext3 #cp -r "$ROOT_DIR"/* $MOUNT_POINT -#create_jffs2_img $MOUNT_POINT #umount $MOUNT_POINT diff --git a/mkjffs2.sh b/mkjffs2.sh index 5793681..6cd7685 100755 --- a/mkjffs2.sh +++ b/mkjffs2.sh @@ -39,7 +39,7 @@ if [ ! -d "${ROOT_DIR}" ]; then usage fi -check_for_cmds mkfs.jffs2 sumtool +check_for_cmds mkfs.jffs2 sumtool || exit 1 create_fstab ${ROOT_DIR} jffs2 create_ofwboot ${ROOT_DIR} jffs2 -- 2.39.2