Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify ./build-iso #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Build dependencies

* `curl`(1).
* `m4`(1).
* `mkisofs`(1) from the `cdrtools` package available from MacPorts or
Homebrew.
* `genisoimage`(1) from the `genisoimage` package available from Debian repostiory and other package archives for Linux.
* `mkisofs` and `xorrisofs` are alternatives that work with the same arguments as `genisoimage`.

Runtime dependencies
--------------------
Expand All @@ -26,11 +26,11 @@ Features in the ISO

* Configurable default user with SSH key and sudoer NOPASSWD access
* The system clock is set to UTC
* Auto partition virtual disk (/dev/vda) with LVM
* Auto partition virtual disk (/dev/sda) with LVM
* OpenSSH server is installed
* Bring up only eth1 for flexible user-net SSH port forwarding
* Includes script to auto-resize partitions to the current size of
vitual disk /etc/auto_resize_vda.sh
vitual disk /etc/auto_resize_sda.sh


Building
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-slate
9 changes: 9 additions & 0 deletions auto_resize_sda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# Use parted to extend root partition to available /dev/sda space
END=$(parted /dev/sda print free | grep Free | tail -1 | awk "{print \$2}")
parted /dev/sda resizepart 2 $END
parted /dev/sda resizepart 5 $END
pvresize /dev/sda5
VGROUP=$(mount | grep root | awk "{ print \$1 }")
lvextend -l +100%FREE -r $VGROUP
9 changes: 0 additions & 9 deletions auto_resize_vda.sh

This file was deleted.

4 changes: 2 additions & 2 deletions build-iso
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ m4 \
m4 \
-D __USERNAME__="$USERNAME" \
sudoers.m4 > "$COPY/sudoers"
cp "$PUBLIC_KEY" "auto_resize_vda.sh" "$COPY/"
cp "$PUBLIC_KEY" "auto_resize_sda.sh" "$COPY/"
m4 \
-D __USERNAME__="$USERNAME" \
-D __PUBLIC_KEY__="$PUBLIC_KEY" \
"late_command.sh.m4" > "$COPY/late_command.sh"

echo Building a custom ISO
# Build a custom ISO.
mkisofs -r -V "Ubuntu $VERSION for Terraform" \
genisoimage -r -V "Ubuntu $VERSION for Terraform" \
-cache-inodes -J -l -no-emul-boot \
-b isolinux/isolinux.bin \
-c isolinux/boot.cat \
Expand Down
2 changes: 1 addition & 1 deletion config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
: ${NICKNAME:="terraform"}

# Arguments given to the download router.
: ${VERSION:="14.04.5"}
: ${VERSION:="16.04.6"}
: ${DISTRO:="server"}
: ${RELEASE:="latest"}

Expand Down
4 changes: 2 additions & 2 deletions late_command.sh.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ chown 1000:1000 \
/target/home/__USERNAME__/.ssh \
/target/home/__USERNAME__/.ssh/authorized_keys

cp /cdrom/sudoers /cdrom/auto_resize_vda.sh /target/etc/
cp /cdrom/sudoers /cdrom/auto_resize_sda.sh /target/etc/
chmod 440 /target/etc/sudoers
chown 0:0 /target/etc/sudoers
chmod 755 /target/etc/auto_resize_vda.sh
chmod 755 /target/etc/auto_resize_sda.sh
2 changes: 1 addition & 1 deletion unattended.seed.m4
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ d-i clock-setup/utc boolean true
d-i time/zone string UTC

# Partitions.
d-i partman-auto/disk string /dev/vda
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
Expand Down
Empty file removed work/.gitkeep
Empty file.