~alpine/users

4 2

loading an apkovl from an external USB stick

Details
Message ID
<CPT1K6SS7MJB.11OX1R7M79RF6@unicorn-x220.lan>
DKIM signature
missing
Download raw message
Hello,

I am trying to learn to make proper use of the power of lbu and apkovl with my ARM SBC, but I am confused by a few things here.
Firstly, the "apkovl" kernel cmdline option is quite poorly documented, at least I could only find one somewhat complete documentation in the wiki, in the PXE boot article [0]. However I do not seem to be able to get one of the mentioned formats to work.

A bit of background: I have the generic ARM archive extracted to mmcblk0p1, so it boots from that partition. I then tried to save/load the apkovl file from the second partition, mmcblk0p2. I was able to achieve this with the following kernel cmdline option:
apkovl=/media/mmcblk0p2/myhostname.apkovl.tar.gz

I assume that this only works because the partition is automatically mounted there at boot. If somebody can also explain what determines which partitions get automatically mounted, please enlighten me, because this is already quite confusing to me. :)

Now I tried to save/load the apkovl from an external USB stick on the sda1 partition. I noticed that this partition does NOT get automatically mounted in /media/, so the previous solution does not work. However the other formats that are mentioned in the abovementioned article [0] also do not work. I tried the following:
apkovl=sda1
apkovl=sda1:vfat:/myhostname.apkovl.tar.gz
apkovl=sda1:vfat:myhostname.apkovl.tar.gz
apkovl=sda1:myhostname.apkovl.tar.gz

These should work according to the explanation on that page, but do not.

I asked on IRC and ikke linked the code of the initramfs-init.in file of mkinitfs to me [1], however I do not see support for this syntax in that file. So either the wiki is wrong here, or this is already handled by something else before the $KOPT_apkovl variable gets used by the script.

I would really appreciate advice on how the automatic mounting of partitions in /media/ actually works and how the apkovl option is correctly used. I'll happily contribute my learnings back to the wiki. :)

Thanks,
Edin

[0] https://wiki.alpinelinux.org/wiki/PXE_boot
[1] https://gitlab.alpinelinux.org/alpine/mkinitfs/-/blob/master/initramfs-init.in#L42
Konstantin Kulikov <k.kulikov2@gmail.com>
Details
Message ID
<CAD+eXGQnGW-sW26dAEgypGj2-hePf9Y57WvdV7No3r5ArHucBw@mail.gmail.com>
In-Reply-To
<CPT1K6SS7MJB.11OX1R7M79RF6@unicorn-x220.lan> (view parent)
DKIM signature
missing
Download raw message
initramfs-init calls nlplugfs[0] which finds apkovls on disks. Its
code[1] is a bit hard to understand, but it has many debug statements
so try to add "debug_init=1" to kernel cmdline and continue from
there.

[0]: https://git.alpinelinux.org/mkinitfs/tree/initramfs-init.in#n581
[1]: https://git.alpinelinux.org/mkinitfs/tree/nlplug-findfs/nlplug-findfs.c

On Sun, Jan 15, 2023 at 11:21 PM Unicorn <unicorn@regrow.earth> wrote:
>
> Hello,
>
> I am trying to learn to make proper use of the power of lbu and apkovl with my ARM SBC, but I am confused by a few things here.
> Firstly, the "apkovl" kernel cmdline option is quite poorly documented, at least I could only find one somewhat complete documentation in the wiki, in the PXE boot article [0]. However I do not seem to be able to get one of the mentioned formats to work.
>
> A bit of background: I have the generic ARM archive extracted to mmcblk0p1, so it boots from that partition. I then tried to save/load the apkovl file from the second partition, mmcblk0p2. I was able to achieve this with the following kernel cmdline option:
> apkovl=/media/mmcblk0p2/myhostname.apkovl.tar.gz
>
> I assume that this only works because the partition is automatically mounted there at boot. If somebody can also explain what determines which partitions get automatically mounted, please enlighten me, because this is already quite confusing to me. :)
>
> Now I tried to save/load the apkovl from an external USB stick on the sda1 partition. I noticed that this partition does NOT get automatically mounted in /media/, so the previous solution does not work. However the other formats that are mentioned in the abovementioned article [0] also do not work. I tried the following:
> apkovl=sda1
> apkovl=sda1:vfat:/myhostname.apkovl.tar.gz
> apkovl=sda1:vfat:myhostname.apkovl.tar.gz
> apkovl=sda1:myhostname.apkovl.tar.gz
>
> These should work according to the explanation on that page, but do not.
>
> I asked on IRC and ikke linked the code of the initramfs-init.in file of mkinitfs to me [1], however I do not see support for this syntax in that file. So either the wiki is wrong here, or this is already handled by something else before the $KOPT_apkovl variable gets used by the script.
>
> I would really appreciate advice on how the automatic mounting of partitions in /media/ actually works and how the apkovl option is correctly used. I'll happily contribute my learnings back to the wiki. :)
>
> Thanks,
> Edin
>
> [0] https://wiki.alpinelinux.org/wiki/PXE_boot
> [1] https://gitlab.alpinelinux.org/alpine/mkinitfs/-/blob/master/initramfs-init.in#L42
Details
Message ID
<CPUEGRJO2LDE.CFMJU6EGBMFX@unicorn-x220.lan>
In-Reply-To
<CAD+eXGQnGW-sW26dAEgypGj2-hePf9Y57WvdV7No3r5ArHucBw@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
Thank you Konstantin for these pointers!

