Booting from ext2/ext3

来源:互联网 发布:上日本女人的体验知乎 编辑:程序博客网 时间:2024/04/27 19:07

 http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/76583

http://u-boot.10912.n7.nabble.com/U-Boot-Booting-from-ext2-ext3-td80184.html

 

[U-Boot] Booting from ext2/ext3

Dunda, Matthias
10 posts
Hi all,

how does the implementation of the ext2 module work in u-boot?

As I see, u-boot can load the kernel from an ext2 file system using
ext2load.

Unfortunately, this command is not included in my build of u-boot. Did I
miss some compile-switch, or do I have to explicitly include ext2fs.h
somewhere? How can I enable the ext2/ext3 functionality?

Another related question is, if I can format an ext2/ext3 drive from u-boot
or how I can bring up a new image to my internal device, once u-boot is
running.

Cheers
Matthias Dunda

_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
.
Wolfgang Denk
Reply |Threaded

Re: [U-Boot] Booting from ext2/ext3

Wolfgang Denk
23324 posts
Dear "Dunda, Matthias",

In message <[hidden email]> you wrote:
>
> As I see, u-boot can load the kernel from an ext2 file system using
> ext2load.
>
> Unfortunately, this command is not included in my build of u-boot. Did I
> miss some compile-switch, or do I have to explicitly include ext2fs.h
> somewhere? How can I enable the ext2/ext3 functionality?

This depends on CONFIG_CMD_EXT2

> Another related question is, if I can format an ext2/ext3 drive from u-boot
> or how I can bring up a new image to my internal device, once u-boot is
> running.

You cannot. U-Boot supports only read-only accesses to the file
systems. You can load and write complete images to flash, but you
cannot use U-Boot to "mkfs" or to write individual files.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [hidden email]
No question is too silly to ask. Of course, some  questions  are  too
silly to to answer...  - L. Wall & R. L. Schwartz, _Programming Perl_
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
Dunda, Matthias
Reply |Threaded
Open this post in threaded view
| More
Report Content as Inappropriate
star

Re: [U-Boot] Booting from ext2/ext3

Dunda, Matthias
10 posts
In reply to this post by Dunda, Matthias
> > Unfortunately, this command is not included in my build of
> u-boot. Did
> > I miss some compile-switch, or do I have to explicitly include
> > ext2fs.h somewhere? How can I enable the ext2/ext3 functionality?
>
> This depends on CONFIG_CMD_EXT2
>

Thanks, I added this along with CONFIG_DOS_PARTITION to my board
configuration file - which so far is a copy of the MPC8568MDS.h

During the final linking I get the following errors:

common/libcommon.a(cmd_ext2.o): In function `do_ext2load':
u-boot-2009.11.1/common/cmd_ext2.c:193: undefined reference to
`get_partition_info'
fs/ext2/libext2fs.a(dev.o): In function `ext2fs_set_blk_dev':
u-boot-2009.11.1/fs/ext2/dev.c:45: undefined reference to
`get_partition_info'
make: *** [u-boot] Error 1

Full build output is attached.

What's the issue here?

Cheers
Matthias


_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot

uboot.log.gz (7K) Download Attachment
Wolfgang Denk
Reply |Threaded |More
Report Content as Inappropriate
star

Re: [U-Boot] Booting from ext2/ext3

Wolfgang Denk
23324 posts
Dear Matthias,

In message <[hidden email]> you wrote:

>
> > > I miss some compile-switch, or do I have to explicitly include
> > > ext2fs.h somewhere? How can I enable the ext2/ext3 functionality?
> >
> > This depends on CONFIG_CMD_EXT2
>
> Thanks, I added this along with CONFIG_DOS_PARTITION to my board
> configuration file - which so far is a copy of the MPC8568MDS.h
>
> During the final linking I get the following errors:
>
> common/libcommon.a(cmd_ext2.o): In function `do_ext2load':
> u-boot-2009.11.1/common/cmd_ext2.c:193: undefined reference to
> `get_partition_info'
« [hide part of quote]
...
> What's the issue here?

Hm... this is U-Boot release v2009.11.1, correct?


In your log you can see that the relevant source file, disk/part.c,
gets compiled:

