Skip to content

Commit

Permalink
Merge pull request #294 from cgwalters/no-lvm-custom-growpart
Browse files Browse the repository at this point in the history
Drop LVM, use custom growpart wrapper
  • Loading branch information
openshift-merge-robot authored Sep 17, 2018
2 parents d6c0cfc + 5ca3e89 commit 66e2950
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
12 changes: 2 additions & 10 deletions cloud.ks
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ clearpart --initlabel --all
# - $coreos_firstboot # This is actually a GRUB variable
bootloader --timeout=1 --append="no_timer_check console=ttyS0,115200n8 console=tty0 net.ifnames=0 biosdevname=0 ip=dhcp rd.neednet=1 rw $coreos_firstboot"

part /boot --size=300 --fstype="xfs"
part pv.01 --grow
volgroup coreos pv.01
logvol / --size=3000 --fstype="xfs" --name=root --vgname=coreos
part /boot --size=300 --fstype="xfs" --label=boot
part / --size=3000 --fstype="xfs" --label=root --grow

ostreesetup --nogpg --osname=rhcos --remote=rhcos --url=@@OSTREE_INSTALL_URL@@ --ref=@@OSTREE_INSTALL_REF@@

Expand All @@ -42,12 +40,6 @@ reboot
# https://github.com/dustymabe/ignition-dracut/pull/12
touch /boot/coreos-firstboot
# Configure docker-storage-setup to resize the partition table on boot
# https://github.com/projectatomic/docker-storage-setup/pull/25
echo 'GROWPART=true' >> /etc/sysconfig/docker-storage-setup
# https://pagure.io/atomic-wg/issue/343
echo 'ROOT_SIZE=+100%FREE' >> /etc/sysconfig/docker-storage-setup
# Remove any persistent NIC rules generated by udev
rm -vf /etc/udev/rules.d/*persistent-net*.rules
Expand Down
32 changes: 32 additions & 0 deletions compose-post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,38 @@ ln -sfr /usr/lib/systemd/system/{multi-user,default}.target
# This is fixed in post-RHEL7 systemd
ln -sf ../tmp.mount /usr/lib/systemd/system/local-fs.target.wants

# The canonical copy of this is in fedora-coreos-config. If
# making changes, please do them there first!
cat > /usr/libexec/coreos-growpart << 'EOF'
#!/bin/bash
set -euo pipefail
path=$1
shift
majmin=$(findmnt -nvr -o MAJ:MIN $path)
devpath=$(realpath /sys/dev/block/$majmin)
partition=$(cat $devpath/partition)
parent_path=$(dirname $devpath)
parent_device=/dev/$(basename ${parent_path})
# TODO: make this idempotent, and don't error out if
# we can't resize.
growpart ${parent_device} ${partition} || true
touch /var/lib/coreos-growpart.stamp
EOF
chmod a+x /usr/libexec/coreos-growpart
cat > /usr/lib/systemd/system/coreos-growpart.service <<'EOF'
[Unit]
ConditionPathExists=!/var/lib/coreos-growpart.stamp
Before=sshd.service
[Service]
ExecStart=/usr/libexec/coreos-growpart /
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF
cat >/usr/lib/systemd/system-preset/42-coreos-growpart.preset << EOF
enable coreos-growpart.service
EOF

# The loops below are too spammy otherwise...
set +x

Expand Down

0 comments on commit 66e2950

Please sign in to comment.