usbmux
USB SD Card MUX controller class to manage the mux and connected cards.
- class nebula.usbmux.usbmux(yamlfilename=None, board_name=None, target_mux=None, search_path=None)
Bases:
utils
USB SD Card MUX controller and helper methods
- backup_files_to_external(partition='boot', target=[], destination='backup', subfolder=None)
Backup specified files to an external location
- Args:
partition (str): Source partition. Either boot or root target (list): Filenames that will be backup’d destination (str): Directory name at host to place the backup’d files subfolder (str): Directory name under destination to place the backup’d files, random by default
- find_mux_device()
Find the mux device itself.
- find_muxed_sdcard()
Find SD card connected through SD card mux.
Before calling this method PLEASE POWER DOWN THE DUT.
- get_mux_mode()
Get the current mux mode.
- search_path = '/dev/usb-sd-mux/'
- set_mux_mode(mode)
Set the mux mode.
- Args:
mode (str): The mode to set the mux to. Options are: “host”, “dut”, “off”.
- target_mux = None
- update_boot_files_from_external(bootbin_loc=None, kernel_loc=None, devicetree_loc=None, devicetree_overlay_loc=None, devicetree_overlay_config_loc=None, extlinux_loc=None, scr_loc=None, preloader_loc=None)
Update the boot files from outside SD card itself.
- Args:
bootbin_loc (str): The path to the boot.bin file kernel_loc (str): The path to the kernel file devicetree_loc (str): The path to the devicetree file devicetree_overlay_loc (str): The path to the devicetree overlay file devicetree_overlay_config (str): The devicetree overlay configuration to be written on /boot/config.txt extlinux_loc (str): The path to the Extlinux configuration file (Intel boards). scr_loc (str): The path to the .scr file (Intel boards). preloader_loc (str): The path to the preloader file (.sfp) (Intel boards).
- update_boot_files_from_sdcard_itself(descriptor_path=None, bootbin_loc=None, kernel_loc=None, devicetree_loc=None, extlinux_loc=None, scr_loc=None, preloader_loc=None)
Update the boot files from the SD card itself.
- Args:
descriptor_path (str): The path to the kuiper.json. bootbin_loc (str): The path to the boot.bin file on the SD card. kernel_loc (str): The path to the kernel file on the SD card. devicetree_loc (str): The path to the devicetree file on the SD card. extlinux_loc (str): The path to the Extlinux configuration file on the SD card (Intel boards). scr_loc (str): The path to the .scr file on the SD card (Intel boards). preloader_loc (str): The path to the preloader file (.sfp) on the SD card (Intel boards).
- update_devicetree_for_mux(devicetree_filename='system.dtb')
- update_rootfs_files_from_external(target, destination)
Update the root file system from outside SD card itself.
- Args:
target (str): The path to the external target file/folder. destination (str): The path to the destination file/folder.
- write_img_file_to_sdcard(img_filename)
Write an image file to the SD card.
- Args:
img_filename (str): The path to the image file to write.