...
219 make -C disk/
220 make[1]: Entering directory `u-boot-2009.11.1/disk'
221 ppc_85xx-gcc  -g  -Os   -mrelocatable -fPIC -ffixed-r14 -meabi -D__KERNEL__ -DTEXT_BASE=0xfff80000 -Iu-boot-2009.11.1/include -fno-builtin -ffreestanding -nostdinc -isystem /data/opt/eldk/usr/bin/../lib/gcc/powerpc-linux/4.2.2/include -pipe  -DCONFIG_PPC -D__powerpc__ -ffixed-r2 -Wa,-me500 -msoft-float -mno-string -mspe=yes -mno-spe -Wall -Wstrict-prototypes -fno-stack-protector   -o part.o part.c -c
...

Try running "nm" on the object file; you should see something like this:

        -> ppc_85xx-nm disk/part.o
        00000000 d block_drvr
        000000dc T dev_print
        0000031c T get_dev
        000002a0 T get_partition_info
                 U get_partition_info_dos
        000002dc T init_part
        00000004 T print_part
                 U print_part_dos
                 U printf
                 U puts
                 U scsi_get_dev
                 U strlen
                 U strncmp
                 U test_part_dos

In my test "get_partition_info" gets defined as "T"ext symbol as
needed. What do you get?

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [hidden email]
It all seemed, he thought, to be rather a lot of  trouble  to  go  to
just sharpen a razor blade.  - Terry Pratchett, _The Light Fantastic_
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
Dunda, Matthias
Reply |Threaded
Open this post in threaded view
| More
Report Content as Inappropriate
star

Re: [U-Boot] Booting from ext2/ext3

Dunda, Matthias
10 posts
In reply to this post by Dunda, Matthias
Good Morning Wolfgang,

>
>
> Dear Matthias,
>
> In message
> <[hidden email]-na
> val.de> you wrote:
> >
> > `get_partition_info'
> ...
> > What's the issue here?
>
> Hm... this is U-Boot release v2009.11.1, correct?
>
... [show rest of quote]
... [show rest of quote]
Yes correct, but it happens in 2009.08, too.



>
> In your log you can see that the relevant source file,
> disk/part.c, gets compiled:
>
> Try running "nm" on the object file; you should see something
> like this:
>
The output of ppc_85xx-nm *.o in disk/ looks a little "weak":


part_dos.o:

part.o:
00000000 T get_dev

These are the sizes:

total 108
-rw-r--r-- 1 dunda users  5428 2010-03-31 15:56 libdisk.a
-rw-r--r-- 1 dunda users  1585 2010-02-02 15:59 Makefile
-rw-r--r-- 1 dunda users  9756 2010-02-02 15:59 part_amiga.c
-rw-r--r-- 1 dunda users  3524 2010-02-02 15:59 part_amiga.h
-rw-r--r-- 1 dunda users  9470 2010-02-02 15:59 part.c
-rw-r--r-- 1 dunda users  7369 2010-02-02 15:59 part_dos.c
-rw-r--r-- 1 dunda users  1908 2010-02-02 15:59 part_dos.h
-rw-r--r-- 1 dunda users  1632 2010-03-31 15:56 part_dos.o
-rw-r--r-- 1 dunda users 11910 2010-02-02 15:59 part_efi.c
-rw-r--r-- 1 dunda users  4650 2010-02-02 15:59 part_efi.h
-rw-r--r-- 1 dunda users  8056 2010-02-02 15:59 part_iso.c
-rw-r--r-- 1 dunda users  7771 2010-02-02 15:59 part_iso.h
-rw-r--r-- 1 dunda users  6278 2010-02-02 15:59 part_mac.c
-rw-r--r-- 1 dunda users  3517 2010-02-02 15:59 part_mac.h
-rw-r--r-- 1 dunda users  3592 2010-03-31 15:56 part.o

I did a fresh build after extracting the 2009.08 archive with

make CROSS_COMPILE=ppc_85xx- MPC8568MDS_config
make CROSS_COMPILE=ppc_85xx- all

The only change I applied before is

419a420
> #define CONFIG_DOS_PARTITION
430a432,433
> #define CONFIG_CMD_EXT2
> #define CONFIG_CMD_FAT

to include/configs/MPC8568MDS.h

Cheers
Matthias Dunda


_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot

build-output.txt.gz (7K) Download Attachment
Wolfgang Denk
Reply |Threaded
Open this post in threaded view
| More
Report Content as Inappropriate
star

Re: [U-Boot] Booting from ext2/ext3

Wolfgang Denk
23324 posts
Dear Matthias,

In message <[hidden email]> you wrote:
>
> > Hm... this is U-Boot release v2009.11.1, correct?
>
> Yes correct, but it happens in 2009.08, too.

Strange...

> The output of ppc_85xx-nm *.o in disk/ looks a little "weak":
>
> part_dos.o:
>
> part.o:
> 00000000 T get_dev
>

Indeed. That's nothing.

