diff --git a/toolkit/Makefile b/toolkit/Makefile index 759b698370..0eb59e9ce5 100644 --- a/toolkit/Makefile +++ b/toolkit/Makefile @@ -143,14 +143,13 @@ SOURCE_URL ?= https://files-rs.edgeorchestration.intel.com/files-edge-or # assignments do not take affect without using 'override'. This means that all of the following PACKAGE_URL_LIST values will # be ignored if the user sets any value. ##help:var:PACKAGE_URL_LIST:=Space-separated list of URLs to download toolchain RPM packages from, used to populate the toolchain packages if `REBUILD_TOOLCHAIN=n'. The URLs will replace the default set of URLs. Print default list with 'make -s printvar-PACKAGE_URL_LIST'. -PACKAGE_URL_LIST ?= https://files-rs.edgeorchestration.intel.com/files-edge-orch/microvisor/rpm/$(RELEASE_MAJOR_ID)/RPMS/x86_64 -PACKAGE_URL_LIST += https://files-rs.edgeorchestration.intel.com/files-edge-orch/microvisor/rpm/$(RELEASE_MAJOR_ID)/RPMS/noarch -PACKAGE_URL_LIST += https://files-rs.edgeorchestration.intel.com/files-edge-orch/microvisor/rpm/$(RELEASE_MAJOR_ID)/RPMS/debuginfo +PACKAGE_URL_LIST ?= https://files-rs.edgeorchestration.intel.com/files-edge-orch/microvisor/rpms/3.0/base +PACKAGE_URL_LIST += https://files-rs.edgeorchestration.intel.com/files-edge-orch/microvisor/rpms/3.0/debuginfo -PACKAGE_REPO_LIST ?= https://files-rs.edgeorchestration.intel.com/files-edge-orch/microvisor/rpm/$(RELEASE_MAJOR_ID) +PACKAGE_REPO_LIST ?= $(PACKAGE_URL_LIST) -REPO_LIST ?= -SRPM_URL_LIST ?= https://files-rs.edgeorchestration.intel.com/files-edge-orch/microvisor/rpm/$(RELEASE_MAJOR_ID)/SRPMS +REPO_LIST ?= +SRPM_URL_LIST ?= https://files-rs.edgeorchestration.intel.com/files-edge-orch/microvisor/rpms/3.0/srpm ##help:var:VALIDATE_TOOLCHAIN_GPG={y,n}=Enable or disable GPG validation of the toolchain RPMs. If enabled toolchain RPMs will be validated against the GPG keys in the TOOLCHAIN_GPG_VALIDATION_KEYS variable. On by default when using upstream toolchain RPMs. # Based on REBUILD_TOOLCHAIN and DAILY_BUILD_ID. If REBUILD_TOOLCHAIN is set to 'y' or DAILY_BUILD_ID is set to any non-empty value, then GPG validation is disabled by default. diff --git a/toolkit/resources/manifests/package/development.repo b/toolkit/resources/manifests/package/development.repo index a110df4ef4..abdf729484 100644 --- a/toolkit/resources/manifests/package/development.repo +++ b/toolkit/resources/manifests/package/development.repo @@ -1,6 +1,6 @@ [development-repo] name=development Repo -baseurl=http://rpm-edgemicrovisor.intel.com/3.0 +baseurl=http://rpm-emt.intel.com/pulp/content/emt-3.0-test-base enabled=1 gpgcheck=0 skip_if_unavailable=1 diff --git a/toolkit/scripts/daily_build.mk b/toolkit/scripts/daily_build.mk index 55ef1f19c4..e114565021 100644 --- a/toolkit/scripts/daily_build.mk +++ b/toolkit/scripts/daily_build.mk @@ -65,6 +65,8 @@ endif ifneq ($(DAILY_BUILD_REPO),) PACKAGE_ROOT := $(shell grep -m 1 "baseurl" $(DAILY_BUILD_REPO) | sed 's|baseurl=||g') + PACKAGE_DEBUGINFO := $(subst base,debuginfo,$(PACKAGE_ROOT)) + PACKAGE_SRPM := $(subst base,srpm,$(PACKAGE_ROOT)) $(warning ) $(warning ######################### WARNING #########################) $(warning Using a Daily Build Repo at following location:) @@ -72,12 +74,11 @@ ifneq ($(DAILY_BUILD_REPO),) $(warning ######################### WARNING #########################) $(warning ) override PACKAGE_URL_LIST := $(PACKAGE_URL_LIST) \ - $(PACKAGE_ROOT)/RPMS/x86_64 \ - $(PACKAGE_ROOT)/RPMS/noarch \ - $(PACKAGE_ROOT)/RPMS/debuginfo + $(PACKAGE_ROOT) \ + $(PACKAGE_DEBUGINFO) override SRPM_URL_LIST := $(SRPM_URL_LIST) \ - $(PACKAGE_ROOT)/SRPMS + $(PACKAGE_SRPM) override PACKAGE_REPO_LIST := $(PACKAGE_REPO_LIST) \ $(PACKAGE_ROOT) diff --git a/toolkit/scripts/toolchain/download_toolchain_rpm.sh b/toolkit/scripts/toolchain/download_toolchain_rpm.sh index 92de52431f..0548c2c739 100755 --- a/toolkit/scripts/toolchain/download_toolchain_rpm.sh +++ b/toolkit/scripts/toolchain/download_toolchain_rpm.sh @@ -165,7 +165,8 @@ function download() { log_num=$((log_num + 1)) attempt_log_file="$log_file.$log_num" src_url="$url/$rpm_name" - + first_char=$(echo "${rpm_name:0:1}" | tr '[:upper:]' '[:lower:]') + src_url="$url/Packages/$first_char/$rpm_name" echo "$src_url -> $attempt_log_file" >> "$log_file" { $downloader_tool $cert $key --no-clobber --output-file="$dst_file" --log-file="$attempt_log_file" "$src_url" 1>/dev/null 2>&1 ; res=$? ; } || true diff --git a/toolkit/tools/imagegen/diskutils/diskutils.go b/toolkit/tools/imagegen/diskutils/diskutils.go index 00e2e6f542..d62b6031ea 100644 --- a/toolkit/tools/imagegen/diskutils/diskutils.go +++ b/toolkit/tools/imagegen/diskutils/diskutils.go @@ -902,20 +902,54 @@ func SystemBlockDevices() (systemDevices []SystemBlockDevice, err error) { return } - systemDevices = make([]SystemBlockDevice, len(blockDevices.Devices)) - - for i, disk := range blockDevices.Devices { - systemDevices[i].DevicePath = fmt.Sprintf("/dev/%s", disk.Name) - - systemDevices[i].RawDiskSize, err = strconv.ParseUint(disk.Size.String(), 10, 64) + // Process each device to build the filtered list + systemDevices = []SystemBlockDevice{} + for _, device := range blockDevices.Devices { + devicePath := fmt.Sprintf("/dev/%s", device.Name) + rawSize, err := strconv.ParseUint(device.Size.String(), 10, 64) if err != nil { - return + return nil, fmt.Errorf("failed to parse size for %s: %v", devicePath, err) } - systemDevices[i].Model = strings.TrimSpace(disk.Model) + isISOInstaller := isReadOnlyISO(devicePath) + + logger.Log.Debugf("Device: %s, Size: %d, Model: %s, isISOInstaller : %v ", + devicePath, rawSize, strings.TrimSpace(device.Model), isISOInstaller) + + if !isISOInstaller { + systemDevices = append(systemDevices, SystemBlockDevice{ + DevicePath: devicePath, + RawDiskSize: rawSize, + Model: strings.TrimSpace(device.Model), + }) + } else { + logger.Log.Debugf("Excluded removable installer device: %s", devicePath) + } } - return + logger.Log.Debugf("Final device list: %v", systemDevices) + return systemDevices, nil +} + +// isReadOnlyISO checks if a device is mounted read-only (ISO on USB/CD). +func isReadOnlyISO(devicePath string) bool { + mounts, err := os.ReadFile("/proc/mounts") + if err != nil { + logger.Log.Debugf("Failed to read /proc/mounts: %v", err) + return false + } + for _, line := range strings.Split(string(mounts), "\n") { + fields := strings.Fields(line) + if len(fields) >= 4 && fields[0] == devicePath && fields[2] == "iso9660" { + options := strings.Split(fields[3], ",") + for _, opt := range options { + if opt == "ro" { + return true + } + } + } + } + return false } func GetDiskPartitions(diskDevPath string) ([]PartitionInfo, error) {