You are not logged in.

#1 2012-10-25 00:48:18

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

Need some help with script error please

I'm running a script from here: http://archlinuxarm.org/platforms/armv7/pandaboard thats not working for me.

It's supposed to partition and format the SD card I'm using for my Arch ARM install.

I get the following output:

    # ./xmkcard.sh /dev/sdb
    1024+0 records in
    1024+0 records out
    1048576 bytes (1.0 MB) copied, 0.222972 s, 4.7 MB/s
    DISK SIZE - 15931539456 bytes
    ./xmkcard.sh: line 24: bc: command not found
    CYLINDERS -

    Usage:
     sfdisk [options] <device> [...]

    Options:
     -s, --show-size           list size of a partition
     -c, --id                  change or print partition Id
         --change-id           change Id
         --print-id            print Id
     -l, --list                list partitions of each device
     -d, --dump                idem, but in a format suitable for later input
     -i, --increment           number cylinders etc. from 1 instead of from 0
     -u, --unit <letter>       units to be used; <letter> can be one of
                                 S (sectors), C (cylinders), B (blocks), or M (MB)
     -1, --one-only            reserved option that does nothing currently
     -T, --list-types          list the known partition types
     -D, --DOS                 for DOS-compatibility: waste a little space
     -E, --DOS-extended        DOS extended partition compatibility
     -R, --re-read             make the kernel reread the partition table
     -N <number>               change only the partition with this <number>
     -n                        do not actually write to disk
     -O <file>                 save the sectors that will be overwritten to <file>
     -I <file>                 restore sectors from <file>
     -V, --verify              check that the listed partitions are reasonable
     -v, --version             display version information and exit
     -h, --help                display this help text and exit

    Dangerous options:
     -f, --force               disable all consistency checking
         --no-reread           do not check whether the partition is in use
     -q, --quiet               suppress warning messages
     -L, --Linux               do not complain about things irrelevant for Linux
     -g, --show-geometry       print the kernel's idea of the geometry
     -G, --show-pt-geometry    print geometry guessed from the partition table
     -A, --activate[=<device>] activate bootable flag
     -U, --unhide[=<dev>]      set partition unhidden
     -x, --show-extended       also list extended partitions in the output,
                                 or expect descriptors for them in the input
         --leave-last          do not allocate the last cylinder
         --IBM                 same as --leave-last
         --in-order            partitions are in order
         --not-in-order        partitions are not in order
         --inside-outer        all logicals inside outermost extended
         --not-inside-outer    not all logicals inside outermost extended
         --nested              every partition is disjoint from all others
         --chained             like nested, but extended partitions may lie outside
         --onesector           partitions are mutually disjoint

    Override the detected geometry using:
     -C, --cylinders <number>  set the number of cylinders to use
     -H, --heads <number>      set the number of heads to use
     -S, --sectors <number>    set the number of sectors to use

    umount: /dev/sdb1: not mounted
    mkfs.vfat 3.0.12 (29 Oct 2011)
    umount: /dev/sdb2: not mounted
    mke2fs 1.42.4 (12-June-2012)
    Filesystem label=ALARM
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Stride=0 blocks, Stripe width=0 blocks
    336672 inodes, 1345536 blocks
    67276 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=1379926016
    42 block groups
    32768 blocks per group, 32768 fragments per group
    8016 inodes per group
    Superblock backups stored on blocks:
       32768, 98304, 163840, 229376, 294912, 819200, 884736

    Allocating group tables: done                           
    Writing inode tables: done                           
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done 

The script:

#! /bin/sh
# mkcard.sh v0.5
# (c) Copyright 2009 Graeme Gregory <dp@xora.org.uk>
# Licensed under terms of GPLv2
#
# Parts of the procudure base on the work of Denys Dmytriyenko
# http://wiki.omap.com/index.php/MMC_Boot_Format

export LC_ALL=C

if [ $# -ne 1 ]; then
	echo "Usage: $0 <drive>"
	exit 1;
fi

DRIVE=$1

dd if=/dev/zero of=$DRIVE bs=1024 count=1024

SIZE=`fdisk -l $DRIVE | grep Disk | grep bytes | awk '{print $5}'`

echo DISK SIZE - $SIZE bytes

CYLINDERS=`echo $SIZE/255/63/512 | bc`

echo CYLINDERS - $CYLINDERS

{
echo ,9,0x0C,*
echo ,,,-
} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE

sleep 1

if [ -b ${DRIVE}1 ]; then
	umount ${DRIVE}1
	mkfs.vfat -F 32 -n "boot" ${DRIVE}1
else
	if [ -b ${DRIVE}p1 ]; then
		umount ${DRIVE}p1
		mkfs.vfat -F 32 -n "boot" ${DRIVE}p1
	else
		echo "Cant find boot partition in /dev"
	fi
fi

if [ -b ${DRIVE}2 ]; then
	umount ${DRIVE}2
	mke2fs -j -L "ALARM" ${DRIVE}2
else
	if [ -b ${DRIVE}p2 ]; then
		umount ${DRIVE}p2
		mke2fs -j -L "ALARM" ${DRIVE}p2
	else
		echo "Cant find rootfs partition in /dev"
	fi
fi

I posted this on their forums, but I don't think theres a whole lot going on there based on the amount of unanswered questions in my Pandaboard subforum. I hoping to be able to tap into the knowledge here to get some help.

Thanks in advance ......


Check out my website for info on the Arch Linux Installer

Offline

#2 2012-10-25 01:04:57

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,319

Re: Need some help with script error please

The error message says you don't have bc installed

Offline

#3 2012-10-25 03:06:45

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

Re: Need some help with script error please

Thanks skunktrader,

Feeling kinda silly now looking at this. Would have known without thinking, this error was from a missing package using the terminal for most things.

Somehow, likely the excitement of my first Arch install on ARM based hardware, made me completely forget nearly everything I have learned as a Linux user to date.

Also, the  ./xmkcard.sh: line 24: bit may have distracted me from seeing the obvious.


Check out my website for info on the Arch Linux Installer

Offline

Board footer

Powered by FluxBB