Mail archive
alpine-devel

[alpine-devel] [PATCH] Add btrfs-progs to init_progs(). Use "-q" only when the tool supports this switch.

From: Juan Francisco Cantero Hurtado <iam_at_juanfra.info>
Date: Fri, 1 Aug 2014 02:39:35 +0200

---
 setup-disk.in | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/setup-disk.in b/setup-disk.in
index c20c619..f41a464 100644
--- a/setup-disk.in
+++ b/setup-disk.in
_at_@ -424,7 +424,7 @@ stop_all_raid() {
 init_progs() {
 	local raidpkg=
 	[ -n "$USE_RAID" ] && raidpkg="mdadm"
-	apk add --quiet sfdisk e2fsprogs lvm2 $raidpkg syslinux $_at_
+	apk add --quiet sfdisk e2fsprogs lvm2 $raidpkg syslinux btrfs-progs $_at_
 }
 
 show_disk_info() {
_at_@ -519,7 +519,11 @@ setup_boot_dev() {
 			--metadata=0.90 --quiet --run $_at_ $missing || return 1
 		bootdev=/dev/md0
 	fi
-	mkfs.$BOOTFS -q $bootdev
+	local mkfs_args=
+	if [ "$BOOTFS" != "btrfs" ]; then
+		mkfs_args="-q"
+	fi
+	mkfs.$BOOTFS $mkfs_args $bootdev
 	BOOT_DEV="$bootdev"
 }
 
_at_@ -614,7 +618,7 @@ setup_var() {
 	local var_dev="$1"
 	local varfs=${VARFS}
 	echo "Creating file systems..."
-	mkfs.$varfs -q $var_dev >/dev/null || return 1
+	mkfs.$varfs $var_dev >/dev/null || return 1
 	sed -i -e '/[[:space:]]\/var[[:space:]]/d' /etc/fstab
 	echo -e "${var_dev}\t/var\t\t${varfs}\tdefaults 1 2" >> /etc/fstab
 
_at_@ -710,7 +714,11 @@ data_only_disk_install() {
 # setup
 setup_root() {
 	local root_dev="$1" boot_dev="$2"
-	mkfs.$ROOTFS -q "$root_dev"
+	local mkfs_args=
+	if [ "$ROOTFS" != "btrfs" ]; then
+		mkfs_args="-q"
+	fi
+	mkfs.$ROOTFS $mkfs_args "$root_dev"
 	mkdir -p "$SYSROOT"
 	mount -t $ROOTFS $root_dev "$SYSROOT" || return 1
 	if [ -n "$boot_dev" ]; then
-- 
1.9.3
---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Fri Aug 01 2014 - 02:39:35 UTC