* [PATCH] add default values in fstab_lines
@ 2014-02-14 8:49 Dave Young
[not found] ` <20140214084921.GA30064-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Dave Young @ 2014-02-14 8:49 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA, vgoyal-H+wXaHxf7aLQT0dZR+AlfA,
initramfs-u79uwXL29TY76Z2rM5mHXA
It's useful for passing a full fstab line including like fs_passno so fsck
can take effect.
Previously it's assumed that there's no fs_freq and fs_passno in fstab lines
so original code just append "0 0" at the end of each fstab lines.
Improve this issue by assign default value in case they are not passed in.
Three field are handled here:
fs_mntops: default to "defaults"
fs_freq: default to "0"
fs_passno: default to "0"
Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
dracut.8.asc | 8 ++++++--
dracut.sh | 6 +++++-
2 files changed, 11 insertions(+), 3 deletions(-)
--- dracut.orig/dracut.sh
+++ dracut/dracut.sh
@@ -1222,7 +1222,11 @@ if [[ $kernel_only != yes ]]; then
[[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
while pop fstab_lines line; do
- printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab"
+ line=($line)
+ [ -z "${line[3]}" ] && line[3]="defaults"
+ [ -z "${line[4]}" ] && line[4]="0"
+ [ -z "${line[5]}" ] && line[5]="0"
+ echo "${line[@]}" >> "${initdir}/etc/fstab"
done
for f in $add_fstab; do
--- dracut.orig/dracut.8.asc
+++ dracut/dracut.8.asc
@@ -311,9 +311,13 @@ provide a valid _/etc/fstab_.
**--add-fstab** _<filename>_::
Add entries of _<filename>_ to the initramfs /etc/fstab.
-**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_"::
+**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_ _<dump options>_ _<fsck order>_"::
Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
- options>_ in the initramfs
+ options>_ in the initramfs. _<dump options>_ and _<fsck order>_ can also be
+ specified, see fstab manpage for the details.
+ The default _<filesystem options>_ is "defaults".
+ The default _<dump options>_ is "0".
+ the default _<fsck order>_ is "2".
**--add-device** _<device>_ ::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
^ permalink raw reply [flat|nested] 10+ messages in thread[parent not found: <20140214084921.GA30064-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>]
* Re: [PATCH] add default values in fstab_lines [not found] ` <20140214084921.GA30064-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org> @ 2014-02-17 15:55 ` Vivek Goyal [not found] ` <20140217155512.GG11670-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 2014-02-24 1:54 ` Dave Young 1 sibling, 1 reply; 10+ messages in thread From: Vivek Goyal @ 2014-02-17 15:55 UTC (permalink / raw) To: Dave Young Cc: harald-H+wXaHxf7aLQT0dZR+AlfA, initramfs-u79uwXL29TY76Z2rM5mHXA On Fri, Feb 14, 2014 at 04:49:21PM +0800, Dave Young wrote: > It's useful for passing a full fstab line including like fs_passno so fsck > can take effect. > > Previously it's assumed that there's no fs_freq and fs_passno in fstab lines > so original code just append "0 0" at the end of each fstab lines. > > Improve this issue by assign default value in case they are not passed in. > Three field are handled here: > fs_mntops: default to "defaults" > fs_freq: default to "0" > fs_passno: default to "0" > > Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > --- > dracut.8.asc | 8 ++++++-- > dracut.sh | 6 +++++- > 2 files changed, 11 insertions(+), 3 deletions(-) > > --- dracut.orig/dracut.sh > +++ dracut/dracut.sh > @@ -1222,7 +1222,11 @@ if [[ $kernel_only != yes ]]; then > [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf" > > while pop fstab_lines line; do > - printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" > + line=($line) > + [ -z "${line[3]}" ] && line[3]="defaults" > + [ -z "${line[4]}" ] && line[4]="0" > + [ -z "${line[5]}" ] && line[5]="0" > + echo "${line[@]}" >> "${initdir}/etc/fstab" > done > > for f in $add_fstab; do > --- dracut.orig/dracut.8.asc > +++ dracut/dracut.8.asc > @@ -311,9 +311,13 @@ provide a valid _/etc/fstab_. > **--add-fstab** _<filename>_:: > Add entries of _<filename>_ to the initramfs /etc/fstab. > > -**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_":: > +**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_ _<dump options>_ _<fsck order>_":: > Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem > - options>_ in the initramfs > + options>_ in the initramfs. _<dump options>_ and _<fsck order>_ can also be How do you differentiate between filesystem options and dump option? IOW, what is used as separator so that dracut and find out what is a a filesystem option and what is a dump option or pass number option? > + specified, see fstab manpage for the details. > + The default _<filesystem options>_ is "defaults". > + The default _<dump options>_ is "0". > + the default _<fsck order>_ is "2". In changelog you said default is 0 and not 2. Also I personally like to use fs_freq and fs_passno field in description as they are known in fstab instead of coming up with new names "dump options" and fsck order" Thanks Vivek ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <20140217155512.GG11670-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] add default values in fstab_lines [not found] ` <20140217155512.GG11670-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2014-02-18 5:19 ` Dave Young [not found] ` <20140218051946.GB3123-je1gSBvt1Tc/CGXRbJeUwh/sF2h8X+2i0E9HWUfgJXw@public.gmane.org> 0 siblings, 1 reply; 10+ messages in thread From: Dave Young @ 2014-02-18 5:19 UTC (permalink / raw) To: Vivek Goyal Cc: harald-H+wXaHxf7aLQT0dZR+AlfA, initramfs-u79uwXL29TY76Z2rM5mHXA On 02/17/14 at 10:55am, Vivek Goyal wrote: > On Fri, Feb 14, 2014 at 04:49:21PM +0800, Dave Young wrote: > > It's useful for passing a full fstab line including like fs_passno so fsck > > can take effect. > > > > Previously it's assumed that there's no fs_freq and fs_passno in fstab lines > > so original code just append "0 0" at the end of each fstab lines. > > > > Improve this issue by assign default value in case they are not passed in. > > Three field are handled here: > > fs_mntops: default to "defaults" > > fs_freq: default to "0" > > fs_passno: default to "0" > > > > Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > > --- > > dracut.8.asc | 8 ++++++-- > > dracut.sh | 6 +++++- > > 2 files changed, 11 insertions(+), 3 deletions(-) > > > > --- dracut.orig/dracut.sh > > +++ dracut/dracut.sh > > @@ -1222,7 +1222,11 @@ if [[ $kernel_only != yes ]]; then > > [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf" > > > > while pop fstab_lines line; do > > - printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" > > + line=($line) > > + [ -z "${line[3]}" ] && line[3]="defaults" > > + [ -z "${line[4]}" ] && line[4]="0" > > + [ -z "${line[5]}" ] && line[5]="0" > > + echo "${line[@]}" >> "${initdir}/etc/fstab" > > done > > > > for f in $add_fstab; do > > --- dracut.orig/dracut.8.asc > > +++ dracut/dracut.8.asc > > @@ -311,9 +311,13 @@ provide a valid _/etc/fstab_. > > **--add-fstab** _<filename>_:: > > Add entries of _<filename>_ to the initramfs /etc/fstab. > > > > -**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_":: > > +**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_ _<dump options>_ _<fsck order>_":: > > Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem > > - options>_ in the initramfs > > + options>_ in the initramfs. _<dump options>_ and _<fsck order>_ can also be > > How do you differentiate between filesystem options and dump option? IOW, > what is used as separator so that dracut and find out what is a a > filesystem option and what is a dump option or pass number option? It should be same as fstab format, use space or tab to seperate them. > > > > + specified, see fstab manpage for the details. > > + The default _<filesystem options>_ is "defaults". > > + The default _<dump options>_ is "0". > > + the default _<fsck order>_ is "2". > > In changelog you said default is 0 and not 2. Also I personally like to > use fs_freq and fs_passno field in description as they are known in fstab > instead of coming up with new names "dump options" and fsck order" The one in patch description is a typo, will resend. For the field description, because the device, mountpoint and filesystem type etc. are using names which are more descriptive so I select to use "dump options" and "fsck order", just got the meaning from fstab(5). But yes, the "dump options" is not good, maybe "dump frequency" or just moving all the fields to "fs_*" Thanks Dave ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <20140218051946.GB3123-je1gSBvt1Tc/CGXRbJeUwh/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>]
* Re: [PATCH] add default values in fstab_lines [not found] ` <20140218051946.GB3123-je1gSBvt1Tc/CGXRbJeUwh/sF2h8X+2i0E9HWUfgJXw@public.gmane.org> @ 2014-02-18 13:29 ` Vivek Goyal 0 siblings, 0 replies; 10+ messages in thread From: Vivek Goyal @ 2014-02-18 13:29 UTC (permalink / raw) To: Dave Young Cc: harald-H+wXaHxf7aLQT0dZR+AlfA, initramfs-u79uwXL29TY76Z2rM5mHXA On Tue, Feb 18, 2014 at 01:19:46PM +0800, Dave Young wrote: > On 02/17/14 at 10:55am, Vivek Goyal wrote: > > On Fri, Feb 14, 2014 at 04:49:21PM +0800, Dave Young wrote: > > > It's useful for passing a full fstab line including like fs_passno so fsck > > > can take effect. > > > > > > Previously it's assumed that there's no fs_freq and fs_passno in fstab lines > > > so original code just append "0 0" at the end of each fstab lines. > > > > > > Improve this issue by assign default value in case they are not passed in. > > > Three field are handled here: > > > fs_mntops: default to "defaults" > > > fs_freq: default to "0" > > > fs_passno: default to "0" > > > > > > Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > > > --- > > > dracut.8.asc | 8 ++++++-- > > > dracut.sh | 6 +++++- > > > 2 files changed, 11 insertions(+), 3 deletions(-) > > > > > > --- dracut.orig/dracut.sh > > > +++ dracut/dracut.sh > > > @@ -1222,7 +1222,11 @@ if [[ $kernel_only != yes ]]; then > > > [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf" > > > > > > while pop fstab_lines line; do > > > - printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" > > > + line=($line) > > > + [ -z "${line[3]}" ] && line[3]="defaults" > > > + [ -z "${line[4]}" ] && line[4]="0" > > > + [ -z "${line[5]}" ] && line[5]="0" > > > + echo "${line[@]}" >> "${initdir}/etc/fstab" > > > done > > > > > > for f in $add_fstab; do > > > --- dracut.orig/dracut.8.asc > > > +++ dracut/dracut.8.asc > > > @@ -311,9 +311,13 @@ provide a valid _/etc/fstab_. > > > **--add-fstab** _<filename>_:: > > > Add entries of _<filename>_ to the initramfs /etc/fstab. > > > > > > -**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_":: > > > +**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_ _<dump options>_ _<fsck order>_":: > > > Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem > > > - options>_ in the initramfs > > > + options>_ in the initramfs. _<dump options>_ and _<fsck order>_ can also be > > > > How do you differentiate between filesystem options and dump option? IOW, > > what is used as separator so that dracut and find out what is a a > > filesystem option and what is a dump option or pass number option? > > It should be same as fstab format, use space or tab to seperate them. Ok, so filesystem options have to be comma separated. This was not clear from man page to me. I checked it on my system and we are passing comma separated filesystem options. dracut --hostonly -o 'plymouth dash' --mount '/dev/disk/by-uuid/87faf930-fd28-49e0-8b0f-d775141e7f59 /mnt/wd-ssd1 ext4 rw,relatime,seclabel,data=ordered,nofail' -f /boot/initramfs-3.14.0-rc1+kdump.img 3.14.0-rc1+ If that's the case, then this approach should work. Thanks Vivek ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] add default values in fstab_lines [not found] ` <20140214084921.GA30064-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org> 2014-02-17 15:55 ` Vivek Goyal @ 2014-02-24 1:54 ` Dave Young [not found] ` <20140224015457.GA4043-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org> 1 sibling, 1 reply; 10+ messages in thread From: Dave Young @ 2014-02-24 1:54 UTC (permalink / raw) To: harald-H+wXaHxf7aLQT0dZR+AlfA, vgoyal-H+wXaHxf7aLQT0dZR+AlfA, initramfs-u79uwXL29TY76Z2rM5mHXA On 02/14/14 at 04:49pm, Dave Young wrote: > It's useful for passing a full fstab line including like fs_passno so fsck > can take effect. > > Previously it's assumed that there's no fs_freq and fs_passno in fstab lines > so original code just append "0 0" at the end of each fstab lines. > > Improve this issue by assign default value in case they are not passed in. > Three field are handled here: > fs_mntops: default to "defaults" > fs_freq: default to "0" > fs_passno: default to "0" > > Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > --- > dracut.8.asc | 8 ++++++-- > dracut.sh | 6 +++++- > 2 files changed, 11 insertions(+), 3 deletions(-) > > --- dracut.orig/dracut.sh > +++ dracut/dracut.sh > @@ -1222,7 +1222,11 @@ if [[ $kernel_only != yes ]]; then > [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf" > > while pop fstab_lines line; do > - printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" > + line=($line) > + [ -z "${line[3]}" ] && line[3]="defaults" > + [ -z "${line[4]}" ] && line[4]="0" > + [ -z "${line[5]}" ] && line[5]="0" > + echo "${line[@]}" >> "${initdir}/etc/fstab" > done > > for f in $add_fstab; do > --- dracut.orig/dracut.8.asc > +++ dracut/dracut.8.asc > @@ -311,9 +311,13 @@ provide a valid _/etc/fstab_. > **--add-fstab** _<filename>_:: > Add entries of _<filename>_ to the initramfs /etc/fstab. > > -**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_":: > +**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_ _<dump options>_ _<fsck order>_":: > Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem > - options>_ in the initramfs > + options>_ in the initramfs. _<dump options>_ and _<fsck order>_ can also be > + specified, see fstab manpage for the details. > + The default _<filesystem options>_ is "defaults". > + The default _<dump options>_ is "0". > + the default _<fsck order>_ is "2". > > **--add-device** _<device>_ :: > Bring up _<device>_ in initramfs, _<device>_ should be the device name. Hi, Harald What's your opinion about this? Could you review it? Thanks Dave ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <20140224015457.GA4043-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>]
* Re: [PATCH] add default values in fstab_lines [not found] ` <20140224015457.GA4043-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org> @ 2014-02-26 14:08 ` Harald Hoyer [not found] ` <530DF559.70404-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 10+ messages in thread From: Harald Hoyer @ 2014-02-26 14:08 UTC (permalink / raw) To: Dave Young, vgoyal-H+wXaHxf7aLQT0dZR+AlfA, initramfs-u79uwXL29TY76Z2rM5mHXA On 02/24/2014 02:54 AM, Dave Young wrote: > On 02/14/14 at 04:49pm, Dave Young wrote: >> It's useful for passing a full fstab line including like fs_passno so fsck >> can take effect. >> >> Previously it's assumed that there's no fs_freq and fs_passno in fstab lines >> so original code just append "0 0" at the end of each fstab lines. >> >> Improve this issue by assign default value in case they are not passed in. >> Three field are handled here: >> fs_mntops: default to "defaults" >> fs_freq: default to "0" >> fs_passno: default to "0" >> >> Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> >> --- >> dracut.8.asc | 8 ++++++-- >> dracut.sh | 6 +++++- >> 2 files changed, 11 insertions(+), 3 deletions(-) >> >> --- dracut.orig/dracut.sh >> +++ dracut/dracut.sh >> @@ -1222,7 +1222,11 @@ if [[ $kernel_only != yes ]]; then >> [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf" >> >> while pop fstab_lines line; do >> - printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" >> + line=($line) >> + [ -z "${line[3]}" ] && line[3]="defaults" >> + [ -z "${line[4]}" ] && line[4]="0" >> + [ -z "${line[5]}" ] && line[5]="0" >> + echo "${line[@]}" >> "${initdir}/etc/fstab" >> done >> >> for f in $add_fstab; do >> --- dracut.orig/dracut.8.asc >> +++ dracut/dracut.8.asc >> @@ -311,9 +311,13 @@ provide a valid _/etc/fstab_. >> **--add-fstab** _<filename>_:: >> Add entries of _<filename>_ to the initramfs /etc/fstab. >> >> -**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_":: >> +**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_ _<dump options>_ _<fsck order>_":: >> Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem >> - options>_ in the initramfs >> + options>_ in the initramfs. _<dump options>_ and _<fsck order>_ can also be >> + specified, see fstab manpage for the details. >> + The default _<filesystem options>_ is "defaults". >> + The default _<dump options>_ is "0". >> + the default _<fsck order>_ is "2". >> >> **--add-device** _<device>_ :: >> Bring up _<device>_ in initramfs, _<device>_ should be the device name. > > Hi, Harald > > What's your opinion about this? Could you review it? > > Thanks > Dave Looks good.. So what should be the default fsck order? 0 or 2? ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <530DF559.70404-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] add default values in fstab_lines [not found] ` <530DF559.70404-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2014-02-26 14:09 ` Harald Hoyer [not found] ` <530DF5B6.6070309-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 2014-02-27 1:40 ` Dave Young 1 sibling, 1 reply; 10+ messages in thread From: Harald Hoyer @ 2014-02-26 14:09 UTC (permalink / raw) To: Dave Young, vgoyal-H+wXaHxf7aLQT0dZR+AlfA, initramfs-u79uwXL29TY76Z2rM5mHXA On 02/26/2014 03:08 PM, Harald Hoyer wrote: > On 02/24/2014 02:54 AM, Dave Young wrote: >>> -**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_":: >>> +**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_ _<dump options>_ _<fsck order>_":: maybe ... [_<filesystem options>_ [_<dump options>_ [_<fsck order>_]]]":: to indicate that they are optional ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <530DF5B6.6070309-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] add default values in fstab_lines [not found] ` <530DF5B6.6070309-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2014-02-27 1:41 ` Dave Young 0 siblings, 0 replies; 10+ messages in thread From: Dave Young @ 2014-02-27 1:41 UTC (permalink / raw) To: Harald Hoyer Cc: vgoyal-H+wXaHxf7aLQT0dZR+AlfA, initramfs-u79uwXL29TY76Z2rM5mHXA On 02/26/14 at 03:09pm, Harald Hoyer wrote: > On 02/26/2014 03:08 PM, Harald Hoyer wrote: > > On 02/24/2014 02:54 AM, Dave Young wrote: > >>> -**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_":: > >>> +**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_ _<dump options>_ _<fsck order>_":: > > maybe > > ... [_<filesystem options>_ [_<dump options>_ [_<fsck order>_]]]":: > > to indicate that they are optional Good suggestion, thanks. I will also change "dump options" to "dump frequency" as frequency is a little better. Thanks Dave ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] add default values in fstab_lines [not found] ` <530DF559.70404-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 2014-02-26 14:09 ` Harald Hoyer @ 2014-02-27 1:40 ` Dave Young [not found] ` <20140227014032.GA2338-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org> 1 sibling, 1 reply; 10+ messages in thread From: Dave Young @ 2014-02-27 1:40 UTC (permalink / raw) To: Harald Hoyer Cc: vgoyal-H+wXaHxf7aLQT0dZR+AlfA, initramfs-u79uwXL29TY76Z2rM5mHXA On 02/26/14 at 03:08pm, Harald Hoyer wrote: > On 02/24/2014 02:54 AM, Dave Young wrote: > > On 02/14/14 at 04:49pm, Dave Young wrote: > >> It's useful for passing a full fstab line including like fs_passno so fsck > >> can take effect. > >> > >> Previously it's assumed that there's no fs_freq and fs_passno in fstab lines > >> so original code just append "0 0" at the end of each fstab lines. > >> > >> Improve this issue by assign default value in case they are not passed in. > >> Three field are handled here: > >> fs_mntops: default to "defaults" > >> fs_freq: default to "0" > >> fs_passno: default to "0" > >> > >> Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > >> --- > >> dracut.8.asc | 8 ++++++-- > >> dracut.sh | 6 +++++- > >> 2 files changed, 11 insertions(+), 3 deletions(-) > >> > >> --- dracut.orig/dracut.sh > >> +++ dracut/dracut.sh > >> @@ -1222,7 +1222,11 @@ if [[ $kernel_only != yes ]]; then > >> [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf" > >> > >> while pop fstab_lines line; do > >> - printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" > >> + line=($line) > >> + [ -z "${line[3]}" ] && line[3]="defaults" > >> + [ -z "${line[4]}" ] && line[4]="0" > >> + [ -z "${line[5]}" ] && line[5]="0" > >> + echo "${line[@]}" >> "${initdir}/etc/fstab" > >> done > >> > >> for f in $add_fstab; do > >> --- dracut.orig/dracut.8.asc > >> +++ dracut/dracut.8.asc > >> @@ -311,9 +311,13 @@ provide a valid _/etc/fstab_. > >> **--add-fstab** _<filename>_:: > >> Add entries of _<filename>_ to the initramfs /etc/fstab. > >> > >> -**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_":: > >> +**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_ _<dump options>_ _<fsck order>_":: > >> Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem > >> - options>_ in the initramfs > >> + options>_ in the initramfs. _<dump options>_ and _<fsck order>_ can also be > >> + specified, see fstab manpage for the details. > >> + The default _<filesystem options>_ is "defaults". > >> + The default _<dump options>_ is "0". > >> + the default _<fsck order>_ is "2". > >> > >> **--add-device** _<device>_ :: > >> Bring up _<device>_ in initramfs, _<device>_ should be the device name. > > > > Hi, Harald > > > > What's your opinion about this? Could you review it? > > > > Thanks > > Dave > > Looks good.. So what should be the default fsck order? 0 or 2? > I would prefer 2, but 0 is also fine as user can specify 2 when they pass --mount. Thanks Dave ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <20140227014032.GA2338-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>]
* Re: [PATCH] add default values in fstab_lines [not found] ` <20140227014032.GA2338-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org> @ 2014-02-27 2:23 ` Dave Young 0 siblings, 0 replies; 10+ messages in thread From: Dave Young @ 2014-02-27 2:23 UTC (permalink / raw) To: Harald Hoyer Cc: vgoyal-H+wXaHxf7aLQT0dZR+AlfA, initramfs-u79uwXL29TY76Z2rM5mHXA On 02/27/14 at 09:40am, Dave Young wrote: > On 02/26/14 at 03:08pm, Harald Hoyer wrote: > > On 02/24/2014 02:54 AM, Dave Young wrote: > > > On 02/14/14 at 04:49pm, Dave Young wrote: > > >> It's useful for passing a full fstab line including like fs_passno so fsck > > >> can take effect. > > >> > > >> Previously it's assumed that there's no fs_freq and fs_passno in fstab lines > > >> so original code just append "0 0" at the end of each fstab lines. > > >> > > >> Improve this issue by assign default value in case they are not passed in. > > >> Three field are handled here: > > >> fs_mntops: default to "defaults" > > >> fs_freq: default to "0" > > >> fs_passno: default to "0" > > >> > > >> Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > > >> --- > > >> dracut.8.asc | 8 ++++++-- > > >> dracut.sh | 6 +++++- > > >> 2 files changed, 11 insertions(+), 3 deletions(-) > > >> > > >> --- dracut.orig/dracut.sh > > >> +++ dracut/dracut.sh > > >> @@ -1222,7 +1222,11 @@ if [[ $kernel_only != yes ]]; then > > >> [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf" > > >> > > >> while pop fstab_lines line; do > > >> - printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" > > >> + line=($line) > > >> + [ -z "${line[3]}" ] && line[3]="defaults" > > >> + [ -z "${line[4]}" ] && line[4]="0" > > >> + [ -z "${line[5]}" ] && line[5]="0" > > >> + echo "${line[@]}" >> "${initdir}/etc/fstab" > > >> done > > >> > > >> for f in $add_fstab; do > > >> --- dracut.orig/dracut.8.asc > > >> +++ dracut/dracut.8.asc > > >> @@ -311,9 +311,13 @@ provide a valid _/etc/fstab_. > > >> **--add-fstab** _<filename>_:: > > >> Add entries of _<filename>_ to the initramfs /etc/fstab. > > >> > > >> -**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_":: > > >> +**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_ _<dump options>_ _<fsck order>_":: > > >> Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem > > >> - options>_ in the initramfs > > >> + options>_ in the initramfs. _<dump options>_ and _<fsck order>_ can also be > > >> + specified, see fstab manpage for the details. > > >> + The default _<filesystem options>_ is "defaults". > > >> + The default _<dump options>_ is "0". > > >> + the default _<fsck order>_ is "2". > > >> > > >> **--add-device** _<device>_ :: > > >> Bring up _<device>_ in initramfs, _<device>_ should be the device name. > > > > > > Hi, Harald > > > > > > What's your opinion about this? Could you review it? > > > > > > Thanks > > > Dave > > > > Looks good.. So what should be the default fsck order? 0 or 2? > > > > I would prefer 2, but 0 is also fine as user can specify 2 when they pass --mount. The order is 0 in the code, but it's 2 in manpage, rethinking about it I will update the code to use 2. Thanks Dave ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-02-27 2:23 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14 8:49 [PATCH] add default values in fstab_lines Dave Young
[not found] ` <20140214084921.GA30064-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2014-02-17 15:55 ` Vivek Goyal
[not found] ` <20140217155512.GG11670-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-02-18 5:19 ` Dave Young
[not found] ` <20140218051946.GB3123-je1gSBvt1Tc/CGXRbJeUwh/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2014-02-18 13:29 ` Vivek Goyal
2014-02-24 1:54 ` Dave Young
[not found] ` <20140224015457.GA4043-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2014-02-26 14:08 ` Harald Hoyer
[not found] ` <530DF559.70404-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-02-26 14:09 ` Harald Hoyer
[not found] ` <530DF5B6.6070309-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-02-27 1:41 ` Dave Young
2014-02-27 1:40 ` Dave Young
[not found] ` <20140227014032.GA2338-je1gSBvt1TcFLmT5oZ11vB/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2014-02-27 2:23 ` Dave Young
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.