Mail archive
alpine-devel

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

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Tue, 4 Nov 2014 11:33:22 +0100

This was finally applied.

Sorry for the delay.

Thanks!

-nc

On Sat, 02 Aug 2014 00:17:31 +0200
Juan Francisco Cantero Hurtado <iam_at_juanfra.info> wrote:

> On Friday 01 August 2014 11:25:01 you wrote:
> > On Fri, 1 Aug 2014 02:39:35 +0200
> > Juan Francisco Cantero Hurtado <iam_at_juanfra.info> wrote:
> >
> > So as i understand this adds support for btrfs to setup-disk?
>
> Yes. I tried to use ROOTFS=btrfs but failed because btrfs-progs
> was not installed and the tools doesn't support "-q".
>
> >
> > > ---
> > >
> > > 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_>
> > > }
> >
> > If we are going to do this, how about soemthing like:
> >
> > case $ROOTFS in
> > ext*) fstools=e2fsprogs; mkfs_args="-q";;
> > xfs) fstools=xfsprogs; mkfs_args="-q";;
> > btrfs) fstools=btrs-progs; mkfs_args="";;
> > esac
> > apk add --quiet $fstools ....
> >
> > That way we dont install btrfs-tools unless actually needed and we
> > avoid specialhandling for future filesystems.
> >
> > > 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"
> > >
> > > }
> >
> > btw.. does exlinux support booting from btrfs?
>
> I didn't test with BOOTFS. I only added that part because the wiki
> says that BOOTFS supports also btrfs
> http://wiki.alpinelinux.org/wiki/Alpine_setup_scripts#setup-disk .
>
> >
> > > _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
> >
> > -nc
>
>
> From 87a2a3ca2f365df3c60d933b71d70333287e090f Mon Sep 17 00:00:00 2001
> From: Juan Francisco Cantero Hurtado <iam_at_juanfra.info>
> Date: Fri, 1 Aug 2014 23:47:50 +0200
> Subject: [PATCH] Add support for btrfs to setup-disk.
>
> ---
> setup-disk.in | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/setup-disk.in b/setup-disk.in
> index c20c619..bae373a 100644
> --- a/setup-disk.in
> +++ b/setup-disk.in
> _at_@ -424,7 +424,12 @@ stop_all_raid() {
> init_progs() {
> local raidpkg=
> [ -n "$USE_RAID" ] && raidpkg="mdadm"
> - apk add --quiet sfdisk e2fsprogs lvm2 $raidpkg syslinux $_at_
> + case $ROOTFS in
> + ext*) fstools=e2fsprogs; mkfs_args="-q";;
> + xfs) fstools=xfsprogs; mkfs_args="-q";;
> + btrfs) fstools=btrs-progs; mkfs_args="";;
> + esac
> + apk add --quiet sfdisk e2fsprogs lvm2 $raidpkg syslinux $fstools $_at_
> }
>
> show_disk_info() {
> _at_@ -614,7 +619,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 +715,7 @@ data_only_disk_install() {
> # setup
> setup_root() {
> local root_dev="$1" boot_dev="$2"
> - mkfs.$ROOTFS -q "$root_dev"
> + mkfs.$ROOTFS $mkfs_args "$root_dev"
> mkdir -p "$SYSROOT"
> mount -t $ROOTFS $root_dev "$SYSROOT" || return 1
> if [ -n "$boot_dev" ]; then



---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Tue Nov 04 2014 - 11:33:22 UTC