Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id F01AC782C0D for ; Fri, 24 Jul 2020 11:07:58 +0000 (UTC) Received: by mail-ej1-f42.google.com with SMTP id v18so1227556ejb.0 for ; Fri, 24 Jul 2020 04:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=T5wmuIoZ6u4Kpq7bQicyTpps3Go0OttG9qmCqX63Zog=; b=Sry44c25Qdx52pOHeN3U6UxC1H6yqoGnGfwjk5rsML2l25wr93S0OKD3RL2uON3u65 iObPOIGzfnTsJlw+lzR4ROHIZJhugtnxrcGSLplRjWZ472ZTRMFxFl8N9uXyh+rpLaA2 4u1FJiLnqRu4QobrkeEpaoTEGaDydA3U09ac/oIdu3ehJwI6spsIMFTVb7XvuCgr20Pi B5nuwaXvdBaBFltHWpqoaOiRPJUbhbXJqUugZHO2MHMnmtmWqz0yuSYYm21mcaqe6GFq asvl84Dnwcv5qsrrjagJrPerD4u/UDm20EQJuj/MlGPd9nl3RsxJyPnxAZtOXiTsCRO0 VkhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=T5wmuIoZ6u4Kpq7bQicyTpps3Go0OttG9qmCqX63Zog=; b=PCkxhNJiuhn4vVHatYRYWBwugsGLZAw+VILFBEUD0JGWd03h7uIO//2PQ3U58t2cUj XK3EJLR/K3tdQZqTewpr9ROCdND186PizbKaXC+QRyq5QD0H/kBgWMuJr3FVm9LnVkrw 7T2832MTQFiWEtsAd1zIfJfGfSTdCBvzWJA79PN8GHm2/LYzn1cOwV1NeuCJknyAMQfq K6VsSTUp4PgfPgVMuSq0ycrppSDiNlNlSyMAqA6f/B3FZQPuRlteV0PmkPNvd0aBz+pb 81Op15lfSikw3lCGWKUZur7BvjAtSPdvFN/i4Jztygqa85k1cIqTPyq9HyqR/t5NkIG/ A8BA== X-Gm-Message-State: AOAM532b5xbCwSeYnBXYesjS7EagwQe0Q24R97xczaKrkJX3qPtvbvUJ hW3zXjHY85rSTyqf6y8u4bLRg5awycNR/ouAmGU= X-Google-Smtp-Source: ABdhPJz2XaSy8/rcJ9Guaq3fTP1cCaPqgtbl95t/J9kQ0H7AT7v2IndiQkkRwb7k23tkhtnNShnwzAPa+rSnFFhih/c= X-Received: by 2002:a17:906:8608:: with SMTP id o8mr6863883ejx.156.1595588878116; Fri, 24 Jul 2020 04:07:58 -0700 (PDT) MIME-Version: 1.0 References: <8c8b1000-11f2-3f98-0037-6983f6d70b88@linux.ibm.com> In-Reply-To: <8c8b1000-11f2-3f98-0037-6983f6d70b88@linux.ibm.com> From: Vittorio Mori Date: Fri, 24 Jul 2020 13:07:46 +0200 Message-ID: Subject: Re: SAN boot/aoe support for init script (initramfs) To: Tuan Hoang , alpine-user@lists.alpinelinux.org Content-Type: multipart/alternative; boundary="00000000000049ad1805ab2dfc14" --00000000000049ad1805ab2dfc14 Content-Type: text/plain; charset="UTF-8" I actually hacked the init script by adding the following lines: echo "AOE root mount" ifconfig eth0 up sleep 5 modprobe aoe echo "AOE modprobed" sleep 2 /usr/sbin/aoe-discover echo "AOE discover" sleep 2 /usr/sbin/aoe-discover echo "AOE discover" sleep 1 Just before the mount ${rootfstype:+-t} ${rootfstype} \ -o ${KOPT_rootflags:-ro} \ ${KOPT_root#ZFS=} $sysroot stanza, leaving the init script basically untouched. I also added the aoe.ko modules, and the ethernet card modules in the initramfs-lts file. I tried it with two physical machines (an old Fujitsu Celsius W380, and a T1700 Dell Precision), and they boot flawlessly. All it's rather fast for being just an ancient gigabit ethernet card. It's a very very ugly hack: I need to rewrite it properly : i.e.: loop until the /dev/etherd devices are created, then boot - and some error checks of course. Will do it today, maybe. Il giorno ven 24 lug 2020 alle ore 12:46 Tuan Hoang ha scritto: > This sounds interesting. Guess I'd setup a VM acting as SAN and PXE > server to feed storage disks to other VM booting with AOE. > > Then I could have a look into patching initramfs. Sounds like a plan. > > On 7/23/20 8:51 AM, Vittorio Mori wrote: > > I am building a boot server with Alpine for my homeserver. > > > > I'd like to use aoe (ATA over ethernet) for my SAN, to boot the distro > > from the SAN directly, with iPXE. > > > > I managed to make it work by adding the necessary files into the initram > > (network modules, aoe modules, aoe utils), but the initramfs init script > > always ends up to the emergency shell (, and I have to mount sysroot by > > hand with three commands: > > > > ifconfig eth0 up > > /usr/sbin/aoe-discover > > mount /dev/ethernet/e0.0p3 /sysroot > > > > when I exit the emergency shell, the system boots regularly and > > everything is fine. > > > > I tried to modify the init script, but it looks fairly complex and hard > > to understand in some parts, and I can't make it work as expected. > > > > Can I get some hints on how to put those three commands into init ? > > > > Thanks. > > > --00000000000049ad1805ab2dfc14 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I actually hacked the in= it script by adding the following lines:

