Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2083757imm; Thu, 23 Aug 2018 13:55:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZd+KZaazamJ+bqvIyt0f15Eb00WdFXW36QLjmO4kcrn62gbzRRBX1v6Y37NJ3/z4AdHzjk X-Received: by 2002:a63:2363:: with SMTP id u35-v6mr4720304pgm.202.1535057728811; Thu, 23 Aug 2018 13:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535057728; cv=none; d=google.com; s=arc-20160816; b=qSwfygtJUXNAOA9GAicg/RZaJ3aEC0B+FmoqqrMcHdmC3bWP2KfcAIeCFHP/D1XbjZ KFDV+069vrO+2q9qroMKygSaviZHoK6Ef0FZYet3rLkMUDSXqUzVVUmM3QahfN3Vl/ST ccYN4rxZ5t6Aquhkl3WYrUvBErG9u2CNKxAB/mZW07wrwiHBaGb3xKDch23KVpBp2hbl 7EABRT0OdncxoGq9Uz8f06/6TKPyoQy8LyXVdRfUxhbmSZcNKCqdZFBKMIC347f6V9Xu aVaf/u/OVzsGC8ZyUiGgUJIN7Mw8XlXQtYo0JQftYrOtEK0ilm+/HSErPHk93nkZQvyi Xk/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=iZ/OZV012T/247ERqm2XUmoruH9V7Y8b5QqNrC57fco=; b=HoJT7GlthGGsOkSvGQHEnql2TEIbeAwlKrcHauCPeL+SIukDQmwbS0Les+Vkm6T3Ne o00sQpmKVoZDBnZP9eAK/W1taHEssAx6FknBX4cp15ULVUcoDyDCVGbI6YG3qF99jFVu WbZwhgqPtKEh7iZByTLlMqhAAwLtdBkmmpjwnwMCTEB6TT+jB6jIgCnr75Qgqj8cPZ01 ZQqBpEir+v0nYngRpp8TiyuH/mi9XveXzWMtSk2bggc6/HzzY1Mz86848XlxgvZCbNYE NfG93lvzawROJG/84G8nqhGsIw/nXFQSvbVu+7DZyFyI/sfO9ZxymwUDYL8D7/6bSA9C 2g/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn19si1646584plb.186.2018.08.23.13.55.13; Thu, 23 Aug 2018 13:55:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727580AbeHXAZT (ORCPT + 99 others); Thu, 23 Aug 2018 20:25:19 -0400 Received: from esgaroth.petrovitsch.at ([78.47.184.11]:1883 "EHLO esgaroth.tuxoid.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727134AbeHXAZS (ORCPT ); Thu, 23 Aug 2018 20:25:18 -0400 X-Greylist: delayed 3660 seconds by postgrey-1.27 at vger.kernel.org; Thu, 23 Aug 2018 20:25:18 EDT Received: from thorin.petrovitsch.priv.at (80-110-98-250.cgn.dynamic.surfer.at [80.110.98.250] (may be forged)) (authenticated bits=0) by esgaroth.tuxoid.at (8.15.2/8.15.2) with ESMTPSA id w7NJqZ5p029965 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Thu, 23 Aug 2018 21:52:36 +0200 Message-ID: Subject: Re: Kernel-only deployments? From: Bernd Petrovitsch To: paulmck@linux.vnet.ibm.com, nicolas.pitre@linaro.org, josh@joshtriplett.org Cc: linux-kernel@vger.kernel.org Date: Thu, 23 Aug 2018 21:52:17 +0200 In-Reply-To: <20180823174359.GA13033@linux.vnet.ibm.com> References: <20180823174359.GA13033@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-1.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-DCC-debian-Metrics: esgaroth.tuxoid.at 1169; Body=4 Fuz1=4 Fuz2=4 X-Virus-Scanned: clamav-milter 0.97 at esgaroth.tuxoid.at X-Virus-Status: Clean X-Spam-Status: No, score=-0.2 required=5.0 tests=AWL,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Report: * 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines * -0.2 AWL AWL: Adjusted score from AWL reputation of From: address X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on esgaroth.tuxoid.at Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all! On Thu, 2018-08-23 at 10:43 -0700, Paul E. McKenney wrote: > [...] > Does anyone do kernel-only deployments, for example, setting up an > embedded device having a Linux kernel and absolutely no userspace > whatsoever? [...] > You see, rcutorture runs entirely out of initrd, never mounting a real > root partition. The user has been required to supply the initrd, but IMHO running programs from the initrd is in user-space, but anyways: Ages ago at some former employer, we built an embedded Linux device on an MPC-860 board (but that shouldn't make a significant difference to other architectures) based on the (at that time) brand new 2.4 kernel which ran completely out of the initrd (which obviously contained the whole root filesystem). [...] > by throwing out everything not absolutely needed by the dash and sleep > binaries, which got me down to about 2.5MB, 1.8MB of which was libc. We had a working glibc binary (which as the largest binary on the filesystem) and just used it (and never got time and/or necessity to use something else like ulibc, newlibc or build glibc ourselves to leave all unneeded stuff out). We basically built the filesystem - the distribution as such;-) - from scratch (only self-crafted `configure` calls around[0]) and - thus - used busybox and ash (IIRC) - so throw dash, core-utils etc. away and just use busybox (or something similar) for further space savings. The whole startup and daemon management was done with busybox' "init" via a simple /etc/inittab (that were the good old times;-) and it was enough as one can start one-time programs at boot time (e.g. to load kernel modules (and remove the file in the filesystem from the filesystem[0]) or configure stuff via sysctl) and restart daemons. We didn't need run-levels ... > This situation of course prompted me to create an initrd containing > a statically linked binary named "init" and absolutely nothing else > (not even /dev or /tmp directories), which weighs in at not quite 800KB. That is probably the smallest solution - if it's enough. If it's all GPL, just link it statically against dietlibc .... We had all of the usual directories and a somewhat filled /dev (completely static in the initrd IIRC, no udev or similar dynamic stuff was needed) as we had dropbear as ssh-server, a small webserver+CGI- script for a web interface and a SNMP agent (hacked net-smtp as we had our own configuration daemon and needed SNMP only as a transport protocol). [...] MfG, Bernd [0]: Every byte counts and size does matter;-) -- Bernd Petrovitsch Email : bernd@petrovitsch.priv.at LUGA : http://www.luga.at