For discussion of Alpine Linux development and developer support

6 4

[alpine-devel] RFC: Introducing tools-base meta package

Przemysław Pawełczyk
Details
Message ID
<161894efe87.111ebc5a251296.390323127337732549@zoho.com>
Sender timestamp
1518427172
DKIM signature
missing
Download raw message
Hi, Alpiners!

What would you say about introducing new meta packages:

- tools-base - depending on busybox for now,
- tools-base-initscripts - depending on busybox-initscripts for now?

After introducing they could replace busybox and busybox-initscripts as
dependencies of alpine-base.

(Maybe provides="/bin/sh" should be moved from busybox to tools-base
then, not sure yet.)

It will greatly ease possible future changes like replacing busybox or
parts of it, even if such changes won't be happening soon, i.e. before
releasing Alpine Linux 3.8.

---

Mind that this RFC is not about replacing busybox, but about introducing
changes that would make such endeavour more pain-free if ever happening.
But let me very briefly go into that territory too.

Why replace busybox?
To have better implementation of widely used tools, of course.

Any candidates?
2 examples come to my mind right now.

- toybox

It "combines common Linux command line utilities together into a single
BSD-licensed executable that's simple, small, fast, reasonably
standards-compliant".

It's not as complete as busybox, so no drop-in replacement yet,
but it has many toys already available:
http://landley.net/toybox/status.html

Replacing busybox partially would require reorganizing its package,
and most likely switching from trigger-based symlinks to explicit ones
provided by some subpackages.

- mawk

It's "an interpreter for the AWK Programming Language".
It will possibly allow to make some packages depend on it instead of
gawk.

I believe A. Wilcox can share details why it's better than busybox's
awk, after dealing with it in Adelie Linux.

Regards,
Przemek



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
A. Wilcox
Details
Message ID
<8a3bd96e-19cf-fc6d-0db5-f0cc3bd3efa4@adelielinux.org>
In-Reply-To
<161894efe87.111ebc5a251296.390323127337732549@zoho.com> (view parent)
Sender timestamp
1518455988
DKIM signature
missing
Download raw message
On 02/12/18 03:19, Przemysław Pawełczyk wrote:
> Hi, Alpiners!
> 
> What would you say about introducing new meta packages:
> 
> - tools-base - depending on busybox for now,
> - tools-base-initscripts - depending on busybox-initscripts for now?
> 
> After introducing they could replace busybox and busybox-initscripts as
> dependencies of alpine-base.
> 
> (Maybe provides="/bin/sh" should be moved from busybox to tools-base
> then, not sure yet.)


/bin/sh should be provided by a splitpackage of busybox (like
busybox-sh).  This way it can be changed without changing the tools
themselves.

This is what we do in Adélie; we have bash-binsh, busybox-binsh,
dash-binsh, zsh-binsh.  (The latter two are not recommended but there
for the people who want to experiment.)

I do like the idea of making base tools a virtual.  It would certainly
make my job easier!  :)


> - mawk
> 
> It's "an interpreter for the AWK Programming Language".
> It will possibly allow to make some packages depend on it instead of
> gawk.
> 
> I believe A. Wilcox can share details why it's better than busybox's
> awk, after dealing with it in Adelie Linux.


mawk has wider compatibility for some awk constructs than BusyBox awk.
I am unfortunately not sure exactly which constructs BB doesn't have as
I've never looked at the source, and my notes about that are long gone.

I can say that Adélie doesn't even *ship* gawk.  We replaced all
references to gawk with mawk locally with no ill effects.  Note we don't
ship the entire main and community repos so I am not advocating gawk's
removal in Alpine.  I am however advocating replacing it with mawk
wherever it makes sense.

Alpine edge gawk-4.2.0-r0 installed size:
847872

Adélie alpha4 mawk-20161120-r1 installed size:
172032


All the best,
--arw

-- 
A. Wilcox (awilfox)
Project Lead, Adélie Linux
http://adelielinux.org
A. Wilcox
Details
Message ID
<48fe062b-b119-55f8-1c4a-8a706ea126dc@adelielinux.org>
In-Reply-To
<20180212132622.KfZQz%ca6c@bitmessage.ch> (view parent)
Sender timestamp
1518456502
DKIM signature
missing
Download raw message
On 02/12/18 07:26, Cág wrote:
> I threw away busybox and other "core/base" packages (they are, as a
> matter of fact, present because of dependencies but are dummy and
> contain nothing) and replaced them with:
> 
> sbase    - portable Unix utilities (cat, du, ls etc.);

I am vaguely interested in this.  Does it implement POSIX options?

> ubase    - unportable Linux utilities (mount, ps, dd etc.);
> sinit    - a simple init;

Does this integrate with other service managers (like OpenRC, s6) or
does it only work with svc?  Do you have a link?

> svc      - service management (init scripts were brought from stali and
> 	Morpheus);
> vis      - a text editor (sbase has a very ed implementation);
> mksh     - a shell;

I probably would have gone with dash or pksh, but mksh isn't terrible.
Its ideas of built-ins is definitely unique.  I use this on my 486.

> nawk     - the One True Awk;
> pigz     - for gzip
> iproute2 - for various net utilities;
> sdhcp    - a small DHCP client;

Haven't heard of this one, is it from the same people as sbase?

> curses   - NetBSD curses.

Have you looked in to pdcurses?  How does it compare?

> What's missing (stty, patch, diff etc.) can be pulled from BSDs or
> Heirloom.

Adélie ships heirloom-devtools if you want Real Unix make, m4, lex,
yacc, etc in APK format :)


Best,
--arw

-- 
A. Wilcox (awilfox)
Project Lead, Adélie Linux
http://adelielinux.org
Cág
Details
Message ID
<20180212132622.KfZQz%ca6c@bitmessage.ch>
In-Reply-To
<161894efe87.111ebc5a251296.390323127337732549@zoho.com> (view parent)
Sender timestamp
1518441982
DKIM signature
missing
Download raw message
Przemysław Pawełczyk wrote:

> Mind that this RFC is not about replacing busybox, but about introducing
> changes that would make such endeavour more pain-free if ever happening.
> But let me very briefly go into that territory too.
> Why replace busybox?
> To have better implementation of widely used tools, of course.
> Any candidates?

I threw away busybox and other "core/base" packages (they are, as a
matter of fact, present because of dependencies but are dummy and
contain nothing) and replaced them with:

sbase    - portable Unix utilities (cat, du, ls etc.);
ubase    - unportable Linux utilities (mount, ps, dd etc.);
sinit    - a simple init;
svc      - service management (init scripts were brought from stali and
	Morpheus);
vis      - a text editor (sbase has a very ed implementation);
mksh     - a shell;
nawk     - the One True Awk;
pigz     - for gzip
iproute2 - for various net utilities;
sdhcp    - a small DHCP client;
curses   - NetBSD curses.

What's missing (stty, patch, diff etc.) can be pulled from BSDs or
Heirloom.

With this on top of the "real" Alpine core (musl/apk-tools etc.) you
have a complete distribution.

Also, what can be statically linked should be statically linked.

Now, we need a decent file system layout, throw away all GNU
dependencies, link everything statically (, write our own kernel, reach
Mars before Elon Musk...)

--
caóc



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Laurent Bercot
Details
Message ID
<emd49558d5-77b7-41ff-82b1-3f499ef5ea0a@elzian>
In-Reply-To
<48fe062b-b119-55f8-1c4a-8a706ea126dc@adelielinux.org> (view parent)
Sender timestamp
1518458260
DKIM signature
missing
Download raw message
>>ubase    - unportable Linux utilities (mount, ps, dd etc.);
>>sinit    - a simple init;
>
>Does this integrate with other service managers (like OpenRC, s6) or
>does it only work with svc?  Do you have a link?

  Most of the relevant suckless stuff can be found at
https://core.suckless.org/ - and that includes sdhcp. I haven't tested
many of their programs, but I have looked at sbase+ubase, and
it's clean. Cleaner than busybox; I still need to compare it to
toybox.

  sinit just forks a one-time init script at boot time and then
enters its reaping loop. So it will integrate with any service
manager you want.
  However, it's not a correct init, because it doesn't supervise
anything, so kill -9 -1 will brick the machine. (This is the same
problem that dalias' init has.) For this reason, I do not recommend it.

--
  Laurent



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Steffen Nurpmeso
Details
Message ID
<20180212180208.zBbPR%steffen@sdaoden.eu>
In-Reply-To
<8a3bd96e-19cf-fc6d-0db5-f0cc3bd3efa4@adelielinux.org> (view parent)
Sender timestamp
1518458528
DKIM signature
missing
Download raw message
"A. Wilcox" <awilfox@adelielinux.org> wrote:
 |On 02/12/18 03:19, Przemysław Pawełczyk wrote:
 |> Hi, Alpiners!
 |> 
 |> What would you say about introducing new meta packages:
  ...
 |> - mawk
 |> 
 |> It's "an interpreter for the AWK Programming Language".
 |> It will possibly allow to make some packages depend on it instead of
 |> gawk.
 |> 
 |> I believe A. Wilcox can share details why it's better than busybox's
 |> awk, after dealing with it in Adelie Linux.
 |
 |
 |mawk has wider compatibility for some awk constructs than BusyBox awk.
 |I am unfortunately not sure exactly which constructs BB doesn't have as
 |I've never looked at the source, and my notes about that are long gone.
 |
 |I can say that Adélie doesn't even *ship* gawk.  We replaced all
 |references to gawk with mawk locally with no ill effects.  Note we don't
 |ship the entire main and community repos so I am not advocating gawk's
 |removal in Alpine.  I am however advocating replacing it with mawk
 |wherever it makes sense.

mawk does not support IGNORECASE=, whereas busybox awk (and gawk)
does.  Last month i tried to implement IGNORECASE= for mawk, but
whereas the normal regex case was somewhat easy, the homebrew
regex is too hard and i decided not to look deeper or even offer
Dickey an incomplete patch.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Cág
Details
Message ID
<20180214192359.kCeRF%ca6c@bitmessage.ch>
In-Reply-To
<48fe062b-b119-55f8-1c4a-8a706ea126dc@adelielinux.org> (view parent)
Sender timestamp
1518636239
DKIM signature
missing
Download raw message
A. Wilcox wrote:

>> sbase    - portable Unix utilities (cat, du, ls etc.);
> I am vaguely interested in this.  Does it implement POSIX options?

Mostly. See https://git.suckless.org/sbase/tree/README

>> sinit    - a simple init;
> Does this integrate with other service managers (like OpenRC, s6) or
> does it only work with svc?  Do you have a link?

I am sure it does. It's correct in the vision of the project.

"What PID 1 Should Do
When your system boots up the kernel is executing a given binary in
its known namespace. To see what are the only tasks the application
running as pid 1 has to do, see sinit
(https://git.suckless.org/sinit/). Just wait for child process to reap
and run some other init scripts."

>> nawk     - the One True Awk;
>> pigz     - for gzip
>> iproute2 - for various net utilities;
>> sdhcp    - a small DHCP client;
> Haven't heard of this one, is it from the same people as sbase?

nawk is bwk's awk, pigz is from zlib devs, iproute2 is everywhere these
days, sdhcp is a suckless project (https://git.2f30.org/sdhcp/).

>> curses   - NetBSD curses.
> Have you looked in to pdcurses?  How does it compare?

I am afraid I haven't. Both should be rather compared to ncurses.

>> What's missing (stty, patch, diff etc.) can be pulled from BSDs or
>> Heirloom.
> Adélie ships heirloom-devtools if you want Real Unix make, m4, lex,
> yacc, etc in APK format :)

That's cool :) pkgsrc ships all Heirloom utilities, I think Arch does
too.
 
Cheers

--
caóc



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---