Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65af9993 authored by Vincent Donnefort's avatar Vincent Donnefort Committed by Gerrit Code Review
Browse files

Merge "Fix missing dev nodes in init_boot.img ramdisk"

parents 195b5fc6 6e861e9c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6160,6 +6160,7 @@ endif
ifdef BUILDING_INIT_BOOT_IMAGE
	$(hide) $(call package_files-copy-root, $(TARGET_RAMDISK_OUT),$(zip_root)/INIT_BOOT/RAMDISK)
	$(hide) $(call fs_config,$(zip_root)/INIT_BOOT/RAMDISK,) > $(zip_root)/META/init_boot_filesystem_config.txt
	$(hide) cp $(RAMDISK_NODE_LIST) $(zip_root)/META/ramdisk_node_list
ifdef BOARD_KERNEL_PAGESIZE
	$(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/INIT_BOOT/pagesize
endif # BOARD_KERNEL_PAGESIZE
+2 −1
Original line number Diff line number Diff line
@@ -1001,7 +1001,8 @@ def AddImagesToTargetFiles(filename):
  if has_init_boot:
    banner("init_boot")
    init_boot_image = common.GetBootableImage(
        "IMAGES/init_boot.img", "init_boot.img", OPTIONS.input_tmp, "INIT_BOOT")
        "IMAGES/init_boot.img", "init_boot.img", OPTIONS.input_tmp, "INIT_BOOT",
        dev_nodes=True)
    if init_boot_image:
      partitions['init_boot'] = os.path.join(
          OPTIONS.input_tmp, "IMAGES", "init_boot.img")
+18 −8
Original line number Diff line number Diff line
@@ -1547,14 +1547,20 @@ def BuildVBMeta(image_path, partitions, name, needed_partitions):


def _MakeRamdisk(sourcedir, fs_config_file=None,
                 dev_node_file=None,
                 ramdisk_format=RamdiskFormat.GZ):
  ramdisk_img = tempfile.NamedTemporaryFile()

  if fs_config_file is not None and os.access(fs_config_file, os.F_OK):
    cmd = ["mkbootfs", "-f", fs_config_file,
           os.path.join(sourcedir, "RAMDISK")]
  else:
    cmd = ["mkbootfs", os.path.join(sourcedir, "RAMDISK")]
  cmd = ["mkbootfs"]

  if fs_config_file and os.access(fs_config_file, os.F_OK):
    cmd.extend(["-f", fs_config_file])

  if dev_node_file and os.access(dev_node_file, os.F_OK):
    cmd.extend(["-n", dev_node_file])

  cmd.append(os.path.join(sourcedir, "RAMDISK"))

  p1 = Run(cmd, stdout=subprocess.PIPE)
  if ramdisk_format == RamdiskFormat.LZ4:
    p2 = Run(["lz4", "-l", "-12", "--favor-decSpeed"], stdin=p1.stdout,
@@ -1572,7 +1578,8 @@ def _MakeRamdisk(sourcedir, fs_config_file=None,
  return ramdisk_img


def _BuildBootableImage(image_name, sourcedir, fs_config_file, info_dict=None,
def _BuildBootableImage(image_name, sourcedir, fs_config_file,
                        dev_node_file=None, info_dict=None,
                        has_ramdisk=False, two_step_image=False):
  """Build a bootable image from the specified sourcedir.

@@ -1614,7 +1621,7 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file, info_dict=None,

  if has_ramdisk:
    ramdisk_format = GetRamdiskFormat(info_dict)
    ramdisk_img = _MakeRamdisk(sourcedir, fs_config_file,
    ramdisk_img = _MakeRamdisk(sourcedir, fs_config_file, dev_node_file,
                               ramdisk_format=ramdisk_format)

  # use MKBOOTIMG from environ, or "mkbootimg" if empty or not set
@@ -1822,7 +1829,8 @@ def HasRamdisk(partition_name, info_dict=None):


def GetBootableImage(name, prebuilt_name, unpack_dir, tree_subdir,
                     info_dict=None, two_step_image=False):
                     info_dict=None, two_step_image=False,
                     dev_nodes=False):
  """Return a File object with the desired bootable image.

  Look for it in 'unpack_dir'/BOOTABLE_IMAGES under the name 'prebuilt_name',
@@ -1858,6 +1866,8 @@ def GetBootableImage(name, prebuilt_name, unpack_dir, tree_subdir,
  fs_config = "META/" + tree_subdir.lower() + "_filesystem_config.txt"
  data = _BuildBootableImage(prebuilt_name, os.path.join(unpack_dir, tree_subdir),
                             os.path.join(unpack_dir, fs_config),
                             os.path.join(unpack_dir, 'META/ramdisk_node_list')
                                if dev_nodes else None,
                             info_dict, has_ramdisk, two_step_image)
  if data:
    return File(name, data)