Skip to content

Instantly share code, notes, and snippets.

@shannonmitchell
Created November 28, 2016 16:18
Show Gist options
  • Save shannonmitchell/66c2a5b8d39d30a4dfac80445c3c4a56 to your computer and use it in GitHub Desktop.
Save shannonmitchell/66c2a5b8d39d30a4dfac80445c3c4a56 to your computer and use it in GitHub Desktop.
## Download the base distro
Find the distro you want at:
http://releases.ubuntu.com/
```
wget http://releases.ubuntu.com/trusty/ubuntu-14.04.5-server-amd64.iso
md5sum ubuntu-14.04.5-server-amd64.iso
# (compare it the sum to the the MD5SUMS file in the same download loc)
curl http://releases.ubuntu.com/trusty/MD5SUMS -s | grep ubuntu-14.04.5-server-amd64
```
## Set up the distro in cobbler
Had to get out of the osic-prep container and into the deploy device to mount the iso
deploy device
```
cd /usr/local/var/lib/lxc/osic-prep/rootfs/root
mkdir mnt
mount -o loop ubuntu-14.04.5-server-amd64.iso mnt/
rsync -a --progress mnt/ ./ubuntu-14.04.5-server-amd64
umount mnt
rmdir mnt
```
osic-prep container
```
cobbler import --name=ubuntu-14.04.5-server-amd64 --path=/root/ubuntu-14.04.5-server-amd64
rm -rf ubuntu-14.04.5-server-amd64*
cobbler profile add --name=ubuntu-14.04.5-server-unattended-osic --distro=ubuntu-14.04.5-server-x86_64 --kickstart=/opt/osic-preseeds/ubuntu-server-14.04-unattended-cobbler-osic.seed --dhcp-tag=default --enable-gpxe=0 --enable-menu=1
```
## Update the initrd
```
# 1st time, make a backup
cp /var/www/cobbler/ks_mirror/ubuntu-14.04.5-server-amd64/install/netboot/ubuntu-installer/amd64/initrd.gz /var/www/cobbler/ks_mirror/ubuntu-14.04.5-server-amd64/install/netboot/ubuntu-installer/amd64/initrd_orig.gz
# Unpack it into a temp directory
mkdir initrd_update
cd initrd_update
gzip -cd /var/www/cobbler/ks_mirror/ubuntu-14.04.5-server-amd64/install/netboot/ubuntu-installer/amd64/initrd.gz | cpio -id
# Make changes
# make sure you match the lsb-release to the debian/ubunut package. Debian jessie packages should work with Ubuntu 14.04
cat etc/lsb-release
# install lsi megaraid tool from https://hwraid.le-vert.net/debian
wget https://hwraid.le-vert.net/debian/pool-jessie/megacli_8.07.14-1_amd64.deb -O /tmp/megacli_8.07.14-1_amd64.deb
dpkg -x /tmp/megacli_8.07.14-1_amd64.deb .
rm /tmp/megacli_8.07.14-1_amd64.deb
# install hp raid tool from http://downloads.linux.hpe.com/SDR/repo/mcp/
wget http://downloads.linux.hpe.com/SDR/repo/mcp/pool/non-free/hpssacli-2.10-14.0_amd64.deb -O /tmp/hpssacli-2.10-14.0_amd64.deb
dpkg -x /tmp/hpssacli-2.10-14.0_amd64.deb .
rm /tmp/hpssacli-2.10-14.0_amd64.deb
# Extract some dependancies. This was done on a box compatible with the installer version. You
dpkg -x /var/lib/cobbler/webroot/cobbler/ks_mirror/ubuntu-14.04.5-server-amd64/pool/main/n/ncurses/libncurses5_5.9+20140118-1ubuntu1_amd64.deb .
dpkg -x /var/lib/cobbler/webroot/cobbler/ks_mirror/ubuntu-14.04.5-server-amd64/pool/main/g/gccgo-4.9/libgcc1_4.9.3-0ubuntu4_amd64.deb .
dpkg -x /var/lib/cobbler/webroot/cobbler/ks_mirror/ubuntu-14.04.5-server-amd64/pool/main/g/gcc-4.8/libstdc++6_4.8.4-2ubuntu1~14.04.3_amd64.deb .
dpkg -x /var/lib/cobbler/webroot/cobbler/ks_mirror/ubuntu-14.04.5-server-amd64/pool/main/n/ncurses/libtinfo5_5.9+20140118-1ubuntu1_amd64.deb .
# Re-create the initrd
find . | cpio -o -H newc | gzip > ../initrd.gz
cp ../initrd.gz /var/www/cobbler/ks_mirror/ubuntu-14.04.5-server-amd64/install/netboot/ubuntu-installer/amd64/initrd.gz
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment