The build of ISO files through catalyst is now failing by what seems to be a regression in baselayout-2. I'm attaching a discussion we had on #gentoo-releng about this. 21:39 < rps_> Anyone know what would cause Catalyst to fail to create the symlink to '/usr/src/linux' in a livecd-stage2 build? 22:43 <+jmbsvicetto> rps_: Can you please expand your comment? 22:44 <+jmbsvicetto> rps_: I assume you may be getting the same issue we're hitting while building genkernel 23:47 < rps_> jmbsvicetto: yes, during genkernel the build fails with * ERROR: kernel source directory "/usr/src/linux" was not found! 16:01 * armin76 is checking it 16:02 <@armin76> for some reason gentoo-sources gets emerged with -symlink 18:20 <+jmbsvicetto> armin76: symlink is not an IUSE default 18:20 <@armin76> jmbsvicetto: yeah...but why it worked before? i'm trying to find where are the changes 18:21 <+jmbsvicetto> armin76: no idea 18:21 <@armin76> the only thing related i can think of is the removal of the kernel virtual 18:21 <+jmbsvicetto> I've looked at the kernel-2 eclass and didn't see any recent changes that would do it 18:21 <+jmbsvicetto> yeah 18:21 <+jmbsvicetto> As far as I can see we're still using the old genkernel, so it wasn't anything sping worked on 18:26 <@armin76> i'm checking with the snapshot last time it worked, which is 20110509 for sparc 18:39 <@armin76> the question is how did it create the symlink before if it wasn't due to the use-flag 18:39 <@armin76> the current kernel version is .38 while on 0509 it was .37, maybe they changed something there 18:40 <@armin76> as the symlink use-flag only forces the symlink, so i understand it should create it even without the use-flag 18:48 < rps_> armin76: im building against an older kernel version and still have the symlink issue 18:51 <@armin76> rps_: nod, thanks 18:51 <@armin76> lets see if we can find the problem 19:01 <@armin76> i think i have found the issue 19:01 <@armin76> jmbsvicetto: ^ 19:01 <@armin76> /usr/src is not created by baselayout-2 19:01 <@armin76> while it did with -1 19:02 <@armin76> although when gentoo-sources is emerged it creates it...hrm... 19:02 <@armin76> well, its just a guess, i keep investigating 19:02 <+jmbsvicetto> armin76: _\ 19:02 <+jmbsvicetto> :| 19:03 <@armin76> the symlink is created by the kernel-2.eclass even with symlink disabled 19:04 <@armin76> http://dpaste.com/553149/ 19:04 <@armin76> i put an ls -ltrah /usr/src at the beginning and at the end of postinst of the kernel-2 eclass 19:05 <@armin76> ah...well, the clue is in the eclass 19:06 <@armin76> # if the link doesnt exist, lets create it 19:06 <@armin76> [[ ! -h ${ROOT}usr/src/linux ]] && MAKELINK=1 19:06 <@armin76> if [[ ${MAKELINK} == 1 ]]; then 19:06 <@armin76> cd "${ROOT}"usr/src 19:06 <@armin76> ln -sf linux-${KV_FULL} linux 19:06 <@armin76> cd ${OLDPWD} 19:06 <@armin76> fi 19:06 <@armin76> that gets done even if symlink use-flag is not enabled 19:07 <@armin76> but since this is a postinst, /usr/src should exist... 19:07 <@armin76> i'll debug more 21:02 <@armin76> jmbsvicetto: i'm right, its due to that, can you please file a bug? 21:03 <@armin76> jmbsvicetto: the thing is that catalyst extracts the kernel to /tmp/kerncache inside the chroot 21:04 <@armin76> /tmp/kerncache is a bindmount of the build directory on /var/tmp/catalyst/kerncache/$build 21:04 <@armin76> catalyst does a symlink from /tmp/kerncache/$kernel/usr/src/linux to /usr/src/linux 21:05 <@armin76> but since /usr/src doesn't exist, it fails 21:08 <@armin76> and we can't modify catalyst to use /tmp/kerncache because i think it changes it depending on the kernels 21:09 <@armin76> well...maybe we could...but still, its a bl2 regression 15:09 <+jmbsvicetto> armin76: ok, give me a few minutes to open the bug
i dont really follow the logic. if it's up to kernel-2.eclass to create the symlink, and it's only created when a kernel has been installed, then why do you need /usr/src/ ? further, it seems like kernel-2.eclass should mkdir /usr/src if it doesnt already exist as you're going to hit the same problem if someone does `rm -rf /usr/src` (say to free up some space). i'm on the fence in terms of having baselayout-2 create /usr/src.
The eclass is okay. If you don't have an /usr/src/linux it will create it. The problem is that catalyst emerges the kernel sources with ROOT=/tmp/kerncache, therefore /usr/src/linux doesn't get created on /. /tmp/kerncache inside the catalyst chroot is a bind-mount of /var/tmp/catalyst/kerncache/catalyst/kerncache/default/$KERNEL . Then catalyst symlinks /usr/src/linux to /tmp/kerncache inside the chroot. Since /usr/src/ doesn't exist, it can't create the symlink. The thing here is that bl-1 created /usr/src(you know, having a file called .keep inside the directory) while bl-2 does not. Obviously catalyst can be changed, but this is still a regression from bl-1. Maybe it only affects catalyst, but still...
it's not just /usr/src. baselayout-2 dropped a lot of dirs. 2.0.3 adds a bunch back though.
Mike, should we use this bug to get baselayout-2.0.3 stabled or do you prefer we open a new bug for that?
a new stable bug would be best