Least number of commands to deploy RTEMS 6.1 for the Microblaze

Rules

The rules are:

  1. Shell commands, no scripts
  2. Not && to join sequences of commands
  3. Includes downloading
  4. Does not include set up for python3

My Attempt

This is my first attempt on FreeBSD 14.1:

wget https://ftp.rtems.org/pub/rtems/releases/6/6.1/sources/rtems-deployment-6.1.tar.xz
wget https://ftp.rtems.org/pub/rtems/releases/6/6.1/sources/rtems-source-builder-6.1.tar.xz
tar jxf rtems-deployment-6.1.tar.xz
tar zxf rtems-source-builder-6.1.tar.xz
cd rtems-deployment-6.1
./waf configure --rsb=../rtems-source-builder-6.1 --prefix=/opt/rtems/6.1
./waf --targets=amd/avnet-microzed

To install:

TAR=`realpath tar/avnet-microzed.tar.xz`
cd /
tar zxf $TAR

You could always do:

tar -C / -zxf $TAR

Instead of changing the directory.

Note the requirement of the hyphen on the 2nd set of flags, also the -C should go first because traditionally tar went via order of flags it doesn’t matter as much anymore but it’s better to add it first.

1 Like

With a single line tar command that makes it 8 commands to build a full software stack for the Microblaze.

Technically not! Because you can do

tar -C / -zxf tar/avnet-microzed.tar.xz

The realpath command isn’t necessary if you’re not changing directories.

Yes that is what I was thinking of. I wonder if a single wget command could be used?

Maybe add a waf extract command to do the extraction for the user if the prefix is already set then you can throw a makedirs in there to create the path as well.

1 Like

What about install as that is already a standard waf target?

This idea is nice because the waf command could have both build and install on the same command line and still be within within the rules.

I was going to mention install but is it really installing? Kind of feels like that it’s just doing an extra step for you. If you think officially supporting it as a way to install the results then yes I’d use that command.

I think it is suitable if tar files are built. The catch is knowing the tar file is OK or not? A distclean cleans the tar directory so I suppose we can assume any tar file in the --targets= list is OK to install. Package builds like RPM are outside this process.

That’s even more reason to call it ‘extract’ instead of install. I would argue that it’s not really installing anything but doing the extraction step for you.

Yes that is a good point. Should the name be explicit and so be called tar-extract?

I would call it extract-tar in case we have other formats in the future we’d want to extract. I think it’s more likely to have more extract-* commands than tar-* commands unless you think the reverse then tar-* sounds good.

Good idea. I will look into this when I get time to work on these things again. Thanks for the great ideas and input