The code is indeed too hard for me to understand at a glance, so I
examined the debug output first. The first thing that I noticed is that
there is absolutely no mention of the sda or sda1 device in the entire
process, so I assume that the device either does not get recognized or
it gets ignored for some reason.

I looked for anything related to USB and found that nlplug-findfs does
look for USB devices in /sys/bus/usb/devices:

"nlplug-findfs: trigger_thread: scanning /sys/bus/usb/devices"

However while other things like the microSD card mmcblk0, the internal
eMMC mmcblk1 and the SPI flash are found, the sda device never appears.
Could this be a driver issue perhaps?

Here is the full boot output for anybody interested to help:
https://paste.debian.net/hidden/04716725/

Best,
Edin

On Tue Jan 17, 2023 at 6:44 AM CET, Konstantin Kulikov wrote:
> initramfs-init calls nlplugfs[0] which finds apkovls on disks. Its
> code[1] is a bit hard to understand, but it has many debug statements
> so try to add "debug_init=1" to kernel cmdline and continue from
> there.
>
> [0]: https://git.alpinelinux.org/mkinitfs/tree/initramfs-init.in#n581
> [1]: https://git.alpinelinux.org/mkinitfs/tree/nlplug-findfs/nlplug-findfs.c
>
> On Sun, Jan 15, 2023 at 11:21 PM Unicorn <unicorn@regrow.earth> wrote:
> >
> > Hello,
> >
> > I am trying to learn to make proper use of the power of lbu and apkovl with my ARM SBC, but I am confused by a few things here.
> > Firstly, the "apkovl" kernel cmdline option is quite poorly documented, at least I could only find one somewhat complete documentation in the wiki, in the PXE boot article [0]. However I do not seem to be able to get one of the mentioned formats to work.
> >
> > A bit of background: I have the generic ARM archive extracted to mmcblk0p1, so it boots from that partition. I then tried to save/load the apkovl file from the second partition, mmcblk0p2. I was able to achieve this with the following kernel cmdline option:
> > apkovl=/media/mmcblk0p2/myhostname.apkovl.tar.gz
> >
> > I assume that this only works because the partition is automatically mounted there at boot. If somebody can also explain what determines which partitions get automatically mounted, please enlighten me, because this is already quite confusing to me. :)
> >
> > Now I tried to save/load the apkovl from an external USB stick on the sda1 partition. I noticed that this partition does NOT get automatically mounted in /media/, so the previous solution does not work. However the other formats that are mentioned in the abovementioned article [0] also do not work. I tried the following:
> > apkovl=sda1
> > apkovl=sda1:vfat:/myhostname.apkovl.tar.gz
> > apkovl=sda1:vfat:myhostname.apkovl.tar.gz
> > apkovl=sda1:myhostname.apkovl.tar.gz
> >
> > These should work according to the explanation on that page, but do not.
> >
> > I asked on IRC and ikke linked the code of the initramfs-init.in file of mkinitfs to me [1], however I do not see support for this syntax in that file. So either the wiki is wrong here, or this is already handled by something else before the $KOPT_apkovl variable gets used by the script.
> >
> > I would really appreciate advice on how the automatic mounting of partitions in /media/ actually works and how the apkovl option is correctly used. I'll happily contribute my learnings back to the wiki. :)
> >
> > Thanks,
> > Edin
> >
> > [0] https://wiki.alpinelinux.org/wiki/PXE_boot
> > [1] https://gitlab.alpinelinux.org/alpine/mkinitfs/-/blob/master/initramfs-init.in#L42
Konstantin Kulikov <k.kulikov2@gmail.com>
Details
Message ID
<CAD+eXGTTMaoPAoXLn_QcPVMxtOn00Cn+4q9btipbpKco1foUDA@mail.gmail.com>
In-Reply-To
<CPUEGRJO2LDE.CFMJU6EGBMFX@unicorn-x220.lan> (view parent)
DKIM signature
missing
Download raw message
nlplug-findfs: found apkovl /media/mmcblk0p1/alpine.apkovl.tar.gz
nlplug-findfs: FOUND! setting timeout to 0
...
nlplug-findfs: exit due to timeout (0)

