One easy option is to boot the image in QEMU full system, which is fast enough 
for simulation even without KVM, and install from there.


Another possibility that is less easy initially but offers more control and 
sanity is to build your own image from scratch with debootstrap, this would 
also solve any image resizing woes.


Another option that is even less easy initially but offers even more control 
and sanity is to give up on Ubuntu and use Buildroot :-) My idealistic self 
tends to prefer that one. There isn't an R package in mainline, but it should 
not be hard to add one yourself if it doesn't have too many dependencies.

________________________________
From: Seeley, Justin P <jpsee...@wpi.edu>
Sent: Sunday, April 21, 2019 12:55:27 AM
To: Ciro Santilli
Cc: gem5-users@gem5.org
Subject: Re: Expanding Disk Image for FS Mode

Thank you Ciro.

Are you aware of a way to install a program like you would normally on linux 
using something like:
$ sudo apt-get install r-base

but for a partition in a disk image, so that everything is set up correctly on 
the disk image I am using for gem5? I cannot just copy over my R binary from my 
host machine to the mounted disk image because there are dependencies and 
libraries all over the place that were set by the original installation.

I was thinking I would have to either mount the image in some way to do this or 
change my PATH?

Justin

On Apr 20, 2019, at 4:49 AM, Ciro Santilli 
<ciro.santi...@arm.com<mailto:ciro.santi...@arm.com>> wrote:

Since this question is mostly gem5 agnostic, I would also recommend thoroughly 
searching Stack Exchange as well, e.g.: 
https://superuser.com/questions/693158/can-i-expand-the-size-of-a-file-based-disk-image

Another thing you might be able to do is to put your additions on a separate 
image as mentioned at: 
https://stackoverflow.com/questions/55603929/question-about-transferring-files-to-arm-linux-in-gem5-full-system-mode

It is also worth noting that QEMU's qcow2 disk image format allows for sparse 
images, allowing to create a humongous image that takes up little disk space. 
It would be awesome if we added support for it in gem5 at some point. Ubuntu's 
convenient cloud images are distributed like that for example.


________________________________
From: gem5-users 
<gem5-users-boun...@gem5.org<mailto:gem5-users-boun...@gem5.org>> on behalf of 
Seeley, Justin P <jpsee...@wpi.edu<mailto:jpsee...@wpi.edu>>
Sent: Tuesday, April 16, 2019 7:31:45 PM
To: gem5-users@gem5.org<mailto:gem5-users@gem5.org>
Subject: [gem5-users] Expanding Disk Image for FS Mode

Hello,

I am using the X86 disk image from:
http://gem5.org/Download<https://nam03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgem5.org%2FDownload&data=02%7C01%7Cjpseeley%40wpi.edu%7Cffd8249a2fa74fb5d99608d6c56d1447%7C589c76f5ca1541f9884b55ec15a0672a%7C0%7C1%7C636913469657517870&sdata=e%2FtoXc3vx8ricIaZmXhFZOt1JdSN3HkrLGQsuTxhwMw%3D&reserved=0>

I am trying to get full system mode working, so I use an R script as a 
benchmark.

This requires me to edit the disk image by:
1. Copying over my R scripts
2. Installing R
3. Installing Rscript

I can easily copy over my R scripts by just copying them over to the mounted 
disk image.

However, installing R and Rscript is not so easy. The disk image does not have 
enough room to install them, so I have been trying to expand the disk image to 
no success. I get the following for this disk image.

> e2fsck -f linux-x86.img
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open linux-x86.img

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a dos partition table in linux-x86.img
________

I am able to increase the disk size with:
> sudo dd if=/dev/zero bs=1M count=400 >>  linux-x86.img

But because of this superblock issue resize2fs does not work.

Has anyone had any luck expanding the X86 disk image for gem5? It seems strange 
the disk image from the gem5 source has this superblock issue.

Thank you,
Justin

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to