> The only change I applied before is
>
> 419a420
> > #define CONFIG_DOS_PARTITION
> 430a432,433
> > #define CONFIG_CMD_EXT2
> > #define CONFIG_CMD_FAT
>
> to include/configs/MPC8568MDS.h

It seems you are missing the device driver support. If you check the
code in "disk/part.c" you will see this:

...
218 #if (defined(CONFIG_CMD_IDE) || \
219      defined(CONFIG_CMD_MG_DISK) || \
220      defined(CONFIG_CMD_SATA) || \
221      defined(CONFIG_CMD_SCSI) || \
222      defined(CONFIG_CMD_USB) || \
223      defined(CONFIG_MMC)                || \
224      defined(CONFIG_SYSTEMACE) )
225
226 #if defined(CONFIG_MAC_PARTITION) || \
227     defined(CONFIG_DOS_PARTITION) || \
228     defined(CONFIG_ISO_PARTITION) || \
229     defined(CONFIG_AMIGA_PARTITION) || \
230     defined(CONFIG_EFI_PARTITION)
...

You have CONFIG_DOS_PARTITION defined, which satisfies the second
block conditions; please check if you also have IDE, MG_DISK, SATA,
SCSI, USB, MMC or SYSTEMACE enabled in your configuration - and if
not, then please explain which device you actually intend to use?

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [hidden email]
It is clear that the individual who persecutes a  man,  his  brother,
because he is not of the same opinion, is a monster.       - Voltaire
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot
Dunda, Matthias
Reply |Threaded
Open this post in threaded view
| More
Report Content as Inappropriate
star

Re: [U-Boot] Booting from ext2/ext3

Dunda, Matthias
10 posts
In reply to this post by Dunda, Matthias
Dear Wolfgang,

> >
> > to include/configs/MPC8568MDS.h
>
> It seems you are missing the device driver support. If you
> check the code in "disk/part.c" you will see this:
>
> ...
> 218 #if (defined(CONFIG_CMD_IDE) || \
> 219      defined(CONFIG_CMD_MG_DISK) || \
> 220      defined(CONFIG_CMD_SATA) || \
> 221      defined(CONFIG_CMD_SCSI) || \
> 222      defined(CONFIG_CMD_USB) || \
> 223      defined(CONFIG_MMC)                || \
> 224      defined(CONFIG_SYSTEMACE) )
... [show rest of quote]
... [show rest of quote]
Indeed, there was something missing! I added the configurations like
described in doc/README.usb:

CONFIG_CMD_USB
CONFIG_USB_UHCI
CONFIG_USB_STORAGE

It seems, like these aren't sufficient - again at final linking stage I get
missing references (see attachment).

At least disk/part.o has some symbols now:

00000000 d block_drvr
000000dc T dev_print
0000031c T get_dev
000002a0 T get_partition_info
         U get_partition_info_dos
000002dc T init_part
00000004 T print_part
         U print_part_dos
         U printf
         U puts
         U strlen
         U strncmp
         U test_part_dos
         U usb_stor_get_dev

Anyhow, get_partition_info_dos and others are undefined :-(

The goal is to boot from an USB Disk-on-Module, formatted either ext2/3 or
maybe FAT.

Happy Easter - all!
Matthias



_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot

usb-link-errors.txt (1K) Download Attachment
Wolfgang Denk
Reply |Threaded
Open this post in threaded view
| More
Report Content as Inappropriate
star

Re: [U-Boot] Booting from ext2/ext3

Wolfgang Denk
23324 posts
Dear Matthias,

In message <[hidden email]> you wrote:

>
> Indeed, there was something missing! I added the configurations like
> described in doc/README.usb:
>
> CONFIG_CMD_USB
> CONFIG_USB_UHCI
> CONFIG_USB_STORAGE
>
> It seems, like these aren't sufficient - again at final linking stage I get
> missing references (see attachment).
... [show rest of quote]
...
> Anyhow, get_partition_info_dos and others are undefined :-(

This one depends on CONFIG_DOS_PARTITION and the same set we had
before, so if you have CONFIG_CMD_USB and CONFIG_DOS_PARTITION it
_should_ be there.

Did you try a "make mrproper" to force a full rebuild?

> The goal is to boot from an USB Disk-on-Module, formatted either ext2/3 or
> maybe FAT.
>
> Happy Easter - all!

I'm sure you will find some eggs in U-Boot :-)

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [hidden email]
The human race is faced with a cruel choice: work  or  daytime  tele-
vision.
_______________________________________________
U-Boot mailing list
[hidden email]
http://lists.denx.de/mailman/listinfo/u-boot