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

2018-05-22 Thread Paul Wise
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.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise



Busbox missing fdisk and fsck: How to add?

2018-05-22 Thread Gilles

Hello,

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.


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


BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # help
Built-in commands:
--
    . : [ bg break cd chdir command continue echo eval exec exit
    export false fg getopts hash help history jobs kill let local
    printf pwd read readonly return set shift test times trap true
    type ulimit umask unset wait

~ # fdisk -l
/bin/sh: fdisk: not found

~ # fsck /dev/sda1
/bin/sh: fsck: not found


It does contain wget, however: Is there a way to download a compatible 
fsck binary from somewhere?


Thank you.