Re: Busbox missing fdisk and fsck: How to add?

2018-05-23 Thread Gilles

On 23/05/2018 11:57, Paul Wise wrote:

On Wed, May 23, 2018 at 4:55 PM, Gilles wrote:


It looks like the easiest solution to the problem would be cross-compiling
fsck on a i386 Linux host, and copying the binary onto the the appliance.

It is getting better but usually compiling natively is much easier.


I only have shallow experience with cross-compiling, though: Is this
newbie-doable or am I in for days of head-scratching ?

If the source package is cross-compilable, then it isn't much
different from compiling natively.

https://wiki.debian.org/CrossCompiling

IIRC Helmut (one of the few people working on it) says only about 10%
of Debian is cross-compilable though. If anyone wants to help improve
that, please introduce yourself on the debian-cross mailing list.

https://lists.debian.org/debian-cross/

Thanks for the infos. I'll try this if I need to cross-compile an app 
one day.




Re: Busbox missing fdisk and fsck: How to add?

2018-05-23 Thread Paul Wise
On Wed, May 23, 2018 at 4:55 PM, Gilles wrote:

> It looks like the easiest solution to the problem would be cross-compiling
> fsck on a i386 Linux host, and copying the binary onto the the appliance.

It is getting better but usually compiling natively is much easier.

> I only have shallow experience with cross-compiling, though: Is this
> newbie-doable or am I in for days of head-scratching ?

If the source package is cross-compilable, then it isn't much
different from compiling natively.

https://wiki.debian.org/CrossCompiling

IIRC Helmut (one of the few people working on it) says only about 10%
of Debian is cross-compilable though. If anyone wants to help improve
that, please introduce yourself on the debian-cross mailing list.

https://lists.debian.org/debian-cross/

-- 
bye,
pabs

https://wiki.debian.org/PaulWise



Re: Busbox missing fdisk and fsck: How to add?

2018-05-23 Thread Gilles

On 23/05/2018 11:09, Mark Morgan Lloyd wrote:
Please excuse a comment from a lurker, but I'd suggest that it would 
be worth having at leastĀ  fdisk -lĀ  capability enabled by default 
since one of the first things one wants to do when in any sort of 
development or recovery situation is to work out what media is 
attached and whether it's partitioned or a single fiefsystem.


I agree. It's too bad the image I found had Busybox compiled without 
fdisk and fsck.




Re: Busbox missing fdisk and fsck: How to add?

2018-05-23 Thread Mark Morgan Lloyd

On 23/05/18 02:15, Paul Wise wrote:


I don't know how big the busybox fdisk/fsck support is, but it might
be worth reporting a bug on busybox asking for them to be enabled.
Alternatively, a bug report asking for a busybox-static-full package
containing support for every busybox applet might be a good idea.


Please excuse a comment from a lurker, but I'd suggest that it would be 
worth having at least  fdisk -l  capability enabled by default since one 
of the first things one wants to do when in any sort of development or 
recovery situation is to work out what media is attached and whether 
it's partitioned or a single fiefsystem.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



Re: Busbox missing fdisk and fsck: How to add?

2018-05-23 Thread Gilles
Edit: Elsewhere, someone mentioned a much easier solution : Just unplug 
the USB keydrive from the ARM appliance, and perform the fsck onto a PC 
running Linux.


Why didn't I think of this (face-palm) ?

Thank you.

===
Thanks very much for the infos.

It looks like the easiest solution to the problem would be 
cross-compiling fsck on a i386 Linux host, and copying the binary onto 
the the appliance.


I only have shallow experience with cross-compiling, though: Is this 
newbie-doable or am I in for days of head-scratching ?


On 23/05/2018 04:01, Paul Wise wrote:

On Tue, May 22, 2018 at 8:42 PM, Gilles wrote:


On an ARM appliance, as a way to run fsck on a USB keydrive that holds /boot
and /, I was thinking of running a small Linux image from RAM after
downloading it through TFTP.

Another option would be to use debirf to build an initramfs-based live
system that looks like your normal system (minus logs/data/config),
runs entirely from RAM and contains fsck and any other tools needed
for rescuing the system. I'm not sure if it can do cross-arch builds
but failing that you could build it on the ARM system you have.

http://cmrg.fifthhorseman.net/wiki/debirf


Problem is, the Busybox it contains is missing fdisk and fsck:

It should be feasible to download the source package, tweak the build
config, rebuild the binary packages, extract the relevant binaries and
include them in your small Linux image.

apt build-dep busybox
apt source busybox
cd busybox-*/
$EDITOR 
dpkg-buildpackage
cd ..
dpkg-deb -x busybox-static*.deb busybox-static
cp busybox-static/bin/busybox /srv/tftp/


Is there a way to download a compatible fsck binary from somewhere?

You would have to either build it or get someone else to do that for you.

You could use the one from the normal fsck packages instead of busybox.

I don't know how big the busybox fdisk/fsck support is, but it might
be worth reporting a bug on busybox asking for them to be enabled.
Alternatively, a bug report asking for a busybox-static-full package
containing support for every busybox applet might be a good idea.






Re: Busbox missing fdisk and fsck: How to add?

2018-05-23 Thread Gilles

Thanks very much for the infos.

It looks like the easiest solution to the problem would be 
cross-compiling fsck on a i386 Linux host, and copying the binary onto 
the the appliance.


I only have shallow experience with cross-compiling, though: Is this 
newbie-doable or am I in for days of head-scratching ?


On 23/05/2018 04:01, Paul Wise wrote:

On Tue, May 22, 2018 at 8:42 PM, Gilles wrote:


On an ARM appliance, as a way to run fsck on a USB keydrive that holds /boot
and /, I was thinking of running a small Linux image from RAM after
downloading it through TFTP.

Another option would be to use debirf to build an initramfs-based live
system that looks like your normal system (minus logs/data/config),
runs entirely from RAM and contains fsck and any other tools needed
for rescuing the system. I'm not sure if it can do cross-arch builds
but failing that you could build it on the ARM system you have.

http://cmrg.fifthhorseman.net/wiki/debirf


Problem is, the Busybox it contains is missing fdisk and fsck:

It should be feasible to download the source package, tweak the build
config, rebuild the binary packages, extract the relevant binaries and
include them in your small Linux image.

apt build-dep busybox
apt source busybox
cd busybox-*/
$EDITOR 
dpkg-buildpackage
cd ..
dpkg-deb -x busybox-static*.deb busybox-static
cp busybox-static/bin/busybox /srv/tftp/


Is there a way to download a compatible fsck binary from somewhere?

You would have to either build it or get someone else to do that for you.

You could use the one from the normal fsck packages instead of busybox.

I don't know how big the busybox fdisk/fsck support is, but it might
be worth reporting a bug on busybox asking for them to be enabled.
Alternatively, a bug report asking for a busybox-static-full package
containing support for every busybox applet might be a good idea.