diff --git a/package/lean/luci-app-docker/root/etc/docker-init b/package/lean/luci-app-docker/root/etc/docker-init index e9dbfb778..b00ea26af 100755 --- a/package/lean/luci-app-docker/root/etc/docker-init +++ b/package/lean/luci-app-docker/root/etc/docker-init @@ -1,9 +1,26 @@ #!/bin/sh +dtype=`fdisk -l | grep 'Disklabel type' | awk '{print $3}'` +partid="0" + +if [ "$dtype" = "gpt" ] +then + partid=`echo "n -echo "n -p -3 w -" | fdisk /dev/sda && mkfs.ext4 /dev/sda3 \ No newline at end of file +" | fdisk /dev/sda | grep 'Created a new partition' | awk '{print $5}'` + +elif [ "$dtype" = "dos" ] +then + partid=`echo "n +p + + + +w +" | fdisk /dev/sda | grep 'Created a new partition' | awk '{print $5}'` +fi + +echo "y" | mkfs.ext4 /dev/sda$partid +