Enable rootfs modification through lmc + live-build

Registered by Tom Gall

Problem: You've have a rootfs already installed on media or a newly created one from snapshots and before you do anything, you've got your own customizations in mind you'd like to have performed.

You could:
1) do it manually
2) write a script that grows more hairy in time
3) use this tool / extension to linaro-media-create and live-build

lmc will add 2 new command line parameters:
1) --modify-rootfs <modification script>
2) --slim

live-build will add a new stage called modify:
lb modify will be able to be run from the command line with the form: lb modify [--dir <expanded-rootfs-dir>|--script <modification-script>]

Modification Script syntax:

add-pkgs: <list of packages>
rm-pkgs: <list of packages>
includes: <directory with files to be included>
hooks: <list of hook scripts>
archive: <archive dir>

Modification script will be executed in line order, top to bottom. If you want hooks executed first, put it first in the file.
Lines might be repeated. IE you could have more than one hooks line.

<list of packages> : package list with spaces between each. Ends at newline.
<directory with files to be included: contents of the directory will be directly copied into the the root fs. If you have a file you want to go into etc, then it needs to be located in something like my-includes/etc/filetobecopied. Ergo it is the contents of the named directory that are copied.
<list of hook scripts> : list of bash scripts which will be run as chroot in the rootfs. They will run as root. They will only have access to what is already installed inside of the rootfs.
<archive dir> : a directory containing both archive name and GPG key which should be added to apt sources.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
Proposed for trunk
Implementation:
Unknown
Milestone target:
milestone icon backlog

Related branches

Sprints

Whiteboard

[dzin, apr 10, 2012] Moved to wishlist

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.