Merge lp:~mabac/linaro-image-tools/live-build-modify into lp:linaro-image-tools/11.11

Proposed by Mattias Backman
Status: Rejected
Rejected by: Loïc Minier
Proposed branch: lp:~mabac/linaro-image-tools/live-build-modify
Merge into: lp:linaro-image-tools/11.11
Diff against target: 63 lines (+16/-1)
3 files modified
linaro-media-create (+9/-1)
linaro_image_tools/media_create/__init__.py (+3/-0)
linaro_image_tools/media_create/rootfs.py (+4/-0)
To merge this branch: bzr merge lp:~mabac/linaro-image-tools/live-build-modify
Reviewer Review Type Date Requested Status
Loïc Minier (community) Approve
Alexander Sack Pending
Alexandros Frantzis Pending
Tom Gall Pending
Review via email: mp+81287@code.launchpad.net

Description of the change

Hi,

This branch adds a --modify-rootfs option to linaro-media-create which takes the path to a live-build script. If passed the script will be run after installing hwpacks to the rootfs but before populating the target partitions.

Thanks,

Mattias

To post a comment you must log in.
Revision history for this message
Loïc Minier (lool) wrote :

Looks ok; is this still pending a merge?

review: Approve
Revision history for this message
Mattias Backman (mabac) wrote :

On Mon, Mar 5, 2012 at 3:17 PM, Loïc Minier <email address hidden> wrote:
> Review: Approve
>
> Looks ok; is this still pending a merge?

It depends on getting 'lb modify' implemented and I guess that won't
happen (soon). So we generalized this to having the pre/post install
hooks.

I suppose we can abandon this branch since using lb from the hooks
will be possible.

> --
> https://code.launchpad.net/~mabac/linaro-image-tools/live-build-modify/+merge/81287
> You are the owner of lp:~mabac/linaro-image-tools/live-build-modify.

Revision history for this message
Loïc Minier (lool) wrote :

ok

Unmerged revisions

457. By Mattias Backman

Add modify-rootfs option to l-m-c for running a live build modify script after installing hwpacks.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'linaro-media-create'
2--- linaro-media-create 2011-10-19 12:19:33 +0000
3+++ linaro-media-create 2011-11-04 15:07:41 +0000
4@@ -38,7 +38,10 @@
5 setup_partitions,
6 get_uuid,
7 )
8-from linaro_image_tools.media_create.rootfs import populate_rootfs
9+from linaro_image_tools.media_create.rootfs import (
10+ populate_rootfs,
11+ live_build_modify,
12+)
13 from linaro_image_tools.media_create.unpack_binary_tarball import (
14 unpack_binary_tarball,
15 )
16@@ -89,6 +92,8 @@
17 required_commands.append('mkfs.%s' % args.rootfs)
18 else:
19 raise AssertionError('Unsupported rootfs type %s' % args.rootfs)
20+ if args.modify_rootfs is not None:
21+ required_commands.append('lb')
22 for command in required_commands:
23 ensure_command(command)
24
25@@ -160,6 +165,9 @@
26 install_hwpacks(ROOTFS_DIR, TMP_DIR, lmc_dir, args.hwpack_force_yes,
27 verified_files, *hwpacks)
28
29+ if args.modify_rootfs:
30+ live_build_modify(ROOTFS_DIR, args.modify_rootfs)
31+
32 if args.rootfs == 'btrfs':
33 install_packages(ROOTFS_DIR, TMP_DIR, "btrfs-tools")
34
35
36=== modified file 'linaro_image_tools/media_create/__init__.py'
37--- linaro_image_tools/media_create/__init__.py 2011-10-19 14:18:52 +0000
38+++ linaro_image_tools/media_create/__init__.py 2011-11-04 15:07:41 +0000
39@@ -79,6 +79,9 @@
40 '--dev', required=True, dest='board', choices=KNOWN_BOARDS,
41 help='Generate an SD card or image for the given board.')
42 parser.add_argument(
43+ '--modify-rootfs', required=False, dest='modify_rootfs',
44+ help='The path to a live build script for modifying the rootfs.')
45+ parser.add_argument(
46 '--rootfs', default='ext4', choices=['ext2', 'ext3', 'ext4', 'btrfs'],
47 help='Type of filesystem to use for the rootfs')
48 parser.add_argument(
49
50=== modified file 'linaro_image_tools/media_create/rootfs.py'
51--- linaro_image_tools/media_create/rootfs.py 2011-10-19 13:59:30 +0000
52+++ linaro_image_tools/media_create/rootfs.py 2011-11-04 15:07:41 +0000
53@@ -41,6 +41,10 @@
54 raise ValueError('Unsupported rootfs type')
55
56
57+def live_build_modify(content_dir, script):
58+ cmd_runner.run(['lb', 'modify', script, content_dir], as_root=True)
59+
60+
61 def populate_rootfs(content_dir, root_disk, partition, rootfs_type,
62 rootfs_uuid, should_create_swap, swap_size,
63 partition_offset, board_config=None):

Subscribers

People subscribed via source and target branches