mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-18 17:33:31 +00:00
luci-app-docker:add compatibility for GPT partitions (#1777)
This commit is contained in:
parent
5b23cabd51
commit
a249c45ff1
@ -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
|
||||
" | 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user