def CopyUdevAndSupportFiles(cls): # Copy all of the udev files udev_conf_dir = "/etc/udev/" temp_udev_conf_dir = var.temp + udev_conf_dir if os.path.isdir(udev_conf_dir): shutil.copytree(udev_conf_dir, temp_udev_conf_dir) udev_lib_dir = "/lib/udev/" temp_udev_lib_dir = var.temp + udev_lib_dir if os.path.isdir(udev_lib_dir): shutil.copytree(udev_lib_dir, temp_udev_lib_dir) # Rename udevd and place in /sbin udev_path = Tools.GetUdevPath() systemd_dir = os.path.dirname(udev_path) sbin_udevd = var.sbin + "/udevd" udev_path_temp = var.temp + udev_path if os.path.isfile(udev_path_temp) and udev_path != sbin_udevd: udev_path_new = var.temp + sbin_udevd os.rename(udev_path_temp, udev_path_new) temp_systemd_dir = var.temp + systemd_dir # If the directory is empty, than remove it. # With the recent gentoo systemd root prefix move, it is moving to # /lib/systemd. Thus this directory also contains systemd dependencies # such as: libsystemd-shared-###.so # https://gentoo.org/support/news-items/2017-07-16-systemd-rootprefix.html if not os.listdir(temp_systemd_dir): os.rmdir(temp_systemd_dir)
class Base(Hook): @classmethod # Returns the kmod links def GetKmodLinks(cls): return cls._kmod_links # Dependencies # 1. sys-apps/busybox # 2. sys-apps/kmod # 3. app-shells/bash # 4. sys-apps/grep # 5. sys-apps/kbd # 6. udev _files = [ "/bin/busybox", Tools.GetProgramPath("kmod"), "/bin/bash", "/bin/egrep", "/bin/fgrep", "/bin/grep", "/usr/bin/loadkeys", Tools.GetUdevPath(), Tools.GetProgramPath("udevadm"), ] _kmod_links = ["depmod", "insmod", "lsmod", "modinfo", "modprobe", "rmmod"]
def CopyUdevSupportFiles(cls): # Copy all of the udev files if os.path.isdir("/etc/udev/"): shutil.copytree("/etc/udev/", var.temp + "/etc/udev/") if os.path.isdir("/lib/udev/"): shutil.copytree("/lib/udev/", var.temp + "/lib/udev/") # Rename udevd and place in /sbin udev_path = Tools.GetUdevPath() systemd_dir = os.path.dirname(udev_path) if os.path.isfile(var.temp + udev_path) and udev_path != "/sbin/udevd": os.rename(var.temp + udev_path, var.temp + "/sbin/udevd") os.rmdir(var.temp + systemd_dir)
class Base(Hook): @classmethod # Returns the kmod links def GetKmodLinks(cls): return cls._kmod_links _files = [ # sys-apps/busybox "/bin/busybox", # sys-apps/kmod Tools.GetProgramPath("kmod"), # app-shells/bash "/bin/bash", # sys-apps/grep "/bin/egrep", "/bin/fgrep", "/bin/grep", # sys-apps/kbd, "/usr/bin/loadkeys", # udev Tools.GetUdevPath(), Tools.GetProgramPath("udevadm"), ] _kmod_links = [ "depmod", "insmod", "lsmod", "modinfo", "modprobe", "rmmod", ]