configs: make --disk-images optional in fs.py
authorCiro Santilli <ciro.santilli@arm.com>
Tue, 24 Mar 2020 15:38:51 +0000 (15:38 +0000)
committerCiro Santilli <ciro.santilli@arm.com>
Fri, 17 Apr 2020 14:33:30 +0000 (14:33 +0000)
The main applications are to run baremetal programs and initramfs Linux
kernel.

Before this patch, disks() calls in makeArmSystem would throw:

IOError: Can't find file 'linux-aarch32-ael.img' on M5_PATH.

In order to achieve this, this commit also removes the default hardcoded
disk image basenames.

For example, before this commit, running without a --disk-image in X86
would automatically search for an image with basename x86root.img in
M5_PATH, which means we would either have to ignore any disk image error,
or else running without disk images would fail.

After this commit, you would have to pass --disk-image x86root.img to
achieve the old behaviour.

Change-Id: I0ae8c4b3b93d0074fd4fca0d5ed52181c50b6c04
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27867
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

configs/common/Benchmarks.py
configs/common/FSConfig.py

index 4c905e3e16c49bd2a800aaf35340eca507ac196e..8477d77c481e8aee29a28793375477aadfde6409 100644 (file)
@@ -55,16 +55,8 @@ class SysConfig:
     def disks(self):
         if self.disknames:
             return [disk(diskname) for diskname in self.disknames]
-        elif buildEnv['TARGET_ISA'] == 'x86':
-            return [env.get('LINUX_IMAGE', disk('x86root.img'))]
-        elif buildEnv['TARGET_ISA'] == 'arm':
-            return [env.get('LINUX_IMAGE', disk('linux-aarch32-ael.img'))]
-        elif buildEnv['TARGET_ISA'] == 'sparc':
-            return [env.get('LINUX_IMAGE', disk('disk.s10hw2'))]
         else:
-            print("Don't know what default disk image to use for %s ISA" %
-                buildEnv['TARGET_ISA'])
-            exit(1)
+            return []
 
     def rootdev(self):
         if self.root:
index 376ae1a92e5826814778b088996f4ae531f46de3..a424a30ce8d12f72e097019b3557a59f10d1331f 100644 (file)
@@ -205,13 +205,6 @@ def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None,
     self.realview = platform_class()
     self._bootmem = self.realview.bootmem
 
-    if isinstance(self.realview, VExpress_EMM64):
-        if os.path.split(mdesc.disks()[0])[-1] == 'linux-aarch32-ael.img':
-            print("Selected 64-bit ARM architecture, updating default "
-                  "disk image...")
-            mdesc.diskname = 'linaro-minimal-aarch64.img'
-
-
     # Attach any PCI devices this platform supports
     self.realview.attachPciDevices()
 
@@ -278,7 +271,7 @@ def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None,
         # the error message below. The disk can have any name now and
         # doesn't need to include 'android' substring.
         if (mdesc.disks() and
-                os.path.split(mdesc.disks()[0])[-1]).lower().count('android'):
+                os.path.split(mdesc.disks()[0])[-1].lower().count('android')):
             if 'android' not in mdesc.os_type():
                 fatal("It looks like you are trying to boot an Android " \
                       "platform.  To boot Android, you must specify " \