[OE-core] [PATCH V4 02/10] use a uniform way to determine whether rootfs is read-only
ChenQi
Qi.Chen at windriver.com
Thu Aug 8 02:17:06 UTC 2013
On 08/08/2013 04:29 AM, Otavio Salvador wrote:
> On Wed, Aug 7, 2013 at 5:08 AM, <Qi.Chen at windriver.com> wrote:
> ...
>> --- a/meta/recipes-core/initscripts/initscripts-1.0/functions
>> +++ b/meta/recipes-core/initscripts/initscripts-1.0/functions
>> @@ -58,3 +58,17 @@ status() {
>> fi
>> return 3
>> }
>> +
>> +# Determine whether rootfs is read-only or not according to /proc/mounts or /etc/fstab.
>> +is_rootfs_readonly () {
>> + local DIRNAME=`dirname $0`
>> + local ROOT_DIR=`echo $DIRNAME | sed -ne 's:/etc/.*::p'`
>> + local criteria_file
>> + [ -n "$ROOT_DIR" ] && criteria_file="$ROOT_DIR/etc/fstab" || criteria_file="/proc/mounts"
>> + local flag
>> + for flag in `awk '{ if ($2 == "/") { split($4,FLAGS,",") } }; END { for (f in FLAGS) print FLAGS[f] }' < $criteria_file`; do
>> + [ "$flag" = "ro" ] && { echo "yes"; return 0; }
>> + done
>> + echo "no"
>> + return 0
>> +}
>> \ No newline at end of file
> Please fix this.
>
Thanks for pointing it out.
Remote branch has been updated :)
Best Regards,
Chen Qi
More information about the Openembedded-core
mailing list