Try removing apkovl from mmc and increasing timeout "usbdelay=10"

On Tue, Jan 17, 2023 at 1:40 PM Unicorn <unicorn@regrow.earth> wrote:
>
> Thank you Konstantin for these pointers!
>
> The code is indeed too hard for me to understand at a glance, so I
> examined the debug output first. The first thing that I noticed is that
> there is absolutely no mention of the sda or sda1 device in the entire
> process, so I assume that the device either does not get recognized or
> it gets ignored for some reason.
>
> I looked for anything related to USB and found that nlplug-findfs does
> look for USB devices in /sys/bus/usb/devices:
>
> "nlplug-findfs: trigger_thread: scanning /sys/bus/usb/devices"
>
> However while other things like the microSD card mmcblk0, the internal
> eMMC mmcblk1 and the SPI flash are found, the sda device never appears.
> Could this be a driver issue perhaps?
>
> Here is the full boot output for anybody interested to help:
> https://paste.debian.net/hidden/04716725/
>
> Best,
> Edin
>
> On Tue Jan 17, 2023 at 6:44 AM CET, Konstantin Kulikov wrote:
> > initramfs-init calls nlplugfs[0] which finds apkovls on disks. Its
> > code[1] is a bit hard to understand, but it has many debug statements
> > so try to add "debug_init=1" to kernel cmdline and continue from
> > there.
> >
> > [0]: https://git.alpinelinux.org/mkinitfs/tree/initramfs-init.in#n581
> > [1]: https://git.alpinelinux.org/mkinitfs/tree/nlplug-findfs/nlplug-findfs.c
> >
> > On Sun, Jan 15, 2023 at 11:21 PM Unicorn <unicorn@regrow.earth> wrote:
> > >
> > > Hello,
> > >
> > > I am trying to learn to make proper use of the power of lbu and apkovl with my ARM SBC, but I am confused by a few things here.
> > > Firstly, the "apkovl" kernel cmdline option is quite poorly documented, at least I could only find one somewhat complete documentation in the wiki, in the PXE boot article [0]. However I do not seem to be able to get one of the mentioned formats to work.
> > >
> > > A bit of background: I have the generic ARM archive extracted to mmcblk0p1, so it boots from that partition. I then tried to save/load the apkovl file from the second partition, mmcblk0p2. I was able to achieve this with the following kernel cmdline option:
> > > apkovl=/media/mmcblk0p2/myhostname.apkovl.tar.gz
> > >
> > > I assume that this only works because the partition is automatically mounted there at boot. If somebody can also explain what determines which partitions get automatically mounted, please enlighten me, because this is already quite confusing to me. :)
> > >
> > > Now I tried to save/load the apkovl from an external USB stick on the sda1 partition. I noticed that this partition does NOT get automatically mounted in /media/, so the previous solution does not work. However the other formats that are mentioned in the abovementioned article [0] also do not work. I tried the following:
> > > apkovl=sda1
> > > apkovl=sda1:vfat:/myhostname.apkovl.tar.gz
> > > apkovl=sda1:vfat:myhostname.apkovl.tar.gz
> > > apkovl=sda1:myhostname.apkovl.tar.gz
> > >
> > > These should work according to the explanation on that page, but do not.
> > >
> > > I asked on IRC and ikke linked the code of the initramfs-init.in file of mkinitfs to me [1], however I do not see support for this syntax in that file. So either the wiki is wrong here, or this is already handled by something else before the $KOPT_apkovl variable gets used by the script.
> > >
> > > I would really appreciate advice on how the automatic mounting of partitions in /media/ actually works and how the apkovl option is correctly used. I'll happily contribute my learnings back to the wiki. :)
> > >
> > > Thanks,
> > > Edin
> > >
> > > [0] https://wiki.alpinelinux.org/wiki/PXE_boot
> > > [1] https://gitlab.alpinelinux.org/alpine/mkinitfs/-/blob/master/initramfs-init.in#L42
>
Details
Message ID
<CPUM5ZT2JTF7.368H00629ZCRS@unicorn-x220.lan>
In-Reply-To
<CAD+eXGTTMaoPAoXLn_QcPVMxtOn00Cn+4q9btipbpKco1foUDA@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
Unfortunately no luck with this, tried with all kinds of different
apkovl-strings again. Is it possible that the type of USB stick makes
a difference here? It is a USB 3.0 stick. Alpine recognizes it when it
is fully booted, but perhaps in this earlier stage of boot not all the
drivers are loaded?

