Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions toolkit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:<urls_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.
Expand Down
2 changes: 1 addition & 1 deletion toolkit/resources/manifests/package/development.repo
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 5 additions & 4 deletions toolkit/scripts/daily_build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,20 @@ 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:)
$(warning $(PACKAGE_ROOT))
$(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)
Expand Down
3 changes: 2 additions & 1 deletion toolkit/scripts/toolchain/download_toolchain_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
52 changes: 43 additions & 9 deletions toolkit/tools/imagegen/diskutils/diskutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading