jamesbond wrote: ↑Fri Apr 22, 2022 2:55 pm
LOL have fun guys.
Much fun to be had thanks to you James and the rest of the Fatdog team.
As a build system Fatdog is great. Recently built a kernel + busybox alone system - where busybox includes telnet so you can access BBS's
For connection I'm using a android phone USB/tethered. Around a 6MB OS (kernel + userland (busybox)). Referencing the Fatdog build recipe adding dropbear for ssh functionality, again like busybox statically build (no libs), extends the operability to include the likes of ssh into hashbang for email, irc, browsing.
Works well, excepting I haven't got DNS working yet. Net connected and I can access everything via IP, including DNS servers (nslookup somesitename someDNSserverIP to get the sites IP) have a DNS IP as the first line in resolv.conf, but just doesn't support name resolution (telnet somesite fails). Not a great hardship, if anything perhaps better as it forces you do directly access a DNS IP so you can be selective at the time as to which one to use.
Build kernel
Code: Select all
wget http://kernel.org/pub/linux/kernel/v5.x/linux-5.4.71.tar.xz
mkdir bootfiles
tar -xvf linux-5.4.71.tar.xz
cd linux-5.4.71
cp ../.config .
N=`nproc`
N=`expr $N + 1`
yes "" | make oldconfig
#make localyesconfig
yes "" | make -j$N
cp arch/x86/boot/bzImage ../bootfiles/vmlinuz
echo vmlinuz should now be ready in bootfiles folder
Build busybox
Code: Select all
# ENSURE DEVX SFS IS LOADED
# ENSURE THE .config FILE IS IN THE SAME FOLDER AS BUILD.SH
# RUN THIS SCRIPT FROM THE FOLDER WHERE BUILD.SH IS LOCATED
# Builds a static version of busybox
wget http://busybox.net/downloads/busybox-1.31.1.tar.bz2
tar -xvf busybox-1.31.1.tar.bz2
cd busybox-1.31.1
make distclean defconfig
sed -i "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" .config
make busybox install
cd _install
rm -f linuxrc
Build dropbear notes
Code: Select all
#load fatdog devx sfs
# install musl-lib from gslapt
# Download a version from : https://matt.ucc.asn.au/dropbear/releases
export CC="musl-gcc"
export PKG_CONFIG_PATH=/tmp/static/lib/pkgconfig/
./configure $CONFFLAGS --enable-static --disable-zlib --enable-bundled-libtom
make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp scp-progress" MULTI=1
With lots of time messing around with kernel make menuconfig and rebuilds.
/init inside ramfs
Code: Select all
#!/bin/ash
[ $$ -eq 1 ] || exit 1 # bail out unless we're PID 1
/bin/mount -t proc proc /proc # mount /proc first
mount -t sysfs sysfs /sys
if ! mount -t devtmpfs devtmpfs /dev 2> /null; then # /dev/null might not exist
# if no devtmpfs, use tmpfs and use mdev instead
mount -t tmpfs tmpfs /dev -o mode=755 # mode 755 is what devtmpfs uses
mdev -s
fi
[ -f /null ] && rm /null # Clear up the null file created above
[ ! -e /dev/shm ] && mkdir -p /dev/shm
[ ! -e /dev/pts ] && mkdir -p /dev/pts
exec /sbin/init # hand over to busybox init (that initiates /etc/inittab
# its own internal one when no /etc/inittab exists,
# that invokes /etc/init.d/rcS
Want to see (yet to test) if that last line could be a direct busybox call
exec busybox init
/etc/init.d/rcS .. just loads keys and font
Code: Select all
#!/bin/sh
# Our rootfs/initrd invokes busybox /sbin/init that runs /etc/inittab is one
# exists or uses its own internal version if it doesn't exist. We leave it to
# use its internal version .. and that invokes /etc/init.d/rcS ... this file
cat "/usr/share/keymaps/uk" | loadkmap # load uk keymap
echo uk >/etc/keymap
# ter-i32b works well with BBS's
zcat /usr/share/consolefonts/ter-i32b.psf.gz | loadfont # set console font
echo 850 > /etc/codepage
Thanks for all the tears and cheers