From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: update-alternatives broken badly (by me :()
Date: Tue, 12 Jan 2010 23:21:21 +0100 [thread overview]
Message-ID: <20100112222121.GD10781@jama> (raw)
In-Reply-To: <20100108132344.GB2156@jama>
Hi,
Still no review/ACK :(.
I'll try to explain it better to show how bad it can be and even make
review easier.
We have target where sysvinit as init is crucial for successful boot (ie
SHR on freerunner) and u-a-cworth is installed on image, because
task-boot RDEPENDs on update-alternatives.
Let's start with image built after 2009-12-08.
u-a-opkg is used for in do_rootfs, but u-a-cworth is installed in image
too and is used by default.
T1) after flashing
ipkg/alternatives/init opkg/alternatives/init
doesnt-exist /sbin/init
/sbin/init.sysvinit 60
../bin/busybox 50
=>sysvinit is used, everything is fine
good scenario:
T2a) sysvinit is upgraded first
ipkg/alternatives/init opkg/alternatives/init
/sbin/init /sbin/init
/sbin/init.sysvinit 60 /sbin/init.sysvinit 60
../bin/busybox 50
=>sysvinit is used, everything is fine
- newer file works but is incomplete
T3a) busybox is upgraded
ipkg/alternatives/init opkg/alternatives/init
/sbin/init /sbin/init
/sbin/init.sysvinit 60 /sbin/init.sysvinit 60
../bin/busybox 50 ../bin/busybox 50
=>sysvinit is used, everything is fine
- newer file works and is the same as opkg
bad scenario
T2b) busybox is upgrade first
ipkg/alternatives/init opkg/alternatives/init
/sbin/init /sbin/init
../bin/busybox 50 /sbin/init.sysvinit 60
../bin/busybox 50
=>busybox is used, device won't boot anymore
- newer file is from cworth but is worse
T3b) sysvinit is upgraded
ipkg/alternatives/init opkg/alternatives/init
/sbin/init /sbin/init
/sbin/init.sysvinit 60 /sbin/init.sysvinit 60
../bin/busybox 50 ../bin/busybox 50
=>sysvinit is used again, everything is fine
- newer file works and is the same again
If we merge ipkg/alternatives and opkg/alternatives before T2b) there
will be no problem.
If we merge it after T2b) and then force busybox upgrade then we will
fix broken image too (as busybox is using probably the most u-a links
and has lowest priority). So busybox PR bump is good idea AFTER merging
u-a alternatives.
Worst scenario (where merger fails):
Tfsck) After T3a) or T3b) user intentionally remove sysvint package
(ie because he can boot even with busybox)
ipkg/alternatives/init opkg/alternatives/init
/sbin/init /sbin/init
../bin/busybox 50 /sbin/init.sysvinit 60
../bin/busybox 50
=>busybox is used, user is happy
then we run merge script (longer alternative file wins
=>sysvinit is used again, but without actuall /sbin/init.sysvinit file
in fs.. boot fails, user is sad. I think there is no way to distinguish
between T2b where newer shorter file is wrong and Tfsck where newer
shorter file is the right one (without checking opkg history..)
With images built before 2009-12-08 it should be simple
opkg/alternatives should be empty, all files from ipkg/alternatives are
just moved there..
Why would I like to add the same merge script to opkg?
1) someone maybe already removed -cworth from image with first sign of
issues (but still too late) and -cworth postinst is still needed
2) task-boot will be fixed (RDEPEND on same u-a as
virtual/update-alternatives-native) and user won't get -cworth update.
3) If I get new -cworth and busybox in one opkg upgrade batch, then I'm
not sure which postinst will be executed first (we need -cworth first),
but opkg maybe run own postinst before configuring other packages (ie
portage does that completely even with restart of upgrade process)
Updated -cworth is already used in SHR (from shr/merge branch).
My shell foo is maybe not strong enough to check that everything is available
in all environments and no bashisms were used..)
Thanks and please comment (I'll resend whole patch serie as soon as
someone confirms that's good path to go).
Regards,
--
uin:136542059 jid:Martin.Jansa@gmail.com
Jansa Martin sip:jamasip@voip.wengo.fr
JaMa
next prev parent reply other threads:[~2010-01-12 22:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-08 13:23 update-alternatives broken badly (by me :() Martin Jansa
2010-01-08 13:53 ` [PATCH] task-boot: use DISTRO_UPDATE_ALTERNATIVES instead of update-alternatives directly Martin Jansa
2010-01-08 14:02 ` update-alternatives broken badly (by me :() Holger Hans Peter Freyther
2010-01-08 14:07 ` Koen Kooi
2010-01-08 14:24 ` Martin Jansa
2010-01-08 14:05 ` Koen Kooi
2010-01-08 14:35 ` Martin Jansa
2010-01-08 15:47 ` [PATCH] update-alternatives-cworth: use /usr/lib/opkg/alternatives directory instead of /usr/lib/ipkg/alternatives Martin Jansa
2010-01-08 15:55 ` update-alternatives broken badly (by me :() Martin Jansa
2010-01-08 15:42 ` [PATCH] update-alternatives-cworth: use /usr/lib/opkg/alternatives directory instead of /usr/lib/ipkg/alternatives Martin Jansa
2010-01-08 18:32 ` Martin Jansa
2010-01-09 18:04 ` Martin Jansa
2010-01-12 22:21 ` Martin Jansa [this message]
2010-01-13 0:17 ` [PATCH 1/3] opkg, " Martin Jansa
2010-01-13 0:17 ` [PATCH 2/3] task-boot: use DISTRO_UPDATE_ALTERNATIVES instead of update-alternatives directly Martin Jansa
2010-01-13 0:17 ` [PATCH 3/3] busybox: bump INC_PR to force postinst script run on targets after u-a fixup Martin Jansa
2010-01-13 9:18 ` [PATCH 1/3] opkg, update-alternatives-cworth: use /usr/lib/opkg/alternatives directory instead of /usr/lib/ipkg/alternatives Paul Menzel
2010-01-13 9:28 ` Martin Jansa
2010-01-13 8:29 ` update-alternatives broken badly (by me :() Koen Kooi
2010-01-13 14:44 ` Martin Jansa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100112222121.GD10781@jama \
--to=martin.jansa@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.