Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account with a wrong DEVICE variable value causes error #89

c0mix opened this issue Sep 17, 2018 · 2 comments
Closed with a wrong DEVICE variable value causes error #89

c0mix opened this issue Sep 17, 2018 · 2 comments


Copy link

@c0mix c0mix commented Sep 17, 2018

Inside firmadyne.config, the below assumption is not always correct.

get_device () {
    echo "/dev/mapper/loop0p1"

This wrong assumption causes a failure during the mounting phase of because get_device it is called by the script to set DEVICE variable (line 51).


To avoid this issue, a simple workaround could be applied inside file, specifically, it is possible to use the output of the kpartx command to infer the correct device name and set DEVICE variable.

echo "----Mounting QEMU Image----"
output=$(kpartx -a -s -v "${IMAGE}")
foo=$(echo "$output" | cut -d ' ' -f 3)
echo $DEVICE # for debug purpose (can be removed)
sleep 1

The fixed should look like this:
Note: Tested on ubuntu 18.04 with 4.15.0-34-generic

Copy link

@ddcc ddcc commented Sep 18, 2018

Thanks for the feedback. Can you submit it as a pull request? My only concern is that other scripts such as also utilize this functionality, so it'd be better to move the parsing into the firmadyne.config script, and have get_device take the output of kpartx as an input argument.

c0mix added a commit to c0mix/firmadyne that referenced this issue Sep 18, 2018
Copy link
Contributor Author

@c0mix c0mix commented Sep 18, 2018

As suggested I've opened a pull request here #90 moving the parsing into firmadyne.config
I hope that this will help you to improve your fantastic tool :)

ddcc added a commit that referenced this issue Oct 5, 2018
* bugfix to issue 89

@ddcc ddcc closed this in 3f79250 Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants