How it works?

it creates a blank file of 17MB size
> dd if=/dev/zero of=initrd bs=1k count=23000
sets up a loop device
> losetup /dev/loop1 initrd
the 23MB file will be formated with EXT2
> mke2fs -m 0 -N 10000 /dev/loop1
mount the file
> mount /dev/loop1 mnt
copy needed files from root2 and hardware informations to the mounted image
> cp -rdpR root2/* mnt/
> cp -rdpR /usr/share/hwdata/*  root2/usr/share/hwdata/
umnount the image
> umount mnt
set "down" the loop device
> losetup -d /dev/loop1
set correct file permissions
> chmod 0555 bzImage
> chown root:root bzImage
set boot device in kernel
> rdev bzImage /dev/ram0
generate bootimage for Etherboot
> mknbi-linux bzImage --first32pm --output=/m23/tftp/m23install --ip=dhcp
	--rootdir=/dev/ram0 initrd
generate files for PXE
> cp bzImage /m23/tftp/m23pxeinstall
> gzip initrd
> mv initrd.gz /m23/tftp/initrd.gz



dodger 2018-05-08