[PATCH v2] RTEMS Boot Image, tool to create SD card images

Chris Johns chrisj at rtems.org
Mon Jun 10 22:26:39 UTC 2019


On 10/6/19 8:17 pm, Vijay Kumar Banerjee wrote:
> Hello Chris,
> I'm getting the following error in python3.7:

Thank you for checking this. I will fixes these issues.

> 
> ===
> rtems-tools $>./misc/rtems-boot-image -b u-boot-beaglebone -o . $HOME/myimage
> RTEMS Tools - Boot Image, 5 (881f7419784e modified)
> Traceback (most recent call last):
>   File "./misc/tools/cmd-boot-image.py", line 41, in <module>
>     boot.run(sys.argv[1:], command_path = base)
>   File "/home/lunatic/development/rtems/rtems-tools/misc/tools/boot.py", line
> 1020, in run
>     argopts.board)
>   File "/home/lunatic/development/rtems/rtems-tools/misc/tools/boot.py", line
> 282, in __init__
>     super(uboot_config, self).__init__(command_path, 'u-boot')
>   File "/home/lunatic/development/rtems/rtems-tools/misc/tools/boot.py", line
> 133, in __init__
>     self.load_config(bootloader, boot_ini)
>   File "/home/lunatic/development/rtems/rtems-tools/misc/tools/boot.py", line
> 292, in load_config
>     super(uboot_config, self).load_config(bootloader, config)
>   File "/home/lunatic/development/rtems/rtems-tools/misc/tools/boot.py", line
> 192, in load_config
>     for i in self.config.get_items(s):
>   File
> "/home/lunatic/development/rtems/rtems-tools/rtemstoolkit/configuration.py",
> line 131, in get_items
>     for name, value in self.config.items(section, raw = self.raw):
>   File "/usr/lib64/python3.7/configparser.py", line 857, in items
>     return [(option, value_getter(option)) for option in d.keys()]
>   File "/usr/lib64/python3.7/configparser.py", line 857, in <listcomp>
>     return [(option, value_getter(option)) for option in d.keys()]
>   File "/usr/lib64/python3.7/configparser.py", line 854, in <lambda>
>     section, option, d[option], d)
>   File "/usr/lib64/python3.7/configparser.py", line 394, in before_get
>     self._interpolate_some(parser, option, L, value, section, defaults, 1)
>   File "/usr/lib64/python3.7/configparser.py", line 444, in _interpolate_some
>     "found: %r" % (rest,))
> configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(',
> found: '%{arch}-rtems%{version}-'
> ===

Ah OK. I should have used ExtendedInterpolation class on Python3 as the standard
interpolation clashes with the config file syntax used in the RSB and other
tools. I think I will use `raw` mode and handle the interpolation in code we have.

> I tried replacing all the %{value} to %%{value} in the ini file and that got
> past the error, this however doesn't show up in python2.

I implemented the functionality for Python2.

> 
> after getting past this one, I'm getting another error:
> 
> ===
> rtems-tools $>./misc/rtems-boot-image -b u-boot-beaglebone -o . $HOME/myimage

An output file of `.` is not valid. I will improve the arg checking to catch this.

> RTEMS Tools - Boot Image, 5 (881f7419784e modified)
> Traceback (most recent call last):
>   File "./misc/tools/cmd-boot-image.py", line 41, in <module>
>     boot.run(sys.argv[1:], command_path = base)
>   File "/home/lunatic/development/rtems/rtems-tools/misc/tools/boot.py", line
> 1020, in run
>     argopts.board)
>   File "/home/lunatic/development/rtems/rtems-tools/misc/tools/boot.py", line
> 282, in __init__
>     super(uboot_config, self).__init__(command_path, 'u-boot')
>   File "/home/lunatic/development/rtems/rtems-tools/misc/tools/boot.py", line
> 133, in __init__
>     self.load_config(bootloader, boot_ini)
>   File "/home/lunatic/development/rtems/rtems-tools/misc/tools/boot.py", line
> 297, in load_config
>     if not path.exists(self['first_stage']):

Ah OK. There is no first stage boot loader. You need to provide the first and
second stage loaders.

>   File "/home/lunatic/development/rtems/rtems-tools/rtemstoolkit/path.py", line
> 162, in exists
>     return _exists(shell(paths))
>   File "/home/lunatic/development/rtems/rtems-tools/rtemstoolkit/path.py", line
> 154, in _exists
>     p = shell(join(os.getcwd(), host(p)))
>   File "/home/lunatic/development/rtems/rtems-tools/rtemstoolkit/path.py", line
> 101, in join
>     path += '/' + shell(arg)
> TypeError: cannot concatenate 'str' and 'NoneType' objects
> ===
> I didn't have a look at this one, maybe I'm missing some options in the command
> line?

Yes but the tool should provide a suitable error to indicate the issue.

Again thanks.

Chris

> 
> 
> On Mon, Jun 10, 2019 at 12:55 PM <chrisj at rtems.org <mailto:chrisj at rtems.org>> wrote:
> 
>     Hi,
> 
>     These patches add a new command to the rtems-tools called rtems-boot-image.
>     This tool creates boot images for SD cards on FreeBSD, MacOS and Linux. The
>     tool lets you boot an RTEMS executable from u-boot from an SD card, or
>     you can support networking options and have u-boot perform a net boot.
> 
>     The tool uses a configuration file `rtems-boot.ini` that defines the
>     boards, commands and formats a board needs. Please update for your
>     board and send in patches.
> 
>     V2 patches add more network support with network booting and network loading
>     of a single FDT. I plan to add overlays once I push these patches to
>     master.
> 
>     Please test and report.
> 
>     Finally,the beaglebone black running libbsd is really neat so a big thanks to
>     everyone who has been working on this BSP and making it happen.
> 
>     Thanks
>     Chris
> 
> 
>     _______________________________________________
>     devel mailing list
>     devel at rtems.org <mailto:devel at rtems.org>
>     http://lists.rtems.org/mailman/listinfo/devel
> 



More information about the devel mailing list