Or could it have something to do with U-Boot or the dtb perhaps?

Best,
Edin

On Tue Jan 17, 2023 at 3:23 PM CET, Konstantin Kulikov wrote:
> nlplug-findfs: found apkovl /media/mmcblk0p1/alpine.apkovl.tar.gz
> nlplug-findfs: FOUND! setting timeout to 0
> ...
> nlplug-findfs: exit due to timeout (0)
>
> Try removing apkovl from mmc and increasing timeout "usbdelay=10"
>
> On Tue, Jan 17, 2023 at 1:40 PM Unicorn <unicorn@regrow.earth> wrote:
> >
> > Thank you Konstantin for these pointers!
> >
> > The code is indeed too hard for me to understand at a glance, so I
> > examined the debug output first. The first thing that I noticed is that
> > there is absolutely no mention of the sda or sda1 device in the entire
> > process, so I assume that the device either does not get recognized or
> > it gets ignored for some reason.
> >
> > I looked for anything related to USB and found that nlplug-findfs does
> > look for USB devices in /sys/bus/usb/devices:
> >
> > "nlplug-findfs: trigger_thread: scanning /sys/bus/usb/devices"
> >
> > However while other things like the microSD card mmcblk0, the internal
> > eMMC mmcblk1 and the SPI flash are found, the sda device never appears.
> > Could this be a driver issue perhaps?
> >
> > Here is the full boot output for anybody interested to help:
> > https://paste.debian.net/hidden/04716725/
> >
> > Best,
> > Edin
> >
> > On Tue Jan 17, 2023 at 6:44 AM CET, Konstantin Kulikov wrote:
> > > initramfs-init calls nlplugfs[0] which finds apkovls on disks. Its
> > > code[1] is a bit hard to understand, but it has many debug statements
> > > so try to add "debug_init=1" to kernel cmdline and continue from
> > > there.
> > >
> > > [0]: https://git.alpinelinux.org/mkinitfs/tree/initramfs-init.in#n581
> > > [1]: https://git.alpinelinux.org/mkinitfs/tree/nlplug-findfs/nlplug-findfs.c
> > >
> > > On Sun, Jan 15, 2023 at 11:21 PM Unicorn <unicorn@regrow.earth> wrote:
> > > >
> > > > Hello,
> > > >
> > > > I am trying to learn to make proper use of the power of lbu and apkovl with my ARM SBC, but I am confused by a few things here.
> > > > Firstly, the "apkovl" kernel cmdline option is quite poorly documented, at least I could only find one somewhat complete documentation in the wiki, in the PXE boot article [0]. However I do not seem to be able to get one of the mentioned formats to work.
> > > >
> > > > A bit of background: I have the generic ARM archive extracted to mmcblk0p1, so it boots from that partition. I then tried to save/load the apkovl file from the second partition, mmcblk0p2. I was able to achieve this with the following kernel cmdline option:
> > > > apkovl=/media/mmcblk0p2/myhostname.apkovl.tar.gz
> > > >
> > > > I assume that this only works because the partition is automatically mounted there at boot. If somebody can also explain what determines which partitions get automatically mounted, please enlighten me, because this is already quite confusing to me. :)
> > > >
> > > > Now I tried to save/load the apkovl from an external USB stick on the sda1 partition. I noticed that this partition does NOT get automatically mounted in /media/, so the previous solution does not work. However the other formats that are mentioned in the abovementioned article [0] also do not work. I tried the following:
> > > > apkovl=sda1
> > > > apkovl=sda1:vfat:/myhostname.apkovl.tar.gz
> > > > apkovl=sda1:vfat:myhostname.apkovl.tar.gz
> > > > apkovl=sda1:myhostname.apkovl.tar.gz
> > > >
> > > > These should work according to the explanation on that page, but do not.
> > > >
> > > > I asked on IRC and ikke linked the code of the initramfs-init.in file of mkinitfs to me [1], however I do not see support for this syntax in that file. So either the wiki is wrong here, or this is already handled by something else before the $KOPT_apkovl variable gets used by the script.
> > > >
> > > > I would really appreciate advice on how the automatic mounting of partitions in /media/ actually works and how the apkovl option is correctly used. I'll happily contribute my learnings back to the wiki. :)
> > > >
> > > > Thanks,
> > > > Edin
> > > >
> > > > [0] https://wiki.alpinelinux.org/wiki/PXE_boot
> > > > [1] https://gitlab.alpinelinux.org/alpine/mkinitfs/-/blob/master/initramfs-init.in#L42
> >
Reply to thread Export thread (mbox)