Bug#590744: Fails to boot if /sbin/init is a symlink
* maximilian attems m...@stro.at [Fri Jul 30, 2010 at 01:04:30PM +0200]: On Fri, Jul 30, 2010 at 11:49:32AM +0200, Michael Biebl wrote: On 30.07.2010 11:31, Michael Biebl wrote: On 30.07.2010 06:21, Michael Prokop wrote: Can you please give the following snapshot version a try: http://people.debian.org/~mika/initramfs-tools/initramfs-tools_0.97.3~1.gbp8d572e_all.deb I've tested the following: - /sbin/init being a relative symlink: works - /sbin/init being an absolute symlink: works - /sbin/init missing: correctly dropped to rescue shell, even if upstart installed (/etc/init/) - passing init=/bin/systemd on the boot command line: works - passing bogus init=/sbin/foo on the boot command line: warning message that requested init was not found, is displayed, but continues booting with /sbin/init. So yes, it works correctly now for all cases I tested and expect. Looking at the code, the only issue I see, is that validate_init is *always* executed at least twice, even if we find a valid init at the first try. This means, for most cases we unnecessarily execute validate_init at # No init on rootmount if ! validate_init ${init} ; then Not that much of an issue, just an idea for a small optimization. please this is executed on every boot, could we have a fastforward path for the common cases. dracut probably solved this long ago, please have a look there what fedora guys are doing. dracut doesn't seem to support symlinks at all AFAICS. maks: I've implemented a fastfoward path, please review branch mika/validate_init at http://git.debian.org/?p=kernel/initramfs-tools.git regards, -mika- signature.asc Description: Digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
* Michael Biebl bi...@debian.org [Fri Jul 30, 2010 at 11:49:32AM +0200]: On 30.07.2010 11:31, Michael Biebl wrote: On 30.07.2010 06:21, Michael Prokop wrote: Can you please give the following snapshot version a try: http://people.debian.org/~mika/initramfs-tools/initramfs-tools_0.97.3~1.gbp8d572e_all.deb I've tested the following: - /sbin/init being a relative symlink: works - /sbin/init being an absolute symlink: works - /sbin/init missing: correctly dropped to rescue shell, even if upstart installed (/etc/init/) - passing init=/bin/systemd on the boot command line: works - passing bogus init=/sbin/foo on the boot command line: warning message that requested init was not found, is displayed, but continues booting with /sbin/init. So yes, it works correctly now for all cases I tested and expect. Thanks a lot for testing. Looking at the code, the only issue I see, is that validate_init is *always* executed at least twice, even if we find a valid init at the first try. This means, for most cases we unnecessarily execute validate_init at # No init on rootmount if ! validate_init ${init} ; then Not that much of an issue, just an idea for a small optimization. Good catch. I think I've addressed this issue in branch mika/validate_init at http://git.debian.org/?p=kernel/initramfs-tools.git If you think there's anything else we could improve there please let me know. thanks regards, -mika- signature.asc Description: Digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
On Sat, Jul 31, 2010 at 08:25:09PM +0200, Michael Prokop wrote: dracut doesn't seem to support symlinks at all AFAICS. well this seems sane to me. maks: I've implemented a fastfoward path, please review branch mika/validate_init at http://git.debian.org/?p=kernel/initramfs-tools.git will do in the next 48 hours, but haven't been told that the ! symlink cause is the usual fastpath. not sure this symlink complication is really worth it. -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20100731211529.gq19...@baikonur.stro.at
Bug#590744: Fails to boot if /sbin/init is a symlink
On 31.07.2010 23:15, maximilian attems wrote: On Sat, Jul 31, 2010 at 08:25:09PM +0200, Michael Prokop wrote: dracut doesn't seem to support symlinks at all AFAICS. I'm pretty sure it does. Fedora 14 just switched to systemd and they use a symlink. I guess dracut does not really care and does not do any safety checks as initramfs-tools currently does. maks: I've implemented a fastfoward path, please review branch mika/validate_init at http://git.debian.org/?p=kernel/initramfs-tools.git will do in the next 48 hours, but haven't been told that the ! symlink cause is the usual fastpath. not sure this symlink complication is really worth it. I do think, it should be possible to boot with /sbin/init being a symlink (either absolute or relative). I don't really care if that means, that either the safety checks are made more sophisticated or dropped altogether. Cheers, Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? signature.asc Description: OpenPGP digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
On 30.07.2010 06:21, Michael Prokop wrote: Can you please give the following snapshot version a try: http://people.debian.org/~mika/initramfs-tools/initramfs-tools_0.97.3~1.gbp8d572e_all.deb I've tested the following: - /sbin/init being a relative symlink: works - /sbin/init being an absolute symlink: works - /sbin/init missing: correctly dropped to rescue shell, even if upstart installed (/etc/init/) - passing init=/bin/systemd on the boot command line: works - passing bogus init=/sbin/foo on the boot command line: warning message that requested init was not found, is displayed, but continues booting with /sbin/init. So yes, it works correctly now for all cases I tested and expect. Thanks! Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? signature.asc Description: OpenPGP digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
On 30.07.2010 11:31, Michael Biebl wrote: On 30.07.2010 06:21, Michael Prokop wrote: Can you please give the following snapshot version a try: http://people.debian.org/~mika/initramfs-tools/initramfs-tools_0.97.3~1.gbp8d572e_all.deb I've tested the following: - /sbin/init being a relative symlink: works - /sbin/init being an absolute symlink: works - /sbin/init missing: correctly dropped to rescue shell, even if upstart installed (/etc/init/) - passing init=/bin/systemd on the boot command line: works - passing bogus init=/sbin/foo on the boot command line: warning message that requested init was not found, is displayed, but continues booting with /sbin/init. So yes, it works correctly now for all cases I tested and expect. Looking at the code, the only issue I see, is that validate_init is *always* executed at least twice, even if we find a valid init at the first try. This means, for most cases we unnecessarily execute validate_init at # No init on rootmount if ! validate_init ${init} ; then Not that much of an issue, just an idea for a small optimization. Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? signature.asc Description: OpenPGP digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
On Fri, Jul 30, 2010 at 11:49:32AM +0200, Michael Biebl wrote: On 30.07.2010 11:31, Michael Biebl wrote: On 30.07.2010 06:21, Michael Prokop wrote: Can you please give the following snapshot version a try: http://people.debian.org/~mika/initramfs-tools/initramfs-tools_0.97.3~1.gbp8d572e_all.deb I've tested the following: - /sbin/init being a relative symlink: works - /sbin/init being an absolute symlink: works - /sbin/init missing: correctly dropped to rescue shell, even if upstart installed (/etc/init/) - passing init=/bin/systemd on the boot command line: works - passing bogus init=/sbin/foo on the boot command line: warning message that requested init was not found, is displayed, but continues booting with /sbin/init. So yes, it works correctly now for all cases I tested and expect. Looking at the code, the only issue I see, is that validate_init is *always* executed at least twice, even if we find a valid init at the first try. This means, for most cases we unnecessarily execute validate_init at # No init on rootmount if ! validate_init ${init} ; then Not that much of an issue, just an idea for a small optimization. please this is executed on every boot, could we have a fastforward path for the common cases. dracut probably solved this long ago, please have a look there what fedora guys are doing. thanks. -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20100730110430.go19...@baikonur.stro.at
Bug#590744: Fails to boot if /sbin/init is a symlink
On 29.07.2010 03:01, Michael Prokop wrote: * Michael Biebl bi...@debian.org [Thu Jul 29, 2010 at 02:16:32AM +0200]: On 29.07.2010 01:37, Michael Prokop wrote: * Michael Biebl bi...@debian.org [Thu Jul 29, 2010 at 01:13:01AM +0200]: for testing purposes, I installed the upstart binary as /sbin/upstart and created a symlink /sbin/init → /sbin/upstart This causes a boot failure, due to this check in /usr/share/initramfs- tools/init # Check init bootarg if [ -n ${init} ] [ ! -x ${rootmnt}${init} ]; then echo Target filesystem doesn't have ${init}. init= fi To quote Mithrandir (from irc): Mithrandir -x follows symlinks Mithrandir but that means it'll look for symlinks in the initramfs, so the check is buggy. You shouldn't use an absolut symlink here, use a relative one instead. See Debian policy 10.5 for details. Well, changing it to /sbin/init - upstart did indeed work for this particular case. But I still get the problem when the link is absolute, as is specified by the policy for symlinks not in the same directory. To be a bit more specific what I was doing: I tested the new systemd init system, which installs the binary in /bin/systemd (note the /bin). This isn't an existing + available Debian package yet, right? It's in experimental currently. Why is it installing itself to /bin/systemd? Is it supposed to be executed by non-root users as well? Indeed. The idea is, that systemd is also started by regular users and helps track their user session (replacement/extension for e.g. gnome-session) So I moved /sbin/init from upstart to /sbin/upstart and made /sbin/init a symlink so I could easily test both systems. Using a relative symlink for /sbin/upstart does work, but an absolute symlink /sbin/init - /bin/systemd does not. So I'm reopening the bug report and retitling appropriately. If systemd really uses /bin for a reason we could use something like the following in initramfs-tools' init: # Check init bootarg if [ -n ${init} ] ; then # Work around absolute symlinks initsymlinktarget=${init} if [ -d ${rootmnt} ] [ -h ${rootmnt}${init} ] ; then case $(readlink ${rootmnt}${init}) in /*) initsymlinktarget=$(chroot ${rootmnt} readlink ${init}) ;; esac fi if [ ! -x ${rootmnt}${init} ] || [ ! -x ${rootmnt}${initsymlinktarget} ] ; then echo Target filesystem doesn't have ${init}. init= fi fi Does not work. For one, I guess this check if [ ! -x ${rootmnt}${init} ] || [ ! -x ${rootmnt}${initsymlinktarget} ] ; should be using . Even after fixing that, we run into the same problem, later again, at: # No init on rootmount if [ ! -x ${rootmnt}${init} ]; then panic No init found. Try passing init= bootarg. fi Cheers, Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? signature.asc Description: OpenPGP digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
* Michael Biebl bi...@debian.org [Fri Jul 30, 2010 at 03:53:03AM +0200]: On 29.07.2010 03:01, Michael Prokop wrote: * Michael Biebl bi...@debian.org [Thu Jul 29, 2010 at 02:16:32AM +0200]: Why is it installing itself to /bin/systemd? Is it supposed to be executed by non-root users as well? Indeed. The idea is, that systemd is also started by regular users and helps track their user session (replacement/extension for e.g. gnome-session) Ok. So I moved /sbin/init from upstart to /sbin/upstart and made /sbin/init a symlink so I could easily test both systems. Using a relative symlink for /sbin/upstart does work, but an absolute symlink /sbin/init - /bin/systemd does not. So I'm reopening the bug report and retitling appropriately. If systemd really uses /bin for a reason we could use something like the following in initramfs-tools' init: # Check init bootarg if [ -n ${init} ] ; then # Work around absolute symlinks initsymlinktarget=${init} if [ -d ${rootmnt} ] [ -h ${rootmnt}${init} ] ; then case $(readlink ${rootmnt}${init}) in /*) initsymlinktarget=$(chroot ${rootmnt} readlink ${init}) ;; esac fi if [ ! -x ${rootmnt}${init} ] || [ ! -x ${rootmnt}${initsymlinktarget} ] ; then echo Target filesystem doesn't have ${init}. init= fi fi Does not work. For one, I guess this check if [ ! -x ${rootmnt}${init} ] || [ ! -x ${rootmnt}${initsymlinktarget} ] ; should be using . Even after fixing that, we run into the same problem, later again, at: # No init on rootmount if [ ! -x ${rootmnt}${init} ]; then panic No init found. Try passing init= bootarg. fi You have to drop the old No init on rootmount stuff of course, so just replace the No init on rootmount part with above code. regards, -mika- signature.asc Description: Digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
On 30.07.2010 03:57, Michael Prokop wrote: * Michael Biebl bi...@debian.org [Fri Jul 30, 2010 at 03:53:03AM +0200]: On 29.07.2010 03:01, Michael Prokop wrote: * Michael Biebl bi...@debian.org [Thu Jul 29, 2010 at 02:16:32AM +0200]: Why is it installing itself to /bin/systemd? Is it supposed to be executed by non-root users as well? Indeed. The idea is, that systemd is also started by regular users and helps track their user session (replacement/extension for e.g. gnome-session) Ok. So I moved /sbin/init from upstart to /sbin/upstart and made /sbin/init a symlink so I could easily test both systems. Using a relative symlink for /sbin/upstart does work, but an absolute symlink /sbin/init - /bin/systemd does not. So I'm reopening the bug report and retitling appropriately. If systemd really uses /bin for a reason we could use something like the following in initramfs-tools' init: # Check init bootarg if [ -n ${init} ] ; then # Work around absolute symlinks initsymlinktarget=${init} if [ -d ${rootmnt} ] [ -h ${rootmnt}${init} ] ; then case $(readlink ${rootmnt}${init}) in /*) initsymlinktarget=$(chroot ${rootmnt} readlink ${init}) ;; esac fi if [ ! -x ${rootmnt}${init} ] || [ ! -x ${rootmnt}${initsymlinktarget} ] ; then echo Target filesystem doesn't have ${init}. init= fi fi Does not work. For one, I guess this check if [ ! -x ${rootmnt}${init} ] || [ ! -x ${rootmnt}${initsymlinktarget} ] ; should be using . Even after fixing that, we run into the same problem, later again, at: # No init on rootmount if [ ! -x ${rootmnt}${init} ]; then panic No init found. Try passing init= bootarg. fi You have to drop the old No init on rootmount stuff of course, so just replace the No init on rootmount part with above code. I think this check is required if # Search for valid init does not find a valid init? Besides, I noticed that if no valid init is found, I get a kernel panic, but I assume I should get a rescue shell. I also noticed, that initsymlinktarget is set (ie. we run and expensive chroot call), even if I pass init=/bin/systemd on the kernel command line. Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? signature.asc Description: OpenPGP digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
On 30.07.2010 04:15, Michael Biebl wrote: Besides, I noticed that if no valid init is found, I get a kernel panic, but I assume I should get a rescue shell. I guess this might be due to the following: # Search for valid init if [ -z ${init} ] ; then for init in /sbin/init /etc/init /bin/init /bin/sh; do if [ ! -x ${rootmnt}${init} ]; then continue fi break done fi Upstart stores its configuration files in /etc/init/. This means, the loop above exits at /etc/init, and the init variable is set to the /etc/init directory. Is there a good resp. historical reason to search for init in /etc (or /bin ftm)? -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? signature.asc Description: OpenPGP digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
* Michael Biebl bi...@debian.org [Fri Jul 30, 2010 at 04:26:16AM +0200]: On 30.07.2010 04:15, Michael Biebl wrote: Besides, I noticed that if no valid init is found, I get a kernel panic, but I assume I should get a rescue shell. I guess this might be due to the following: # Search for valid init if [ -z ${init} ] ; then for init in /sbin/init /etc/init /bin/init /bin/sh; do if [ ! -x ${rootmnt}${init} ]; then continue fi break done fi Upstart stores its configuration files in /etc/init/. D'oh. This means, the loop above exits at /etc/init, and the init variable is set to the /etc/init directory. Is there a good resp. historical reason to search for init in /etc (or /bin ftm)? The kernel uses /sbin/init, /etc/init, /bin/init and /bin/sh for its run_init_process(). regards, -mika- signature.asc Description: Digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
* Michael Biebl bi...@debian.org [Fri Jul 30, 2010 at 04:15:44AM +0200]: On 30.07.2010 03:57, Michael Prokop wrote: Does not work. For one, I guess this check if [ ! -x ${rootmnt}${init} ] || [ ! -x ${rootmnt}${initsymlinktarget} ] ; should be using . Even after fixing that, we run into the same problem, later again, at: # No init on rootmount if [ ! -x ${rootmnt}${init} ]; then panic No init found. Try passing init= bootarg. fi You have to drop the old No init on rootmount stuff of course, so just replace the No init on rootmount part with above code. [...] I also noticed, that initsymlinktarget is set (ie. we run and expensive chroot call), even if I pass init=/bin/systemd on the kernel command line. No, initsymlinktarget is set to $init, but evaluated only if ${rootmnt}${init} is a symlink. Can you please give the following snapshot version a try: http://people.debian.org/~mika/initramfs-tools/initramfs-tools_0.97.3~1.gbp8d572e_all.deb (sha1sum and gpg-signed sha1sum in the same directory) and report back whether this works for all the situations you expect to work? regards, -mika- signature.asc Description: Digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
Package: initramfs-tools Version: 0.97.2 Severity: normal Hi, for testing purposes, I installed the upstart binary as /sbin/upstart and created a symlink /sbin/init → /sbin/upstart This causes a boot failure, due to this check in /usr/share/initramfs- tools/init # Check init bootarg if [ -n ${init} ] [ ! -x ${rootmnt}${init} ]; then echo Target filesystem doesn't have ${init}. init= fi To quote Mithrandir (from irc): Mithrandir -x follows symlinks Mithrandir but that means it'll look for symlinks in the initramfs, so the check is buggy. -- Package-specific info: -- initramfs sizes -rw-r--r-- 1 root root 6.2M Jul 25 00:10 /boot/initrd.img-2.6.32-5-686 -- /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-2.6.32-5-686 root=UUID=9a6d2bd2-58d1-4a75-baff-166b8637e3cc ro init=/bin/systemd systemd.log_target=kmsg systemd.crash_shell=1 systemd.crash_chvt=1 systemd.log_level=info quiet -- resume RESUME=LABEL=Swap -- /proc/filesystems ext4 fuseblk -- lsmod Module Size Used by michael_mic 1506 4 arc4 974 2 ecb 1405 2 lib80211_crypt_tkip 6709 1 aes_i5866816 1 aes_generic25738 1 aes_i586 lib80211_crypt_ccmp 3643 1 sco 5857 2 acpi_cpufreq4943 0 bridge 32987 0 stp 996 1 bridge bnep7444 2 cpufreq_userspace 1480 0 rfcomm 25167 8 l2cap 21705 16 bnep,rfcomm cpufreq_stats 1940 0 cpufreq_powersave602 0 cpufreq_conservative 4018 0 ppdev 4058 0 lp 5570 0 vboxnetadp 5118 0 vboxnetflt 12555 0 vboxdrv 126550 2 vboxnetadp,vboxnetflt fuse 43758 3 binfmt_misc 4907 1 dm_crypt9127 0 dm_mod 46082 1 dm_crypt joydev 6771 0 snd_intel8x0m 8100 0 pcmcia 17442 0 snd_intel8x0 19523 1 snd_ac97_codec 79148 2 snd_intel8x0m,snd_intel8x0 ac97_bus 710 1 snd_ac97_codec snd_pcm_oss28671 0 snd_mixer_oss 10461 1 snd_pcm_oss btusb 7997 2 snd_pcm47214 4 snd_intel8x0m,snd_intel8x0,snd_ac97_codec,snd_pcm_oss snd_seq_midi3576 0 bluetooth 36327 9 sco,bnep,rfcomm,l2cap,btusb rfkill 10264 3 bluetooth snd_rawmidi12505 1 snd_seq_midi sg 15968 0 snd_seq_midi_event 3684 1 snd_seq_midi snd_seq35463 2 snd_seq_midi,snd_seq_midi_event smsc_ircc2 8891 0 firewire_ohci 16509 0 8139too14949 0 ipw2200 108368 0 yenta_socket 16403 1 irda 75920 1 smsc_ircc2 parport_pc 15799 1 sr_mod 10770 0 firewire_core 31187 1 firewire_ohci 8139cp 13421 0 libipw 18439 1 ipw2200 rsrc_nonstatic 7057 1 yenta_socket snd_timer 12258 2 snd_pcm,snd_seq snd_seq_device 3673 3 snd_seq_midi,snd_rawmidi,snd_seq pcmcia_core20450 3 pcmcia,yenta_socket,rsrc_nonstatic lib802112870 4 lib80211_crypt_tkip,lib80211_crypt_ccmp,ipw2200,libipw snd34363 12 snd_intel8x0m,snd_intel8x0,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device mii 2714 2 8139too,8139cp crc_itu_t 1035 1 firewire_core uhci_hcd 16057 0 cdrom 26487 1 sr_mod container 1833 0 wbsd8650 0 crc_ccitt 1039 1 irda parport22554 3 ppdev,lp,parport_pc ac 1640 0 battery 3782 0 mmc_core 38503 1 wbsd soundcore 3450 1 snd processor 26599 2 acpi_cpufreq pcspkr 1207 0 serio_raw 2916 0 psmouse44657 0 evdev 5609 16 snd_page_alloc 5045 3 snd_intel8x0m,snd_intel8x0,snd_pcm i2c_i8016462 0 shpchp 21220 0 rng_core2178 0 ehci_hcd 27851 0 pci_hotplug18065 1 shpchp usbcore98402 4 btusb,uhci_hcd,ehci_hcd nls_base4541 1 usbcore autofs416667 6 ext4 254973 2 mbcache 3762 1 ext4 jbd2 56091 1 ext4 crc16 1027 2 l2cap,ext4 radeon509090 2 sd_mod 25869 5 crc_t10dif 1012 1 sd_mod ttm33378 1 radeon ata_generic 2019 0 drm_kms_helper 18305 1 radeon ata_piix 17640 4
Bug#590744: Fails to boot if /sbin/init is a symlink
* Michael Biebl bi...@debian.org [Thu Jul 29, 2010 at 01:13:01AM +0200]: for testing purposes, I installed the upstart binary as /sbin/upstart and created a symlink /sbin/init → /sbin/upstart This causes a boot failure, due to this check in /usr/share/initramfs- tools/init # Check init bootarg if [ -n ${init} ] [ ! -x ${rootmnt}${init} ]; then echo Target filesystem doesn't have ${init}. init= fi To quote Mithrandir (from irc): Mithrandir -x follows symlinks Mithrandir but that means it'll look for symlinks in the initramfs, so the check is buggy. You shouldn't use an absolut symlink here, use a relative one instead. See Debian policy 10.5 for details. Closing this bugreport as i-t works as intended. regards, -mika- signature.asc Description: Digital signature
Bug#590744: Fails to boot if /sbin/init is a symlink
reopen 590744 retitle 590744 Fails to boot if /sbin/init is a non-relative symlink thanks On 29.07.2010 01:37, Michael Prokop wrote: * Michael Biebl bi...@debian.org [Thu Jul 29, 2010 at 01:13:01AM +0200]: for testing purposes, I installed the upstart binary as /sbin/upstart and created a symlink /sbin/init → /sbin/upstart This causes a boot failure, due to this check in /usr/share/initramfs- tools/init # Check init bootarg if [ -n ${init} ] [ ! -x ${rootmnt}${init} ]; then echo Target filesystem doesn't have ${init}. init= fi To quote Mithrandir (from irc): Mithrandir -x follows symlinks Mithrandir but that means it'll look for symlinks in the initramfs, so the check is buggy. You shouldn't use an absolut symlink here, use a relative one instead. See Debian policy 10.5 for details. Well, changing it to /sbin/init - upstart did indeed work for this particular case. But I still get the problem when the link is absolute, as is specified by the policy for symlinks not in the same directory. To be a bit more specific what I was doing: I tested the new systemd init system, which installs the binary in /bin/systemd (note the /bin). So I moved /sbin/init from upstart to /sbin/upstart and made /sbin/init a symlink so I could easily test both systems. Using a relative symlink for /sbin/upstart does work, but an absolute symlink /sbin/init - /bin/systemd does not. So I'm reopening the bug report and retitling appropriately. Cheers, Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? signature.asc Description: OpenPGP digital signature
Processed: Re: Bug#590744: Fails to boot if /sbin/init is a symlink
Processing commands for cont...@bugs.debian.org: reopen 590744 Bug #590744 {Done: Michael Prokop m...@debian.org} [initramfs-tools] Fails to boot if /sbin/init is a symlink retitle 590744 Fails to boot if /sbin/init is a non-relative symlink Bug #590744 [initramfs-tools] Fails to boot if /sbin/init is a symlink Changed Bug title to 'Fails to boot if /sbin/init is a non-relative symlink' from 'Fails to boot if /sbin/init is a symlink' thanks Stopping processing here. Please contact me if you need assistance. -- 590744: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590744 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/handler.s.c.12803626079923.transcr...@bugs.debian.org
Bug#590744: Fails to boot if /sbin/init is a symlink
* Michael Biebl bi...@debian.org [Thu Jul 29, 2010 at 02:16:32AM +0200]: On 29.07.2010 01:37, Michael Prokop wrote: * Michael Biebl bi...@debian.org [Thu Jul 29, 2010 at 01:13:01AM +0200]: for testing purposes, I installed the upstart binary as /sbin/upstart and created a symlink /sbin/init → /sbin/upstart This causes a boot failure, due to this check in /usr/share/initramfs- tools/init # Check init bootarg if [ -n ${init} ] [ ! -x ${rootmnt}${init} ]; then echo Target filesystem doesn't have ${init}. init= fi To quote Mithrandir (from irc): Mithrandir -x follows symlinks Mithrandir but that means it'll look for symlinks in the initramfs, so the check is buggy. You shouldn't use an absolut symlink here, use a relative one instead. See Debian policy 10.5 for details. Well, changing it to /sbin/init - upstart did indeed work for this particular case. But I still get the problem when the link is absolute, as is specified by the policy for symlinks not in the same directory. To be a bit more specific what I was doing: I tested the new systemd init system, which installs the binary in /bin/systemd (note the /bin). This isn't an existing + available Debian package yet, right? Why is it installing itself to /bin/systemd? Is it supposed to be executed by non-root users as well? So I moved /sbin/init from upstart to /sbin/upstart and made /sbin/init a symlink so I could easily test both systems. Using a relative symlink for /sbin/upstart does work, but an absolute symlink /sbin/init - /bin/systemd does not. So I'm reopening the bug report and retitling appropriately. If systemd really uses /bin for a reason we could use something like the following in initramfs-tools' init: # Check init bootarg if [ -n ${init} ] ; then # Work around absolute symlinks initsymlinktarget=${init} if [ -d ${rootmnt} ] [ -h ${rootmnt}${init} ] ; then case $(readlink ${rootmnt}${init}) in /*) initsymlinktarget=$(chroot ${rootmnt} readlink ${init}) ;; esac fi if [ ! -x ${rootmnt}${init} ] || [ ! -x ${rootmnt}${initsymlinktarget} ] ; then echo Target filesystem doesn't have ${init}. init= fi fi Can you please give that a try? regards, -mika- signature.asc Description: Digital signature