echo "AOE root mo= unt"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ifconfig eth0 up
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 sleep 5
=C2=A0 =C2=A0 =C2=A0 =C2=A0 m= odprobe aoe
=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "AOE modprobed&= quot;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 sleep 2
=C2=A0 =C2=A0= =C2=A0 =C2=A0 /usr/sbin/aoe-discover
=C2=A0 =C2=A0 =C2=A0 =C2=A0= echo "AOE discover"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 sleep = 2
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /usr/sbin/aoe-discover
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "AOE discover"
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 sleep 1

Just before the=C2=A0

=C2= =A0 =C2=A0mount ${rootfstype:+-t} ${rootfstype} \
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -o ${= KOPT_rootflags:-ro} \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${KOPT_root#ZFS=3D} $sysroot

=C2=A0stanza, leaving the init script basically untouched.<= br>
I also added the aoe.ko modules, and the ethernet card modules in th= e initramfs-lts=C2=A0 file.

I tried it with two physical machines (a= n old Fujitsu=C2=A0Celsius W380, and a T1700 Dell Precision), and they=C2= =A0boot=C2=A0flawlessly.
All it's rather fast for being just an anci= ent gigabit ethernet card.

It's a very very ugly hack= : I need to rewrite it properly : i.e.: loop until=C2=A0the /dev/etherd dev= ices are created,=C2=A0then boot - and some error checks of course.
=C2= =A0Will do it today,=C2=A0maybe.





Il gi= orno ven 24 lug 2020 alle ore 12:46 Tuan Hoang <tmhoang@linux.ibm.com> ha scritto:
This sounds interesting. Guess I= 'd setup a VM acting as SAN and PXE
server to feed storage disks to other VM booting with AOE.

Then I could have a look into patching initramfs. Sounds like a plan.

On 7/23/20 8:51 AM, Vittorio Mori wrote:
> I am building a boot server with Alpine for my homeserver.
>
> I'd like to use aoe (ATA over ethernet) for my SAN, to boot the di= stro
> from the SAN directly, with iPXE.
>
> I managed to make it work by adding the necessary files into the initr= am
> (network modules, aoe modules, aoe utils), but the initramfs init scri= pt
> always ends up to the emergency shell (, and I have to mount sysroot b= y
> hand with three commands:
>
> ifconfig eth0 up
> /usr/sbin/aoe-discover
> mount /dev/ethernet/e0.0p3 /sysroot
>
> when I exit the emergency shell, the system boots regularly and
> everything is fine.
>
> I tried to modify the init script, but it looks fairly complex and har= d
> to understand in some parts, and I can't make it work as expected.=
>
> Can I get some hints on how to put those three commands into init ? >
> Thanks.
>
--00000000000049ad1805ab2dfc14--