All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC] post-build scripts: limitations, and proposal
Date: Thu, 20 Jun 2013 23:36:28 +0200	[thread overview]
Message-ID: <20130620213628.GA3534@free.fr> (raw)

Hello All!

Currently, I'm using a set of post-build scripts, and it's becoming to
be slightly tedious.

For example, here are a few of them:

  - rpi-fixup-rootfs
    - adds /dev/mmcblk0p1 on /boot to fstab, don't mount _netdev filesystems
    - set root's PS1
    - store config's tree hash in /etc/rpi-config.version  [0]

  - rpi-fixup-rootfs-yem
    - stores my ssh pub key in root's ~/.ssh/authorized_keys

  - rpi-fixup-rootfs-tvheadend
    - add a script to wait for DVB devices
    - add a CIFS mount to fstab, to access my NAS

  - rpi-fixup-rootfs-wpa
    - add my wpa-supplicant conf file to connect to my LAN

So, when I build my tvheadend filesystem, I want to run scripts:
    rpi-fixup-rootfs  rpi-fixup-rootfs-yem  rpi-fixup-rootfs-tvheadend

But when I want to build my mpd filesystem, I want to run scripts:
    rpi-fixup-rootfs  rpi-fixup-rootfs-yem rpi-fixup-rootfs-wpa


Since the scripts lie out of the buildroot tree, I set (all on one line,
but broken-out for readability):

    BR2_ROOTFS_POST_BUILD_SCRIPT="
        $(CONFIG_DIR)/../scripts/rpi-fixup-rootfs
        $(CONFIG_DIR)/../scripts/rpi-fixup-rootfs-yem
        $(CONFIG_DIR)/../scripts/rpi-fixup-rootfs-tvheadend"

Now, I am adding a new script. This is starting to be ridiculous...

What I'd like is to be able to pass one or more options to each
post-build script, so I can have a wrapper and tell it what to run:

    BR2_ROOTFS_POST_BUILD_SCRIPT="
        $(CONFIG_DIR)/../scripts/fixup-rootfs rpi ssh-key rpi-tvheadend"

to call those scripts:
    fixup-rootfs-rpi
    fixup-rootfs-ssh-key
    fixup-rootfs-rpi-tvheadend

But it is not possible, as Buildroot interprets BR2_ROOTFS_POST_BUILD_SCRIPT
as a space-separated list, not a single command. So, it is not possible
to pass any option to the post-build scripts.

So, I was going to change it from space-separated to colon-separated. But
that would break existing configuration. Sigh... :-(

I can see only one way to solve this: rename the variable (and add to
legacy), and make it a colon-separated list.

Opinions?

[0] My config files (and scripts...) are stored in a git tree, so I want
    to know which to rebuild only by looking at a file on a running board.
    Having only the Buildroot tree hash is not enough.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

             reply	other threads:[~2013-06-20 21:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 21:36 Yann E. MORIN [this message]
2013-06-21  6:17 ` [Buildroot] [RFC] post-build scripts: limitations, and proposal Thomas De Schampheleire
2013-06-21  6:59   ` Thomas Petazzoni
2013-06-23 17:06   ` Arnout Vandecappelle
2013-06-23 17:45     ` Thomas De Schampheleire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130620213628.GA3534@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.