Deployment- Working installation of a recent slackware version.
- A recent slackware CD or a directory with the exact directory structure beginning from slackware on the CD with all (most) of the packets from the a directory.
Mission Objectives
Primary: Working bash in destination folder
Secondary: Booting from destination folder
Mission Plan
Creation of destination folder and creation of variable to destination folder
root@trial:~# mkdir -p desination_folder
root@trial:~# DST=desination_folder
Creation of variable to source folder
root@trial:~# SRC=source_folder
Creation of list of names of packets that are marked REQUIRED in $SRC
/a/maketag and redirection into file
root@trial:~# cat $SRC/a/maketag | grep REQUIRED | cut -d \" -f 2 > filename_req
Installation of
REQUIRED packets
root@trial:~# for i in `cat filename_req; do installpkg -root $DST $SRC/a/$i*tgz; done
Trial of bash in chroot[!--Trying to start bash in chroot--]
root@trial:~# chroot $DST /bin/bash
chroot: cannot run command `/bin/sh': No such file or directory
Checking files existens
root@trial:~# ls $DST/bin/bash
$DST/bin/bash
Checking for needed librarys
root@trial:# ldd $DST/bin/bash
/mnt/hd/bin/bash: /lib/libc.so.6: version `GLIBC_2.3.4' not found (required by /mnt/hd/bin/bash)
libtermcap.so.2 =] /lib/libtermcap.so.2 (0x4001a000)
libdl.so.2 =] /lib/libdl.so.2 (0x4001e000)
libc.so.6 =] /lib/libc.so.6 (0x40021000)
/lib/ld-linux.so.2 =] /lib/ld-linux.so.2 (0x40000000)
Checking library existens
root@trial:~# ls $DST/lib/{libtermcap.*,lidbl.*,libc.*,ld-linux.*}
ls: /tmp/main/lib/lidbl.*: No such file or directory
ls: /tmp/main/lib/libc.*: No such file or directory
ls: /tmp/main/lib/ld-linux.*: No such file or directory
/tmp/main/lib/libtermcap.so.2 /tmp/main/lib/libtermcap.so.2.0.8
Installation of package that contains missing librarys and automatic creation of $DST
/lib/ld-linux through
$SRC
/sbin/ldconfig
root@trial:~# installpkg -root $DST $SRC/a/glibc-solibs*tgz
root@trial:~# $DST/sbin/ldconfig -r $DST
Trial of bash in chroot
root@trial:~# chroot $DST /bin/bash
Primary objective achieved!
Installation of kernel and update of
/etc/lilo.conf to show new system
root@trial:~# installpkg -root $DST $SRC/a/kernel-ide*.tgz
root@trial:~# echo -e "image = /boot/vmlinuz\n root = /dev/hd??\n label = minimal\n read-only\n" ]] /etc/lilo.conf
root@trial:~# lilo
Restart
Kernel loads normal, but we get a warning that
/etc/fstab cannot be found. That leads to the kernel thinking we have an ext2 and
failure of /sbin/e2fsck. Copy
/etc/fstab into $DST and edit it to reflect filesystem
Restart
Beside that
/sbin/modprobe does not find
/lib/modules/kernelname/modules.dep, because it does not exist, we are
presented a nice login screen. Login as root does not prompt for a password, because we did not set one. And we find our self on a nice
bash prompt
Secondary Objective achived