• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/board/cubietech/cubieboard/mkcubiecard.sh
Andi ShytiAndi Shyti committed 2257e36a57c02 Dec 2013
Raw file
Source viewDiff to previous
 
1
#! /bin/sh
2
# mkCubieCard.sh v0.1:
3
# 2013, Carlo Caione <carlo.caione@gmail.com>
4
# heavely based on :
5
# mkA10card.sh v0.1
6
# 2012, Jason Plum <jplum@archlinuxarm.org>
7
# loosely based on :
8
# mkcard.sh v0.5
9
# (c) Copyright 2009 Graeme Gregory <dp@xora.org.uk>
10
# Licensed under terms of GPLv2
11
#
12
# Parts of the procudure base on the work of Denys Dmytriyenko
13
# http://wiki.omap.com/index.php/MMC_Boot_Format
14
​
15
IMAGES_DIR=$1
16
SPL_IMG=$IMAGES_DIR/sunxi-spl.bin
17
SPL_UBOOT=$IMAGES_DIR/u-boot-sunxi-with-spl.bin
18
UBOOT_IMG=$IMAGES_DIR/u-boot.bin
19
UIMAGE=$IMAGES_DIR/uImage
20
BIN_BOARD_FILE=$IMAGES_DIR/script.bin
21
ROOTFS=$IMAGES_DIR/rootfs.tar
22
BOOT_CMD_H=$IMAGES_DIR/boot.scr
23
​
24
export LC_ALL=C
25
​
26
if [ $# -ne 2 ]; then
27
    echo "Usage: $0 <images_dir> <drive>"
28
    exit 1;
29
fi
30
​
31
if [ `id -u` -ne 0 ]; then
32
    echo "This script must be run as root" 1>&2
33
    exit 1
34
fi
35
​
36
if [ ! -f $SPL_IMG  -a ! -f $SPL_UBOOT ] ||
37
   [ ! -f $UBOOT_IMG ] ||
38
   [ ! -f $UIMAGE ] ||
39
   [ ! -f $BIN_BOARD_FILE ] ||
40
   [ ! -f $ROOTFS ] ||
41
   [ ! -f $BOOT_CMD_H ]; then
42
    echo "File(s) missing."
43
    exit 1
44
fi
45
​
46
DRIVE=$2
47
P1=`mktemp -d`
48
P2=`mktemp -d`
49
​
50
dd if=/dev/zero of=$DRIVE bs=1M count=3
51
​
52
SIZE=`fdisk -l $DRIVE | grep Disk | grep bytes | awk '{print $5}'`
53
​
54
echo DISK SIZE - $SIZE bytes
55
​
56
​
57
# ~2048, 16MB, FAT, bootable
58
# ~rest of drive, Ext4
59
{
60
echo 32,512,0x0C,*
61
echo 544,,,-
62
} | sfdisk -D $DRIVE
63
​
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.