Boot fails if /sbin/init (or init= arg) is an absolute symlink
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | initramfs-tools (Ubuntu) |
Undecided
|
Dimitri John Ledkov | ||
Bug Description
Booting current Utopic with init=/bin/systemd fails., or installing systemd-sysv fails. In both cases we are dealing with an absolute symlink "/bin/systemd -> /lib/systemd/
/init: line 307: readlink: not found
Target filesystem doesn't have requested /bin/systemd
and then a kernel panic.
Related branches
| Changed in initramfs-tools (Ubuntu): | |
| assignee: | nobody → Martin Pitt (pitti) |
| status: | New → In Progress |
| tags: | added: systemd-boot |
| Martin Pitt (pitti) wrote : | #1 |
| summary: |
- Boot fails if /sbin/init is an absolute symlink + Boot fails if /sbin/init (or init= arg) is an absolute symlink |
| Martin Pitt (pitti) wrote : | #2 |
Moreover, this obviously works in Debian, but between Ubuntu's and Debian's initramfs initd there is no obvious difference for readlink.
| Dimitri John Ledkov (xnox) wrote : | #3 |
I would prefer that /sbin/init is shipped as a real file by systemd-sysv, instead of a symlink of any kind. (E.g. a copy of /lib/systemd/
| Dimitri John Ledkov (xnox) wrote : | #5 |
Actually, i take that back. To support running upstart user sessions under systemd-sysv, we'd need to split upstart package. In that case upstart will ship /sbin/init which would be a symlink as well. Similar to how systemd-sysv is packaged.
| Dimitri John Ledkov (xnox) wrote : | #6 |
for execvp(
| Changed in initramfs-tools (Ubuntu): | |
| status: | In Progress → Fix Committed |
| assignee: | Martin Pitt (pitti) → Dimitri John Ledkov (xnox) |
| Launchpad Janitor (janitor) wrote : | #7 |
This bug was fixed in the package initramfs-tools - 0.103ubuntu8
---------------
initramfs-tools (0.103ubuntu8) utopic; urgency=medium
* Add readlink symlink for busybox in the busybox hook, needed to
support /sbin/init as a readlink (LP: #1351295).
-- Dimitri John Ledkov <email address hidden> Fri, 01 Aug 2014 16:46:35 +0100
| Changed in initramfs-tools (Ubuntu): | |
| status: | Fix Committed → Fix Released |
| A. Eibach (andi3) wrote : | #8 |
Strange.
I still got the "line 307: readlink: not found" error on bootup although I do have initramfs-tools 0.103ubuntu8.
| Dimitri John Ledkov (xnox) wrote : Re: [Bug 1351295] Re: Boot fails if /sbin/init (or init= arg) is an absolute symlink | #9 |
On 7 August 2014 03:03, A. Eibach <email address hidden> wrote:
> Strange.
>
> I still got the "line 307: readlink: not found" error on bootup although
> I do have initramfs-tools 0.103ubuntu8.
>
It's not just initramfs-tools package, one also needs to regenerate
initramfs with that tools package for all kernels you wish to boot.
Reboot to latest kernel; $ sudo update-initramfs -u; reboot again
should do the trick.
--
Regards,
Dimitri.
| A. Eibach (andi3) wrote : | #10 |
Thank you!
Hmm..."Latest kernel"...that's another interesting thing...always got nothing but black screens in 3.16, hence I had to go back to the 3.13 series (patch levels 30 +) and --- no more problems.
| A. Eibach (andi3) wrote : | #11 |
$ sudo update-initramfs -k 3.13.0-32-generic -u
voila !! thanks again for leading me in the right direction.
I've decided to post this too here; maybe it will help some more users new to Ubuntu.


This is coming from "init" line284:
That's the readlink that isn't found (not the chrooted one in the next line). I added a few debugging steps, and "type readlink" says "readlink is readlink". I cannot reproduce this in break=bottom, in the interactive shell readlink /root/bin/systemd works just fine. But as soon as I Ctrl+D, readlink doesn't work any more. Some subtle busybox difference between interactive and shell script mode?
It works if I replace this with
but that's not a proper solution but a workaround.