X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from smtp.core-hosting.net (ns1.core-hosting.net [95.130.13.75]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id B85FDDC8376 for ; Mon, 16 Mar 2015 12:20:03 +0000 (UTC) Received: from mail.core-hosting.net (unknown [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.core-hosting.net (Postfix) with ESMTPSA id 13629AA0041 for ; Mon, 16 Mar 2015 13:20:01 +0100 (CET) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_ae4f35396884ec9e719691b3844e1d15" Date: Mon, 16 Mar 2015 14:20:00 +0200 From: Olivier Mauras To: Subject: Re: [alpine-devel] Fw: [alpine-aports] [Patch] mkinitfs - Support for =?UTF-8?Q?root=5Ftype=20and=20root=5Foptions?= Reply-To: Mail-Reply-To: In-Reply-To: <20150316113651.52ba616b@ncopa-desktop.alpinelinux.org> References: <20150316113651.52ba616b@ncopa-desktop.alpinelinux.org> Message-ID: <418ebc36905fc436a830d3d91870d204@core-hosting.net> X-Sender: olivier@mauras.ch User-Agent: Roundcube Webmail/0.7.2 --=_ae4f35396884ec9e719691b3844e1d15 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8 On 2015-03-16 12:36, Natanael Copa wrote: > I am forwarding a patch for mkinitfs from alpine-aports mailing list > for discussion. > > I agree that we want support mounting p9 as root file system from > initramfs. > > I would like to avoid to introduce 2 new boot options: root_type and > root_options. > > Questions: > > Can we implement this without introducing new boot options? > > If not, how does other distros handle this? Do they have other boot > options for it? > > Are we happy with introducing root_type and root_options as boot > options? > > I am open for ideas. > > -nc > > Begin forwarded message: > > Date: Wed, 11 Mar 2015 17:34:33 +0200 > From: Olivier Mauras > To: > Subject: Re: [alpine-aports] [Patch] mkinitfs - Support for root_type and root_options > > As per the discussion with ncopa on IRC, i redid the patch fixing the > tab issue > From e1d6dd700b01003f23725bb7143c7fa7a25b96fc Mon Sep 17 00:00:00 2001 > From: Olivier Mauras > Date: Mon, 2 Mar 2015 11:30:17 +0100 > Subject: Add support for two new options in the cmdline. > - root_type: Let's you specify the type of filesystem for the root fs > - root_options: Let's you specify mount options for the root fs - If > specified, "ro" flag won't be added by default > > This has primarily been setup to be able to boot Alpine guests from a > 9P virtio share and make it easy to change mount options from > libvirt/qemu > > diff --git a/initramfs-init.in b/initramfs-init.in > index fd3e510..9c90406 100755 > --- a/initramfs-init.in > +++ b/initramfs-init.in > @@ -387,8 +387,8 @@ eval set -- `cat /proc/cmdline` > > myopts="alpine_dev autodetect autoraid chart cryptroot cryptdm > debug_init > dma init_args keep_apk_new modules ovl_dev pkgs quiet root_size root > - usbdelay ip alpine_repo apkovl alpine_start splash blacklist > - overlaytmpfs" > + root_type root_options usbdelay ip alpine_repo apkovl alpine_start > + splash blacklist overlaytmpfs" > > for opt; do > case "$opt" in > @@ -551,8 +551,20 @@ if [ -n "$KOPT_root" ]; then > mount -t tmpfs root-tmpfs /media/root-rw > mkdir -p /media/root-rw/work /media/root-rw/root > mount -t overlay -o > lowerdir=/media/root-ro,upperdir=/media/root-rw/root,workdir=/media/root-rw/work > overlayfs $sysroot > + elif [ -n $KOPT_root_type ]; then > + if [ -n $KOPT_root_options ]; then > + root_options="$KOPT_root_options" > + else > + root_options="ro" > + fi > + retry_mount -t $KOPT_root_type -o $root_options $KOPT_root $sysroot > 2>/dev/null > else > - retry_mount -o ro $KOPT_root $sysroot 2>/dev/null > + if [ -n $KOPT_root_options ]; then > + root_options="$KOPT_root_options" > + else > + root_options="ro" > + fi > + retry_mount -o $root_options $KOPT_root $sysroot 2>/dev/null > fi > > eend $? > -- > cgit v0.10.1 > --- > Available here if scrambled: > http://git.mauras.ch/mkinitfs/patch/?id=e1d6dd700b01003f23725bb7143c7fa7a25b96fc > > Regards, > Olivier > > --- > Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org > Help: alpine-devel+help@lists.alpinelinux.org > --- FWIW, RHEL7 implements it in dracut with "root=virtfs:9p_name" I just felt that having the options could be more useful - beyond 9p but i agree, is it needed ? - than hardcoding 9p support :) Olivier --=_ae4f35396884ec9e719691b3844e1d15 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8

On 2015-03-16 12:36, Natanael Copa wrote:

I am forwarding a patch for mkinitfs from alpine-aports mailing list
for discussion.

I agree that we want support mounting p9 as root file system from
initramfs.

I would like to avoid to introduce 2 new boot options: root_type and
root_options.

Questions:

Can we implement this without introducing new boot options?

If not, how does other distros handle this? Do they have other boot
options for it?

Are we happy with introducing root_type and root_options as boot
options?

I am open for ideas.

-nc

Begin forwarded message:

Date: Wed, 11 Mar 2015 17:34:33 +0200
From: Olivier Mauras <olivier@maura=
s.ch>
To: <alpine-aport=
s@lists.alpinelinux.org>
Subject: Re: [alpine-aports] [Patch] mkinitfs - Support for root_type and r=
oot_options


As per the discussion with ncopa on IRC, i redid the patch fixing the=20
tab issue
 From e1d6dd700b01003f23725bb7143c7fa7a25b96fc Mon Sep 17 00:00:00 2001
 From: Olivier Mauras <olivier@maur=
as.ch>
Date: Mon, 2 Mar 2015 11:30:17 +0100
Subject: Add support for two new options in the cmdline.
  - root_type: Let's you specify the type of filesystem for the root fs
  - root_options: Let's you specify mount options for the root fs - If=20
specified, "ro" flag won't be added by default

This has primarily been setup to be able to boot Alpine guests from a=20
9P virtio share and make it easy to change mount options from=20
libvirt/qemu

diff --git a/initramfs-init.in b/initramfs-init.in
index fd3e510..9c90406 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -387,8 +387,8 @@ eval set -- `cat /proc/cmdline`

  myopts=3D"alpine_dev autodetect autoraid chart cryptroot cryptdm=20
debug_init
  	dma init_args keep_apk_new modules ovl_dev pkgs quiet root_size root
-	usbdelay ip alpine_repo apkovl alpine_start splash blacklist
-	overlaytmpfs"
+	root_type root_options usbdelay ip alpine_repo apkovl alpine_start
+	splash blacklist overlaytmpfs"

  for opt; do
  	case "$opt" in
@@ -551,8 +551,20 @@ if [ -n "$KOPT_root" ]; then
  		mount -t tmpfs root-tmpfs /media/root-rw
  		mkdir -p /media/root-rw/work /media/root-rw/root
  		mount -t overlay -o=20
lowerdir=3D/media/root-ro,upperdir=3D/media/root-rw/root,workdir=3D/media/r=
oot-rw/work=20
overlayfs $sysroot
+	elif [ -n $KOPT_root_type ]; then
+		if [ -n $KOPT_root_options ]; then
+			root_options=3D"$KOPT_root_options"
+		else
+			root_options=3D"ro"
+		fi
+		retry_mount -t $KOPT_root_type -o $root_options $KOPT_root $sysroot=20
2>/dev/null =20
  	else
-		retry_mount -o ro $KOPT_root $sysroot 2>/dev/null
+		if [ -n $KOPT_root_options ]; then
+			root_options=3D"$KOPT_root_options"
+		else
+			root_options=3D"ro"
+		fi
+		retry_mount -o $root_options $KOPT_root $sysroot 2>/dev/null
  	fi

  	eend $?
--=20
cgit v0.10.1
---
Available here if scrambled:=20
http://git.mauras.ch/mkinitfs/patch/?id=3De1d6dd700b010=
03f23725bb7143c7fa7a25b96fc


Regards,
Olivier



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         al=
pine-devel+help@lists.alpinelinux.org
---

FWIW, RHEL7 implements it in dracut with "root=3Dvirtfs:9p_name"
I = just felt that having the options could be more useful - beyond 9p but i ag= ree, is it needed ? - than hardcoding 9p support :)


Olivie= r

 
--=_ae4f35396884ec9e719691b3844e1d15-- --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---