Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 31BB078124B for <~alpine/users@lists.alpinelinux.org>; Wed, 4 May 2022 18:45:22 +0000 (UTC) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-edf9ddb312so1152758fac.8 for <~alpine/users@lists.alpinelinux.org>; Wed, 04 May 2022 11:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=a4jJCDQtqJm/cqaiSNZdw09LkNAPWwl8854ScKLdl10=; b=hGVpDKkwfVRlYQZg2ocKEUCr2oafPVKSsSCkmeXxcQPKhvanXqM2n+ORoOGFXoEBK3 bYegjfu4NUFkK7Mju8dzlmbWWsSqCL0hXo6vN+eT00QY9wSefZWbW5eSAm5qVoEgpcmd 2aDGv2P/6it+BesbodnEVSKnox4Gyh5xKR0BSAZ8Az+1Zqy6AsxPqI2x7Bx2QZD7JEoM IkV5ET9hVSBoWIyWcdp+evtmfM/5k8yWiOWu7m7ERYgc4ASjCKsqF725nSoYYau4eCJy qJOyL3rMsqlVU+ntEqOnQhqz3IcRqHmeVYpLTD8MPEYkRwC60sTERRW3KmeGSa1qY327 39sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=a4jJCDQtqJm/cqaiSNZdw09LkNAPWwl8854ScKLdl10=; b=uTSJ/rsTavkFbE9eMjwgUUbMfJ2LdxwLnlkob3UNTQaDR+BAdbP5RleemhyovPOJlQ aK0ynX6tbOTemFwdzInn5kFkT1Fstw5uRfd7TDjW19GYWCUNzut9xVkfpbmkeHxdO0m2 jjIy2cI1M+duCoicyxJUR4V7ikvqeMfMHhS9ftJXGy0ZLxWWkThM9WE8pGgCICZmVpIN 4s2wHzlM35YIFrKXLpnpxwl1owqfmv5LBTeYentscYahrWPxOEb+BjiHphjGKlKVfSZn 7iWWJ0mT53qSEnNc0JTH1utQY+pjd+alPNJlrxpGx85B8QYxc3pnhlrgYrcvwIjO+it0 ay3w== X-Gm-Message-State: AOAM530Ot9JSb1AUFh9TpyYQuxofTAEDoEuW7rHF7GCJX38iLnXq4ZEW eTrL7FCtCTA6WK7KyztEqGj93eAOdrfcyE9zyEQ= X-Google-Smtp-Source: ABdhPJy/Fk9vK1jI50AVk8+yJL6LU3I8B24zOAK6X3NXWCJaAgxbqxH5RLsi0tr1G1/ep35l3GyO905Ml+/nQCKUQDE= X-Received: by 2002:a05:6870:15c9:b0:e9:894d:e582 with SMTP id k9-20020a05687015c900b000e9894de582mr491703oad.194.1651689917269; Wed, 04 May 2022 11:45:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Konstantin Kulikov Date: Wed, 4 May 2022 21:45:06 +0300 Message-ID: Subject: Re: Custom Alpine Linux build To: Hokus Pokus Cc: ~alpine/users@lists.alpinelinux.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable You've basically described initramfs. Take a look at mkinitfs, which is what alpine uses. https://git.alpinelinux.org/mkinitfs/tree On Wed, May 4, 2022 at 6:12 PM Hokus Pokus wrote= : > > Hi all, > > I have a question related to custom OS based on Alpine Linux. > > First let me describe the current state: > Hardware environment: > - Dell server (PowerEdge R630) > - 4 PCI Ethernet cards (QLogic 577xx/578xx 10Gb Ethernet BCM57800) > - 16G RAM > - 120G SSD > ISO image I use: alpine-extended-3.15.4-x86_64.iso > Everything is working fine, I am able to configure network cards, > communicate with the world, update system etc. > Those PCI network cards uses bnx2x modules and closed source > firmware blobs from /lib/firmware (bnx2x package) if I am correct. > It is working fine so far. > > Now the target: I want to make this install even smaller. > The purpose of this new OS will be to: > 1) Boot from hard drive > 2) Load this new minimal "alpine based OS" rootfs > with only needed set of binaries / libraries > 3) Replace the whole init and /etc/init.d with single script > which become new init process > 4) This script-init will initialize all the hardware > 5) This script-init will download encrypted disk image > 6) This script-init will unpack encrypted disk image > 7) This script-init will mount encrypted disk image > 8) This script-init will chroot to encrypted disk image > and continue there after pivot will be completed. > > So the new Alpine based OS I want to make will be sort of > bootstrap for another OS (linux) and as such needs only > minimum set of functions. I plan to remove all binaries and libraries > which are not needed as only purpose of this OS will be > to start hardware, get network working and download file > from remote server. From the same reason I would like to replace > the whole init and init.d scripts with single init.sh script called > by kernel after boot. > > If someone has done something similar already and can point me which > part of the Alpine system are core for the system functionality? > > Alpine is using mdev for device management. What else I need to have > for binary blobs drivers working with linux kernel? Just /etc/mdev.conf i= n place > and call "mdev -s" in the init script? Or there is more complicated > hardware initialization procedure which I need to reproduce in my "init.s= h" > script? Should I just copy-paste some of /etc/init.d scripts and put > them in one file in the right order? > > If I can go even further - replace the kernel with it modules by the mono= lithic > kernel which has all needed modules compiled inside? This way if I will s= till > need mdev for loading external firmware blobs? > > I was trying to find similar question on mailing lists and general forums > but I failed. > > Best regards, > Pawel > > -- > Pozdrawiam > > Pawe=C5=82 Po=C5=82awski