homehowtokbslinksaboutcontactprojectsmusic

Index > My Projects > osis on Ubuntu 12 LTS
setup core system
osis=/osis
debootstrap --arch i386 precise osis
copy timezone info and setup host name
cp /etc/{timezone,localtime} $osis/etc
echo "osis" > $osis/etc/hostname
setup network for dhcp
cat << eot >> $osis/etc/network/interfaces
auto eth0
iface eth0 inet dhcp
eot
copy modules
cp -r /lib/modules/$(uname -r) $osis/lib/modules/
copy kernel to ipxe root
cp /boot/vmlinuz-$(uname -r) /var/www/html/ipxe/krls/; chmod 755 /var/www/html/ipxe/krls/vmlinuz-$(uname -r)
login to core system
chroot $osis
configure timezone
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; locale-gen en_US.UTF-8; update-locale LANG=en_US.UTF-8; dpkg-reconfigure -u tzdata
run updates and install nano and wget
apt-get update; apt-get install nano wget
setup repos for all the needed packages
cat << eot > etc/apt/sources.list
################### main repos ###################
deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse

################### Partclone repos ###################
deb http://free.nchc.org.tw/drbl-core drbl stable 
deb-src http://free.nchc.org.tw/drbl-core drbl stable
eot
Add partclone repo key
wget http://drbl.nchc.org.tw/GPG-KEY-DRBL; apt-key add GPG-KEY-DRBL
run update and upgrade
apt-get update; apt-get dist-upgrade
apt-get install partclone udpcast ntfs-3g nfs-common smartmontools dnsutils pigz chntpw
setup fstab
cat << eot >> etc/fstab
devpts  /dev/pts  devpts  nosuid,noexec,gid=5,mode=0620  0 0
tmpfs   /dev/shm  tmpfs   nosuid,nodev,mode=0755  0 0
sysfs   /sys      sysfs   nosuid,nodev,noexec  0 0
proc    /proc     proc    nosuid,nodev,noexec  0 0
eot
create init file and set permissions, VERY IMPORTANT FILE
nano init
and paste the following in it
#!/bin/sh
mkdir -p /dev/{,pts,ptmx}

# Mount file system in ram.
mount -av

init=/sbin/init
exec ${init}
now make the above file excutable
chmod +x init
setup autologin
echo "" >> etc/init/tty1.conf
echo "# Autologin account" >> etc/init/tty1.conf
echo "exec /bin/login -f root < /dev/tty1 > /dev/tty1 2>&1" >> etc/init/tty1.conf
exit out of core system
exit
compress core system and copy to ipxe root
cd $osis
find . -print0 | sudo cpio --null -ov --format=newc > ~/osis
xz -zvf -9 -C crc32 ~/osis; cp ~/osis.xz /var/www/html/ipxe/imgs/