Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 237759 - sys-apps/kexec-tools initscript: ambiguous /etc/mtab parse result
Summary: sys-apps/kexec-tools initscript: ambiguous /etc/mtab parse result
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Jeremy Olexa (darkside) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-15 17:26 UTC by Sergey
Modified: 2009-01-23 04:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
diff between original kexec initscript and mine (kexec.patch,901 bytes, patch)
2008-09-16 12:17 UTC, Sergey
Details | Diff
my emerge --info (emerge.info,2.82 KB, text/plain)
2008-09-16 12:18 UTC, Sergey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey 2008-09-15 17:26:52 UTC
My initscript attached. I have in it:
ROOTPART="$(sed -n '/^[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /etc/mtab)"

So $ROOTPART is:
$ echo $(sed -n '/^[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /etc/mtab)
rootfs /dev/root

This result is wrong. We need:
1. parse only one path to root partition
2. check if its symlink, and resolve it if needed

Patch, that fixes the problem is attached.

Reproducible: Always
Comment 1 Sergey 2008-09-15 17:30:24 UTC
I can't attach files, so I've uploaded them here: http://overlay.j3qq4.org/kexec

kexec.old -- old initscript
kexec -- new initscript
kexec.patch -- patch
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2008-09-15 21:16:25 UTC
1) Please post or attach a diff between the original init.d script and yours.
2) Please post your `emerge --info' in any case.

3) I assume this is for =sys-apps/baselayout-2*
Comment 3 Sergey 2008-09-16 12:17:27 UTC
Created attachment 165552 [details, diff]
diff between original kexec initscript and mine
Comment 4 Sergey 2008-09-16 12:18:32 UTC
Created attachment 165554 [details]
my emerge --info
Comment 5 Sergey 2008-09-16 12:20:05 UTC
YES, it's for =sys-apps/baselayout-2* :)
Comment 6 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-01-22 05:10:30 UTC
I'll maintain kexec-tools now, looking at bugs in the next week. Thanks Marius for your work there.
Comment 7 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-01-23 04:23:35 UTC
Sergey,
I appreciate your patch here but it looks like it was mostly already implemented.

ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /etc/mtab)")"

Please re-open if needed, I don't think it is anymore. Thanks.