[SOLVED] ...Busybox

Technical issues/questions of an intermediate or advanced nature.
fullmoonremix

[SOLVED] ...Busybox

Post#1 by fullmoonremix » 21 Sep 2016, 13:11

P: _I'm not sure about how to implement Busybox. :unknown:
Q: _What is the exact procedure?

This is what I located so far...
@ http://www.slackware.com/install/rootdisk.php
rescue.dsk This is a BusyBox-based rescue disk for Linux. It is a reasonably complete mini-Linux system running from a four megabyte ramdisk, and contains an editor (vi), networking tools like ifconfig, route, telnet, ping, and wget, and other tools that might be handy for fixing your Linux machine if you ever get locked out for some reason, or any time you just need to boot Linux to "edit something quickly".
@ http://freecode.com/projects/slakbootebs
slakbootEBS is a software development kit for the automated creation of bootable embedded systems based on Slackware and Busybox. The focus is on i486 and ARM systems that use compact flash devices (handhelds and PC104 type boards). The distribution consists of a primary archive with tools, scripts, and documentation, and additional archives for the i486 and PXA250 binary components.
@ http://pbraun.nethence.com/unix/sysutil ... ramfs.html

Code: Select all

Busybox and Slackware init
Note. you need to be root to extract the device files from the cpio archive
 
Make sure you've got XZ (http://tukaani.org/xz/) first. It's available on recent Slackware distros. It's also available as package with Redhat/CentOS,
rpm -q xz
 
Prerequesties,
wget ftp://ftp.slackware.at/slackware-13.1/isolinux/initrd.img
mv -f initrd.img initrd.dist
wget ftp://ftp.slackware.at/slackware-13.1/slackware/a/lvm2-2.02.64-i486-1.txz
xz -d lvm2-2.02.64-i486-1.txz
don't forget initrd's relative kernel image, it might help to build the PXE or memstick later on !
wget ftp://ftp.slackware.at/slackware-13.1/kernels/hugesmp.s/bzImage
 
Extract a sample initramfs,
rm -rf sample/
mkdir sample/
cd sample/
gzip -dc ../initrd.dist | cpio -id
cd ..
note. "-id" or "--extract --make-directories"
 
Prepare the rescue initramfs,
rm -rf tmp/
mkdir -p tmp/etc/ tmp/lib/ tmp/_keymap/
cp -a sample/dev/ tmp/
cp -a sample/lib/modules/ tmp/lib/
cp -a sample/etc/group tmp/etc/
cp -a sample/etc/passwd tmp/etc/
tar xzf sample/etc/keymaps.tar.gz -C tmp/_keymap/
sed 's/mknod --mode=600/mknod/' sample/dev/devmap_mknod.sh > tmp/dev/devmap_mknod.sh
chmod +x tmp/dev/devmap_mknod.sh
 
Eventually enable PCMCIA,
#mkdir -p tmp/etc/rc.d
#cp -a sample/etc/rc.d/rc.pcmcia tmp/etc/rc.d
Note. for rc.pcmcia to work you also need pcmciautils package
 
Enable the network connectivity,
cp -a sample/scripts/network.sh tmp/sbin/
chmod +x tmp/sbin/network.sh
 
Make it LVM2 capable,
rm -rf addons/
mkdir addons/
mkdir -p tmp/sbin/
tar xf lvm2-2.02.64-i486-1.tar -C addons/
cp addons/sbin/lvm.static tmp/sbin/lvm
Note. this isn't needed,
#wget ftp://ftp.slackware.at/slackware-12.2/slackware/a/device-mapper-1.02.28-i486-1.tgz
#tar xzf device-mapper-1.02.28-i486-1.tgz -C addons
Note. and there's no udev.static binary provided by Slackware.
 
Create the initialization script,
cd tmp/
cat > init <<EOF9
#!/bin/sh

/bin/rm -f /etc/mtab* /etc/nologin 1> /dev/null 2> /dev/null

mkdir -p /proc /sys
mount -t proc none /proc
mount -t sysfs none /sys

/dev/makedevs.sh
/dev/devmap_mknod.sh
lvm vgscan --mknodes --ignorelockingfailure
lvm vgchange -ay --ignorelockingfailure
#blkid (floppy error)

loadkmap < /_keymap/fr-latin1.bmap

echo
echo "run network.sh to enable network cards"
echo

exec /linuxrc
EOF9
chmod 700 init
cd ..
Note. change the keymap accordingly
 
Configure linuxrc,
cd tmp/
mkdir -p etc/init.d/
touch etc/init.d/rcS
chmod +x etc/init.d/rcS
cd ..
 
Tune your environment,
cd tmp/
cat > .profile <<EOF9
alias ll='ls -alkF'
EOF9
cd ..
 
 
Finish up
Generate the initramfs and clean up,
cd tmp/
find . | cpio -co | gzip -9 > ../initrd.img
cd ..
#mkdir -p /tftpboot/rescue32/
#cp bzImage /tftpboot/rescue32/
#cp initrd.img /tftpboot/rescue32/
https://sourceforge.net/projects/microd ... =directory
http://distro.ibiblio.org/baslinux/

Pls Note: ...I already successfully installed "musl" and "tcc".
...also a http://forum.porteus.org/viewtopic.php?f=74&t=6151 would be preferable to busybox
Last edited by fullmoonremix on 27 Sep 2016, 12:52, edited 2 times in total.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Busybox...

Post#2 by Bogomips » 24 Sep 2016, 20:43

Code: Select all

sh xz2txz.sh -nv busybox-1.23.2-1-i686.pkg.tar.xz
su
txz2xzm busybox-1.23.2.i686-pkg-1.txz
http://forum.porteus.org/viewtopic.php? ... 51d#p33210

Code: Select all

busybox --list		# List of Applets, one per line
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

fullmoonremix

Re: Busybox...

Post#3 by fullmoonremix » 25 Sep 2016, 20:23

Sorry... I didn't mean installation I meant implementation.

For things like packages (eg. gawk) renaming busybox to gawk works fine.
But for system commands I don't have a clue.

Posted by 73.112.16.49 via http://webwarper.net
This is added while posting a message to avoid misusing the service

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Busybox...

Post#4 by Bogomips » 25 Sep 2016, 21:08

Code: Select all

guest@porteus:~$ busybox ls -lh /lib/libc.so.6
lrwxrwxrwx    1 root     root          12 Dec  2  2014 /lib/libc.so.6 -> libc-2.17.so
OR
symlink the command.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

Post Reply