Re: Busybox in Debian
- To: Ben Hutchings <ben@decadent.org.uk>
- Cc: Chris Boot <bootc@debian.org>, busybox <busybox@busybox.net>, Debian Install System Team <debian-boot@lists.debian.org>, Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
- Subject: Re: Busybox in Debian
- From: Denys Vlasenko <vda.linux@googlemail.com>
- Date: Sun, 14 Jan 2018 17:03:28 +0100
- Message-id: <[🔎] CAK1hOcMUMLuAUbRWKHAXFKL+ZpJcw2ufwCK_FeCBN1f5us8wVA@mail.gmail.com>
- In-reply-to: <1503448990.3688.57.camel@decadent.org.uk>
- References: <1a91f977-6d0f-5ad4-f026-fcfa854386bd@debian.org> <CAK1hOcOaF_P7wGoE-qijHymB_DCMtJjM5KVEmGKPbj_wwowPBQ@mail.gmail.com> <db152795-1058-ce5e-cc2b-d05c55e61d3c@debian.org> <1502547324.3944.2.camel@decadent.org.uk> <CAK1hOcMvhAZNzs_LzbBgdOKFupAKxvQJHGDGH-k0othXBbMojw@mail.gmail.com> <1502715907.3688.10.camel@decadent.org.uk> <CAK1hOcN5_jMLXw-CUzBgSS2is3AFSrTFiayrv675=GLnp795vA@mail.gmail.com> <CAK1hOcNzzcub+EMwSEjCT2vSa5Baeh07Sw+hdQL=_JBV_=Y40w@mail.gmail.com> <1502723574.3688.12.camel@decadent.org.uk> <CAK1hOcOsB_shcgvbVgJ1bBfa7wh8SajpuQ+sua4LUJjUiEGe3g@mail.gmail.com> <1503340694.3688.52.camel@decadent.org.uk> <CAK1hOcMeb24FMjfsqMx6UDKip6kAB7JZTG7HZFymt5LA41ib5w@mail.gmail.com> <1503448990.3688.57.camel@decadent.org.uk>
On Wed, Aug 23, 2017 at 2:43 AM, Ben Hutchings <ben@decadent.org.uk> wrote:
>> > > > On Mon, 2017-08-14 at 16:42 +0200, Denys Vlasenko wrote:
>> > > > > > > run-init
>> > > > >
>> > > > > This tool is doing this:
>> > > >
>> > > > [...]
>> > > > > There is the "switch_root" tool in util-linux which does the
>> > > > > crucial part of this functionality - deleting / remounting /
>> > > > > chrooting.
>> > > > > It is in bbox too.
>> > > >
>> > > > initramfs-tools used to use switch_root if possible, but it
>> > > > didn't
>> > > > support the -d (drop capabilities) option. Later on we needed
>> > > > validation of the init filename to support symlinks (e.g.
>> > > > /sbin/init ->
>> > > > /lib/systemd/systemd), so I added and used the -n (dry run)
>> > > > option to
>> > > > run-init. busybox would need to support both of these.
>> > >
>> > > I added run-init to busybox just now, but I don't see -n option
>> > > in
>> > > klibc-2.0.4 source. Can you point me to the source code with -n?
>> >
>> > It's not upstream yet, but in a Debian patch:
>> > https://sources.debian.net/src/klibc/2.0.4-9/debian/patches/run-ini
>> > t-add-dry-run-mode.patch/
>>
>> Done:
>>
>> $ ./busybox run-init
>> BusyBox v1.28.0.git (2017-08-21 18:55:09 CEST) multi-call binary.
>>
>> Usage: run-init [-d CAP,CAP...] [-n] [-c CONSOLE_DEV] NEW_ROOT
>> NEW_INIT [ARGS]
>>
>> Free initramfs and switch to another root fs:
>> chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /,
>> execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint.
>>
>> -c DEV Reopen stdio to DEV after switch
>> -d CAPS Drop capabilities
>> -n Dry run
>
> Great. Once these changes are in the Debian package, I can update
> initramfs-tools to make klibc-utils optional.
busybox 1.28.0 is released, it contains the addition of run-init.
Reply to: