Update alpine version, fix partition bug
This commit is contained in:
parent
715dd03ab5
commit
efb7a5f9fa
1 changed files with 17 additions and 4 deletions
|
@ -13,8 +13,8 @@ set -x
|
||||||
DISK=$1; shift
|
DISK=$1; shift
|
||||||
SSH_KEYS=$1; shift
|
SSH_KEYS=$1; shift
|
||||||
|
|
||||||
MAJOR_VERSION=3.13
|
MAJOR_VERSION=3.14
|
||||||
MINOR_VERSION=5
|
MINOR_VERSION=0
|
||||||
IMAGE=alpine-minirootfs-$MAJOR_VERSION.$MINOR_VERSION-x86_64.tar.gz
|
IMAGE=alpine-minirootfs-$MAJOR_VERSION.$MINOR_VERSION-x86_64.tar.gz
|
||||||
|
|
||||||
RESOLVCONF=/etc/resolv.conf
|
RESOLVCONF=/etc/resolv.conf
|
||||||
|
@ -24,6 +24,19 @@ rootfs_tmpdir=$(mktemp -d)
|
||||||
|
|
||||||
rootfs_url="http://dl-cdn.alpinelinux.org/alpine/v$MAJOR_VERSION/releases/x86_64/$IMAGE"
|
rootfs_url="http://dl-cdn.alpinelinux.org/alpine/v$MAJOR_VERSION/releases/x86_64/$IMAGE"
|
||||||
|
|
||||||
|
case $DISK in
|
||||||
|
/dev/sd*)
|
||||||
|
partition=${DISK}1
|
||||||
|
;;
|
||||||
|
/dev/mmcblk*|/dev/nvme*)
|
||||||
|
partition=${DISK}p1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported disk - edit this script" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
run_root () {
|
run_root () {
|
||||||
sudo chroot $rootfs_tmpdir /usr/bin/env \
|
sudo chroot $rootfs_tmpdir /usr/bin/env \
|
||||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin \
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin \
|
||||||
|
@ -43,9 +56,9 @@ label: dos
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# For creation, if an existing filesystem is on the partitions
|
# For creation, if an existing filesystem is on the partitions
|
||||||
sudo mkfs.ext4 -F ${DISK}1
|
sudo mkfs.ext4 -F ${partition}
|
||||||
|
|
||||||
sudo mount ${DISK}1 $rootfs_tmpdir
|
sudo mount ${partition} $rootfs_tmpdir
|
||||||
|
|
||||||
# keep right permissions, use sudo
|
# keep right permissions, use sudo
|
||||||
sudo tar xf $IMAGE -C $rootfs_tmpdir
|
sudo tar xf $IMAGE -C $rootfs_tmpdir
|
||||||
|
|
Loading…
Reference in a new issue