Merge lp:~vorlon/linaro-image-tools/uboot-refactoring into lp:linaro-image-tools/11.11

Proposed by Steve Langasek
Status: Merged
Merged at revision: 100
Proposed branch: lp:~vorlon/linaro-image-tools/uboot-refactoring
Merge into: lp:linaro-image-tools/11.11
Diff against target: 87 lines (+26/-7)
1 file modified
linaro-media-create (+26/-7)
To merge this branch: bzr merge lp:~vorlon/linaro-image-tools/uboot-refactoring
Reviewer Review Type Date Requested Status
Linaro Maintainers Pending
Review via email: mp+35611@code.launchpad.net

Description of the change

refactor of u-boot handling in linaro-media-create so that we're sharing code across boards instead of reinventing the wheel for each one. Tested on beagle, but this also affects VE which I can't entirely test, so looking for some more eyeballs on this before pushing.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote :

On Thu, 16 Sep 2010 00:19:50 -0000, Steve Langasek <email address hidden> wrote:
> +
> + if [ -n "$UBOOT_FILE" ] && [ -e "binary/$UBOOT_FILE" ]; then
> + sudo cp -v binary/${UBOOT_FILE} ${DIR}/disk/u-boot.bin
> + fi
> +

Is there a use case for $UBOOT_FILE existing, but not wanted to be copied?

Otherwise this looks ok to me.

Thanks,

James

Revision history for this message
Steve Langasek (vorlon) wrote :

On Thu, Sep 16, 2010 at 12:49:08AM -0000, James Westby wrote:
> On Thu, 16 Sep 2010 00:19:50 -0000, Steve Langasek <email address hidden> wrote:
> > +
> > + if [ -n "$UBOOT_FILE" ] && [ -e "binary/$UBOOT_FILE" ]; then
> > + sudo cp -v binary/${UBOOT_FILE} ${DIR}/disk/u-boot.bin
> > + fi
> > +

> Is there a use case for $UBOOT_FILE existing, but not wanted to be copied?

I don't think so; if you don't want u-boot.bin copied in on that subarch,
don't define it for that subarch?

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Revision history for this message
James Westby (james-w) wrote :

On Thu, 16 Sep 2010 04:58:43 -0000, Steve Langasek <email address hidden> wrote:
> On Thu, Sep 16, 2010 at 12:49:08AM -0000, James Westby wrote:
> > On Thu, 16 Sep 2010 00:19:50 -0000, Steve Langasek <email address hidden> wrote:
> > > +
> > > + if [ -n "$UBOOT_FILE" ] && [ -e "binary/$UBOOT_FILE" ]; then
> > > + sudo cp -v binary/${UBOOT_FILE} ${DIR}/disk/u-boot.bin
> > > + fi
> > > +
>
> > Is there a use case for $UBOOT_FILE existing, but not wanted to be copied?
>
> I don't think so; if you don't want u-boot.bin copied in on that subarch,
> don't define it for that subarch?

Sounds sensible to me.

The current way just means that we may create images without u-boot if
the file isn't found for some reason. I would expect it to fail instead.

Thanks,

James

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'linaro-media-create'
2--- linaro-media-create 2010-09-15 23:44:53 +0000
3+++ linaro-media-create 2010-09-16 00:19:49 +0000
4@@ -20,7 +20,6 @@
5 set -e
6
7 MLO_FILE=usr/lib/x-loader-omap/MLO
8-UBOOT_FILE=usr/lib/u-boot/omap3_beagle/u-boot.bin
9
10 unset MMC MMC1 MMC2 MMC3 IMAGE_FILE
11
12@@ -242,6 +241,7 @@
13 ensure_command wget wget
14 ensure_command md5sum coreutils
15 ensure_command realpath realpath
16+
17 case $RFS in
18 ext3)
19 ensure_command mkfs.ext3 e2fsprogs
20@@ -253,12 +253,25 @@
21 ensure_command mkfs.btrfs btrfs-tools
22 ;;
23 esac
24-case $DEVNAME in
25- beagle|igep|vexpress)
26+
27+case $DEVIMAGE in
28+ beagle)
29+ UBOOT_FLAVOR=omap3_beagle
30+ ensure_command mkimage uboot-mkimage
31+ ;;
32+ igep)
33+ ensure_command mkimage uboot-mkimage
34+ ;;
35+ vexpress)
36+ UBOOT_FLAVOR=ca9x4_ct_vxp
37 ensure_command mkimage uboot-mkimage
38 ;;
39 esac
40
41+if [ -n "$UBOOT_FLAVOR" ]; then
42+ UBOOT_FILE="usr/lib/u-boot/$UBOOT_FLAVOR/u-boot.bin"
43+fi
44+
45 RFS_UUID=`uuidgen -r`
46
47 get_mmcs_by_id() {
48@@ -302,8 +315,11 @@
49 rm -rf binary/vmlinuz-* || true
50
51 extras=
52+ if [ -n "$UBOOT_FILE" ]; then
53+ extras="binary/$UBOOT_FILE"
54+ fi
55 if [ "$DEVIMAGE" = beagle ]; then
56- extras="binary/${MLO_FILE} binary/${UBOOT_FILE}"
57+ extras="$extras binary/${MLO_FILE}"
58 fi
59 tar -xf $BINARY_TARBALL binary/${parts_dir} $extras
60
61@@ -405,12 +421,16 @@
62
63 mkdir -p ${DIR}/disk || true
64 sudo mount ${MMC1} ${DIR}/disk
65+
66+ if [ -n "$UBOOT_FILE" ] && [ -e "binary/$UBOOT_FILE" ]; then
67+ sudo cp -v binary/${UBOOT_FILE} ${DIR}/disk/u-boot.bin
68+ fi
69+
70 case "$DEVIMAGE" in
71 beagle|igep)
72 if [ "$DEVIMAGE" = "beagle" ]; then
73- if [ -e binary/${MLO_FILE} ] && [ -e binary/${UBOOT_FILE} ]; then
74+ if [ -e binary/${MLO_FILE} ]; then
75 sudo cp -v binary/${MLO_FILE} ${DIR}/disk/MLO
76- sudo cp -v binary/${UBOOT_FILE} ${DIR}/disk/u-boot.bin
77 fi
78 fi
79 sync
80@@ -431,7 +451,6 @@
81 sudo cp -v ${DIR}/disk/boot.scr ${DIR}/disk/boot.ini
82 ;;
83 vexpress)
84- sudo tar --strip-components=5 -C ${DIR}/disk/ -xf $BINARY_TARBALL binary/usr/lib/u-boot/ca9x4_ct_vxp/u-boot.bin
85 sudo mkimage -A arm -O linux -T kernel -C none -a 0x60008000 -e 0x60008000 \
86 -n "Linux" -d ${DIR}/binary/${parts_dir}/vmlinuz*-vexpress ${DIR}/disk/uImage
87 sudo mkimage -A arm -O linux -T ramdisk -C none -a 0x81000000 \

Subscribers

People subscribed via source and target branches