~linaro-image-tools/linaro-image-tools/trunk

« back to all changes in this revision

Viewing changes to linaro_image_tools/media_create/rootfs.py

  • Committer: Fathi Boudra
  • Date: 2013-08-17 05:10:14 UTC
  • mfrom: (633.3.3 initial-fedora-support)
  • Revision ID: fathi.boudra@linaro.org-20130817051014-wiur8eyipw0upske
Add initial support for Fedora rootfs

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
def populate_rootfs(content_dir, root_disk, partition, rootfs_type,
45
45
                    rootfs_id, should_create_swap, swap_size,
46
 
                    mmc_device_id, partition_offset, board_config=None):
 
46
                    mmc_device_id, partition_offset, os_release_id,
 
47
                    board_config=None):
47
48
    """Populate the rootfs and make the necessary tweaks to make it usable.
48
49
 
49
50
    This consists of:
86
87
 
87
88
        append_to_fstab(root_disk, fstab_additions)
88
89
 
89
 
        print "\nCreating /etc/flash-kernel.conf\n"
90
 
        create_flash_kernel_config(
91
 
            root_disk, mmc_device_id, 1 + partition_offset)
 
90
        if os_release_id == 'debian' or os_release_id == 'ubuntu':
 
91
            print "\nCreating /etc/flash-kernel.conf\n"
 
92
            create_flash_kernel_config(
 
93
                root_disk, mmc_device_id, 1 + partition_offset)
92
94
 
93
 
        if board_config is not None:
94
 
            print "\nUpdating /etc/network/interfaces\n"
95
 
            update_network_interfaces(root_disk, board_config)
 
95
            if board_config is not None:
 
96
                print "\nUpdating /etc/network/interfaces\n"
 
97
                update_network_interfaces(root_disk, board_config)
96
98
 
97
99
 
98
100
def update_network_interfaces(root_disk, board_config):
136
138
    not be world-readable.
137
139
    """
138
140
    p = cmd_runner.run(
139
 
        ['find', directory, '-maxdepth', '1', '-mindepth', '1'],
 
141
        ['find', directory, '-maxdepth', '1', '-mindepth', '1',
 
142
         '!', '-name', 'lost+found'],
140
143
        stdout=subprocess.PIPE, as_root=True)
141
144
    stdout, _ = p.communicate()
142
145
    return stdout.split()