aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-05-21 11:19:26 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-05-21 11:20:59 +0000
commitdd52a43265d8d615998f1bdec1f1956bfc2d6c77 (patch)
tree2efc68d96aa663c59daa7c7ce6e4b6bb84189632
parent6efdf5c0b3a6ed4ead5d7d81a28ba56f3646f46e (diff)
downloadaports-dd52a43265d8d615998f1bdec1f1956bfc2d6c77.tar.bz2
aports-dd52a43265d8d615998f1bdec1f1956bfc2d6c77.tar.xz
main/alpine-conf: backport ERASE_DISKS support for setup-disk
fixes #2894
-rw-r--r--main/alpine-conf/0001-setup-disk-add-magic-environment-variable-ERASE-DISKS.patch132
-rw-r--r--main/alpine-conf/APKBUILD12
-rw-r--r--main/alpine-conf/curl132
3 files changed, 272 insertions, 4 deletions
diff --git a/main/alpine-conf/0001-setup-disk-add-magic-environment-variable-ERASE-DISKS.patch b/main/alpine-conf/0001-setup-disk-add-magic-environment-variable-ERASE-DISKS.patch
new file mode 100644
index 0000000000..85cc66c675
--- /dev/null
+++ b/main/alpine-conf/0001-setup-disk-add-magic-environment-variable-ERASE-DISKS.patch
@@ -0,0 +1,132 @@
+From 81ae21f658b6ddb4b34e03f44b20a196d8eb18cf Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 23 Apr 2014 09:16:41 +0200
+Subject: setup-disk: add magic environemnt var ERASE_DISKS as confirmation
+
+Add a magic environment variable ERASE_DISKS as confirmation for
+erasing disks. This is useful for scripted installs.
+
+fixes #2863
+
+diff --git a/setup-disk.in b/setup-disk.in
+index 9e222fb..e06bdea 100644
+--- a/setup-disk.in
++++ b/setup-disk.in
+@@ -107,7 +107,7 @@ unpack_apkovl() {
+ n*|N*) return 1;;
+ esac
+ fi
+- return 0
++ return 0
+ fi
+
+ apk add --quiet openssl
+@@ -315,7 +315,7 @@ EOF
+ for i in $repos; do
+ repoflags="$repoflags --repository $i"
+ done
+-
++
+ chroot_caps=$(set_grsec chroot_caps 0)
+ init_chroot_mounts "$mnt"
+ apk add --root "$mnt" $apkflags --overlay-from-stdin \
+@@ -386,7 +386,7 @@ is_available_disk() {
+
+ # check if its a "root" block device and not a partition
+ [ -e /sys/block/$b ] || return 1
+-
++
+ # check so it does not have mounted partitions
+ has_mounted_part $dev && return 1
+
+@@ -437,10 +437,14 @@ show_disk_info() {
+
+ confirm_erase() {
+ local answer=
++ local erasedisks="$@"
++ if [ "$ERASE_DISKS" = "$erasedisks" ]; then
++ reeturn 0
++ fi
+ echo "WARNING: The following disk(s) will be erased:"
+ show_disk_info $@
+ echo -n "WARNING: Erase the above disk(s) and continue? [y/N]: "
+-
++
+ read answer
+ case "$answer" in
+ y*|Y*) return 0;;
+@@ -449,7 +453,7 @@ confirm_erase() {
+ }
+
+ # setup partitions on given disk dev in $1.
+-# usage: setup_partitions <diskdev> size1,type1 [size2,type2 ...]
++# usage: setup_partitions <diskdev> size1,type1 [size2,type2 ...]
+ setup_partitions() {
+ local diskdev="$1"
+ shift
+@@ -558,7 +562,7 @@ setup_lvm_volume_group() {
+ if [ -n "$USE_RAID" ]; then
+ setup_non_boot_raid_dev /dev/md1 $@ || return 1
+ lvmdev=/dev/md1
+- else
++ else
+ lvmdev=$(find_lvm_partition $1)
+ fi
+
+@@ -654,7 +658,7 @@ data_only_disk_install_lvm() {
+ for diskdev in "$@"; do
+ setup_partitions $diskdev "$size,$part_type" || return 1
+ done
+-
++
+ setup_lvm_volume_group $vgname $@ || return 1
+ setup_lvm_swap $vgname
+ lvcreate --quiet -n ${var_dev##*/} -l 100%FREE $vgname
+@@ -699,7 +703,7 @@ data_only_disk_install() {
+ setup_var $var_dev
+ }
+
+-# setup
++# setup
+ setup_root() {
+ local root_dev="$1" boot_dev="$2"
+ mkfs.$ROOTFS -q "$root_dev"
+@@ -777,7 +781,7 @@ native_disk_install() {
+
+ # will find BOOT_DEV for us
+ setup_boot_dev $@
+-
++
+ if [ "$USE_RAID" ]; then
+ [ $SWAP_SIZE -gt 0 ] && setup_non_boot_raid_dev /dev/md1 $@
+ setup_non_boot_raid_dev /dev/md2 $@ || return 1
+@@ -812,7 +816,7 @@ You can select between 'sys' or 'data'.
+ sys:
+ This mode is a traditional disk install. The following partitions will be
+ created on the disk: /boot, / (filesystem root) and swap.
+-
++
+ This mode may be used for development boxes, desktops, virtual servers, etc.
+
+ data:
+@@ -935,7 +939,7 @@ if [ -z "$disks" ]; then
+ fi
+
+ if [ $# -gt 0 ]; then
+- # check that they are
++ # check that they are
+ for i in "$@"; do
+ j=$(readlink -f "$i" | sed 's:^/dev/::; s:/:!:g')
+ if ! [ -e "/sys/block/$j/device" ]; then
+@@ -965,7 +969,7 @@ if [ -n "$diskdevs" ] && [ -z "$DISK_MODE" ]; then
+ disk_is_or_disks_are="disks are"
+ it_them="them"
+ fi
+-
++
+ while true; do
+ echo "The following $disk_is_or_disks_are selected:"
+ show_disk_info $diskdevs
+--
+cgit v0.10.1
+
diff --git a/main/alpine-conf/APKBUILD b/main/alpine-conf/APKBUILD
index 66b5a0be0b..a985432126 100644
--- a/main/alpine-conf/APKBUILD
+++ b/main/alpine-conf/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=alpine-conf
pkgver=2.14.0
-pkgrel=4
+pkgrel=5
pkgdesc="Alpine configuration management scripts"
url=http://git.alpinelinux.org/cgit/$pkgname
arch="all"
@@ -11,6 +11,7 @@ source="http://dev.alpinelinux.org/archive/alpine-conf/alpine-conf-$pkgver.tar.x
0001-setup-bootable-use-UUID-on-new-USBs.patch
0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch
0001-setup-disk-fix-partitioning-of-HP-raid-array-cciss.patch
+ 0001-setup-disk-add-magic-environment-variable-ERASE-DISKS.patch
"
_builddir="$srcdir"/$pkgname-$pkgver
@@ -40,12 +41,15 @@ package() {
md5sums="94b82dd9d7a2c63aa6909238da3b44b3 alpine-conf-2.14.0.tar.xz
c0eeeebfb67b757c954a2f5100461a7b 0001-setup-bootable-use-UUID-on-new-USBs.patch
6568923677063d92939f85157baf0dc4 0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch
-df0d66fd6dcd63f1648b0768ed23df34 0001-setup-disk-fix-partitioning-of-HP-raid-array-cciss.patch"
+df0d66fd6dcd63f1648b0768ed23df34 0001-setup-disk-fix-partitioning-of-HP-raid-array-cciss.patch
+1c975a60bf80bd7898645f3c4b44cc64 0001-setup-disk-add-magic-environment-variable-ERASE-DISKS.patch"
sha256sums="14dc81845b16ffcbb39af9d0c5aeffab68166eec154c822b7c1c9c0697823d5b alpine-conf-2.14.0.tar.xz
754a59868f069c4eb2321034f00539ea02e734ede1a483b9c9ec5360c788f8c1 0001-setup-bootable-use-UUID-on-new-USBs.patch
a410da99de3ef31a7a8a537aeb0fcd0ab53027e6febd95e15c1accdc49c135ee 0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch
-56988a30777e6a7ed0391236aa94d3812ab4b9ee89a7866ce62ab4eb620145f2 0001-setup-disk-fix-partitioning-of-HP-raid-array-cciss.patch"
+56988a30777e6a7ed0391236aa94d3812ab4b9ee89a7866ce62ab4eb620145f2 0001-setup-disk-fix-partitioning-of-HP-raid-array-cciss.patch
+add4cf1bcc4f5344f88a8fa8492c5f994f3f699d36a4981ccecd14ae2345d0b1 0001-setup-disk-add-magic-environment-variable-ERASE-DISKS.patch"
sha512sums="39aa74e676221475ce088d82b134563c3dd04a69e90919089d3876b6a4715f6df58aa156352a40d9f817414cbdb603350a3e9c15914fb254a24d8cef4acd6581 alpine-conf-2.14.0.tar.xz
3b2d2fb754421f7dd4c45c7212544c2f34587da9da10e777ee9de153dd77e70d016bf8b270d72dd6ee8299c99a17f2969bddef586afbdcac13b4d76c87bcc35e 0001-setup-bootable-use-UUID-on-new-USBs.patch
32bc771eba2b912623dd5b0c96571d0770afc370c354831353f2ebda5e396323f1cebfddc36d8ac3ee8028a1554a0163ecdaa9cca108097002282f838139f5b6 0001-setup-bootable-move-syslinux.cfg-to-boot-syslinux-if.patch
-6188cfe76b6acd63c9c9906f590c025ea4d0d8b49c97c0c21dee93670fafda595668534b7fcbbe5095eae967d13fb742823fe1c69412f52341c18e3f5ea7901e 0001-setup-disk-fix-partitioning-of-HP-raid-array-cciss.patch"
+6188cfe76b6acd63c9c9906f590c025ea4d0d8b49c97c0c21dee93670fafda595668534b7fcbbe5095eae967d13fb742823fe1c69412f52341c18e3f5ea7901e 0001-setup-disk-fix-partitioning-of-HP-raid-array-cciss.patch
+6d09092d9b7d74f1caec0a403aff8549da061bb20da51b7c1c3b52f176c26e8eeaeb15c7dec589ffa23fbcaaeb7b54a33e112ab3e0fc9d6b96557ba894a212b5 0001-setup-disk-add-magic-environment-variable-ERASE-DISKS.patch"
diff --git a/main/alpine-conf/curl b/main/alpine-conf/curl
new file mode 100644
index 0000000000..85cc66c675
--- /dev/null
+++ b/main/alpine-conf/curl
@@ -0,0 +1,132 @@
+From 81ae21f658b6ddb4b34e03f44b20a196d8eb18cf Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 23 Apr 2014 09:16:41 +0200
+Subject: setup-disk: add magic environemnt var ERASE_DISKS as confirmation
+
+Add a magic environment variable ERASE_DISKS as confirmation for
+erasing disks. This is useful for scripted installs.
+
+fixes #2863
+
+diff --git a/setup-disk.in b/setup-disk.in
+index 9e222fb..e06bdea 100644
+--- a/setup-disk.in
++++ b/setup-disk.in
+@@ -107,7 +107,7 @@ unpack_apkovl() {
+ n*|N*) return 1;;
+ esac
+ fi
+- return 0
++ return 0
+ fi
+
+ apk add --quiet openssl
+@@ -315,7 +315,7 @@ EOF
+ for i in $repos; do
+ repoflags="$repoflags --repository $i"
+ done
+-
++
+ chroot_caps=$(set_grsec chroot_caps 0)
+ init_chroot_mounts "$mnt"
+ apk add --root "$mnt" $apkflags --overlay-from-stdin \
+@@ -386,7 +386,7 @@ is_available_disk() {
+
+ # check if its a "root" block device and not a partition
+ [ -e /sys/block/$b ] || return 1
+-
++
+ # check so it does not have mounted partitions
+ has_mounted_part $dev && return 1
+
+@@ -437,10 +437,14 @@ show_disk_info() {
+
+ confirm_erase() {
+ local answer=
++ local erasedisks="$@"
++ if [ "$ERASE_DISKS" = "$erasedisks" ]; then
++ reeturn 0
++ fi
+ echo "WARNING: The following disk(s) will be erased:"
+ show_disk_info $@
+ echo -n "WARNING: Erase the above disk(s) and continue? [y/N]: "
+-
++
+ read answer
+ case "$answer" in
+ y*|Y*) return 0;;
+@@ -449,7 +453,7 @@ confirm_erase() {
+ }
+
+ # setup partitions on given disk dev in $1.
+-# usage: setup_partitions <diskdev> size1,type1 [size2,type2 ...]
++# usage: setup_partitions <diskdev> size1,type1 [size2,type2 ...]
+ setup_partitions() {
+ local diskdev="$1"
+ shift
+@@ -558,7 +562,7 @@ setup_lvm_volume_group() {
+ if [ -n "$USE_RAID" ]; then
+ setup_non_boot_raid_dev /dev/md1 $@ || return 1
+ lvmdev=/dev/md1
+- else
++ else
+ lvmdev=$(find_lvm_partition $1)
+ fi
+
+@@ -654,7 +658,7 @@ data_only_disk_install_lvm() {
+ for diskdev in "$@"; do
+ setup_partitions $diskdev "$size,$part_type" || return 1
+ done
+-
++
+ setup_lvm_volume_group $vgname $@ || return 1
+ setup_lvm_swap $vgname
+ lvcreate --quiet -n ${var_dev##*/} -l 100%FREE $vgname
+@@ -699,7 +703,7 @@ data_only_disk_install() {
+ setup_var $var_dev
+ }
+
+-# setup
++# setup
+ setup_root() {
+ local root_dev="$1" boot_dev="$2"
+ mkfs.$ROOTFS -q "$root_dev"
+@@ -777,7 +781,7 @@ native_disk_install() {
+
+ # will find BOOT_DEV for us
+ setup_boot_dev $@
+-
++
+ if [ "$USE_RAID" ]; then
+ [ $SWAP_SIZE -gt 0 ] && setup_non_boot_raid_dev /dev/md1 $@
+ setup_non_boot_raid_dev /dev/md2 $@ || return 1
+@@ -812,7 +816,7 @@ You can select between 'sys' or 'data'.
+ sys:
+ This mode is a traditional disk install. The following partitions will be
+ created on the disk: /boot, / (filesystem root) and swap.
+-
++
+ This mode may be used for development boxes, desktops, virtual servers, etc.
+
+ data:
+@@ -935,7 +939,7 @@ if [ -z "$disks" ]; then
+ fi
+
+ if [ $# -gt 0 ]; then
+- # check that they are
++ # check that they are
+ for i in "$@"; do
+ j=$(readlink -f "$i" | sed 's:^/dev/::; s:/:!:g')
+ if ! [ -e "/sys/block/$j/device" ]; then
+@@ -965,7 +969,7 @@ if [ -n "$diskdevs" ] && [ -z "$DISK_MODE" ]; then
+ disk_is_or_disks_are="disks are"
+ it_them="them"
+ fi
+-
++
+ while true; do
+ echo "The following $disk_is_or_disks_are selected:"
+ show_disk_info $diskdevs
+--
+cgit v0.10.1
+