Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Copies to the initrd, and also to the web dir but doesn't get used there.
- installfiles() {
- seedfile="$1"
- seedfilename=$(basename "$seedfile")
- basedir=/srv/tftp/netboot/ubuntu14.04/
- webdir=/srv/www/netboot/ubuntu14.04
- if [ ! -e "$seedfile" ]; then
- echo "ERROR: could not find seed file: $seedfile"
- return 3
- fi
- echo "Copying \"$seedfile\" to \"$webdir\""
- cp "$seedfile" "$webdir"
- echo "Unpacking initrd.gz"
- mkdir -p "$basedir"/tmp
- rm -r "$basedir"/tmp/*
- if [ ! -e "$basedir"/tmp/ ]; then
- echo "ERROR: tmp dir could not be created"
- return 1
- fi
- if [ ! -e "$basedir"/ubuntu-installer/amd64/initrd.gz ]; then
- echo "ERROR: initrd.gz not found"
- return 2
- fi
- cd "$basedir"/tmp/
- gunzip -c "$basedir"/ubuntu-installer/amd64/initrd.gz | cpio -i
- echo "Packing \"$seedfilename\" into the initrd.gz (renamed to pressed.cfg)"
- cp "$webdir"/"$seedfilename" preseed.cfg
- find | cpio --create --format='newc' | gzip -c > "$basedir"/ubuntu-installer/amd64/initrd.gz
- echo "done"
- }
- installfiles ~/ubuntu14.seed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement