WHDD Live ISO Boot CD

WHDD is created by Andrey Utkin. This is a small 'Live' image to run standalone.

=Prebuilt WHDD Live ISO=

For people who just want it without building themselves

Prebuilt ISO 2.1-10

Boot from Syslinux/PXELinux
Label WHDD V2 LINUX /memdisk iso INITRD /whdd-live.iso

or separate (not in ISO)

Label WHDD V2 LINUX /bzImage INITRD /initramfs

=Build it yourself=

Download Toolchain
This uses uClibc to create smaller C library files and hence a smaller output.

i386 uClibc toolchain

Create folders
Create directory structure somewhere;

mkdir -p patch source custom

Download Sources
cd source git clone https://github.com/krieger-od/whdd git clone git://git.busybox.net/busybox curl https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.02.tar.xz | tar -Jx svn co http://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools smartmontools curl https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.5.tar.xz | tar -Jx curl http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz | tar -zx curl http://invisible-island.net/datafiles/release/dialog.tar.gz | tar -zx

Dir structures
Initially you should just have folders custom, patch, source and the Makefile.

(Ignore other folders for the moment, this is after it has been built to give you an idea how it should look)

├── custom │   ├── inittab │   └── rcS ├── destdir │   ├── bin │   ├── etc │   ├── include │   ├── lib │   ├── linuxrc -> bin/busybox │   ├── sbin │   ├── share │   └── usr ├── initrd │   ├── bin │   ├── dev │   ├── etc │   ├── home │   ├── init -> bin/busybox │   ├── lib │   ├── mnt │   ├── opt │   ├── proc │   ├── sbin │   ├── sys │   ├── tmp │   ├── usr │   └── var ├── Makefile ├── output │   ├── bzImage │   ├── initramfs │   └── isolinux ├── patch │   └── xxxxxxxxxxxx.patch ├── source │   ├── busybox │   ├── dialog-1.2-20140219 │   ├── linux-3.14 │   ├── ncurses-5.9 │   ├── smartmontools-code-3887-trunk │   ├── syslinux │   └── whdd ├── whdd-live.iso └── whdd.qcow

Patches
Patches have been pushed to master so none needed with current version at time of writing (v 2.2)

Makefile
This should be one level below the folder structure's created, see the dir layout


 * Change TCHAIN to where your toolchain is, buildroot ones have hard coded paths, x-tools (crosstools-ng doesn't?)

=/custom folder contents=

inittab

 * sysinit:/etc/init.d/rcS
 * ctrlaltdel:/sbin/reboot
 * shutdown:/bin/umount -a -r

tty1::respawn:/bin/sh tty2::respawn:/bin/sh

rcS

 * 1) !/bin/sh
 * 2) set
 * 3) WHDD Live	    #
 * 4)  Richud.com 2014  #

mount -t proc proc /proc mount -t sysfs none /sys
 * 1) mount system virtual file systems

mount -t devpts devpts /dev/pts
 * 1) UNIX98 pseudoterminal support

mdev -s echo /sbin/mdev > /proc/sys/kernel/hotplug
 * 1) hotplug support with bb mdev

echo 1 4 1 7 > /proc/sys/kernel/printk
 * 1) stop all but EMERG kernel messages to console

export LANG=en_US.UTF-8
 * 1) set LANG so ncurses displays all ACSII codes.
 * 2) this needs controlling terminal set below to work OR need to patch busybox/shell/ash.c with LANG variable.

setsid sh -c 'exec "/sbin/whdd" /dev/tty1 2>&1'
 * 1) startup whdd with a controlling terminal else no SIGNALS will work like ctrl-c OR patch kernel drivers/char/tty_io.c

=Build It=

Assuming you have all the files extracted and laid out correctly, just run 'make'.


 * make = build everything i.e. create kernel 'bzImage', programs and system archive 'initramfs', iso
 * make xxxxx = build program xxxxx (to 'destdir/')
 * make linux = just build (compile) kernel ('output/bzImage')
 * make progs = just build (compile) all the progs ('destdir/')
 * make system = clean/strip/cpio archive programs ('output/initramfs')
 * make iso = create ISO from bzImage and initramfs

=Test It (with QEmu)=


 * create a 50Mb test 'hard drive' image

qemu-img create -f qcow whdd.qcow 50M


 * fire it up

qemu-system-x86_64 -kernel output/bzImage -initrd output/initramfs -hda whdd.qcow

Selecting the QEMU disk



Main menu



Show hard drive SMART data



Running the 'read test' should produce something like this after a couple of seconds;



=UTF.8 Support=

Remeber you need ncurses, a terminfo database, patched ash.c or specifying LANG in the running shell. Additionally, but not in this example, a correct console font such as Lat15-Fixed16.psf or cyr-sun16.psfu (Thanks Lavrentiy Ivanov)

=Comments=