packer/scripts/cloud.sh: use packaged growpart and core-service
This commit is contained in:
parent
9e31c2f262
commit
54b983f8e3
|
@ -5,20 +5,10 @@ echo "Defaults:void !requiretty" >> /etc/sudoers.d/99-void
|
||||||
chmod 0440 /etc/sudoers.d/99-void
|
chmod 0440 /etc/sudoers.d/99-void
|
||||||
mv /etc/sudoers.d/{,10-}wheel
|
mv /etc/sudoers.d/{,10-}wheel
|
||||||
|
|
||||||
xbps-fetch -o /usr/bin/growpart https://raw.githubusercontent.com/canonical/cloud-utils/ubuntu/0.31-22-g37d4e32a-0ubuntu1/bin/growpart
|
xbps-install -Sy util-linux coreutils sed shinit cloud-guest-utils
|
||||||
chmod +x /usr/bin/growpart
|
|
||||||
|
|
||||||
xbps-install -Sy util-linux coreutils sed shinit
|
|
||||||
ln -s /etc/sv/shinit /var/service/
|
ln -s /etc/sv/shinit /var/service/
|
||||||
|
|
||||||
cat <<'EOF' > /etc/runit/core-services/10-resize-root.sh
|
sed -i -e 's/#ENABLE/ENABLE/' /etc/default/growpart
|
||||||
#!/bin/sh
|
|
||||||
rpart=$(findmnt -r -o SOURCE -v -n /)
|
|
||||||
rnum=$(cat /sys/class/block/$(basename $rpart)/partition)
|
|
||||||
|
|
||||||
/usr/bin/growpart ${rpart%%$rnum} $rnum
|
|
||||||
resize2fs $rpart
|
|
||||||
EOF
|
|
||||||
|
|
||||||
passwd -dl void
|
passwd -dl void
|
||||||
passwd -dl root
|
passwd -dl root
|
||||||
|
|
Loading…
Reference in New Issue