{"action":"created","issue":{"url":"https://api.github.com/repos/rear/rear/issues/561","labels_url":"https://api.github.com/repos/rear/rear/issues/561/labels{/name}","comments_url":"https://api.github.com/repos/rear/rear/issues/561/comments","events_url":"https://api.github.com/repos/rear/rear/issues/561/events","html_url":"https://github.com/rear/rear/issues/561","id":60102403,"number":561,"title":"Probably misleadingly written code in 13_include_mount_filesystem_code.sh","user":{"login":"jsmeix","id":1788608,"avatar_url":"https://avatars.githubusercontent.com/u/1788608?v=3","gravatar_id":"","url":"https://api.github.com/users/jsmeix","html_url":"https://github.com/jsmeix","followers_url":"https://api.github.com/users/jsmeix/followers","following_url":"https://api.github.com/users/jsmeix/following{/other_user}","gists_url":"https://api.github.com/users/jsmeix/gists{/gist_id}","starred_url":"https://api.github.com/users/jsmeix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsmeix/subscriptions","organizations_url":"https://api.github.com/users/jsmeix/orgs","repos_url":"https://api.github.com/users/jsmeix/repos","events_url":"https://api.github.com/users/jsmeix/events{/privacy}","received_events_url":"https://api.github.com/users/jsmeix/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rear/rear/labels/cleanup","name":"cleanup","color":"DDDDDD"},{"url":"https://api.github.com/repos/rear/rear/labels/enhancement","name":"enhancement","color":"02e10c"},{"url":"https://api.github.com/repos/rear/rear/labels/waiting%20for%20feedback","name":"waiting for feedback","color":"444444"}],"state":"open","locked":false,"assignee":{"login":"jsmeix","id":1788608,"avatar_url":"https://avatars.githubusercontent.com/u/1788608?v=3","gravatar_id":"","url":"https://api.github.com/users/jsmeix","html_url":"https://github.com/jsmeix","followers_url":"https://api.github.com/users/jsmeix/followers","following_url":"https://api.github.com/users/jsmeix/following{/other_user}","gists_url":"https://api.github.com/users/jsmeix/gists{/gist_id}","starred_url":"https://api.github.com/users/jsmeix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsmeix/subscriptions","organizations_url":"https://api.github.com/users/jsmeix/orgs","repos_url":"https://api.github.com/users/jsmeix/repos","events_url":"https://api.github.com/users/jsmeix/events{/privacy}","received_events_url":"https://api.github.com/users/jsmeix/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/rear/rear/milestones/6","html_url":"https://github.com/rear/rear/milestones/Rear%20v1.18","labels_url":"https://api.github.com/repos/rear/rear/milestones/6/labels","id":650141,"number":6,"title":"Rear v1.18","description":"","creator":{"login":"gdha","id":888633,"avatar_url":"https://avatars.githubusercontent.com/u/888633?v=3","gravatar_id":"","url":"https://api.github.com/users/gdha","html_url":"https://github.com/gdha","followers_url":"https://api.github.com/users/gdha/followers","following_url":"https://api.github.com/users/gdha/following{/other_user}","gists_url":"https://api.github.com/users/gdha/gists{/gist_id}","starred_url":"https://api.github.com/users/gdha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdha/subscriptions","organizations_url":"https://api.github.com/users/gdha/orgs","repos_url":"https://api.github.com/users/gdha/repos","events_url":"https://api.github.com/users/gdha/events{/privacy}","received_events_url":"https://api.github.com/users/gdha/received_events","type":"User","site_admin":false},"open_issues":34,"closed_issues":19,"state":"open","created_at":"2014-05-06T07:33:02Z","updated_at":"2015-11-03T15:20:20Z","due_on":"2016-01-30T23:00:00Z","closed_at":null},"comments":1,"created_at":"2015-03-06T13:36:45Z","updated_at":"2015-11-04T20:41:57Z","closed_at":null,"body":"This is an enhancement/cleanup request for after rear 1.17:\r\n\r\nIn https://github.com/rear/rear/issues/555#issuecomment-76932069 I was mislead by the following code in 13_include_mount_filesystem_code.sh\r\n<pre>\r\n    local fs device mp fstype uuid label attributes\r\n    ## mp: mount point\r\n    read fs device mp fstype uuid label options &lt; &lt;(grep \"^fs.* ${1#fs:} \" \"$LAYOUT_FILE\")\r\n\r\n    label=${label#label=}\r\n    uuid=${uuid#uuid=}\r\n\r\n    # Extract mount options.\r\n    local option mountopts\r\n    for option in $options ; do\r\n        name=${option%%=*}     # options can contain more '=' signs\r\n        value=${option#*=}\r\n\r\n        case $name in\r\n            (options)\r\n                ### Do not mount nodev, as chrooting later on would fail.\r\n                mountopts=${value//nodev/dev}\r\n                ;;\r\n        esac\r\n    done\r\n</pre>\r\n\r\nIt reads the \"fs\" lines and therein field 7 and all further fields are read into the variable options.\r\n\r\nIn the disklayout.conf file a \"fs\" line is of the form\r\n<pre>\r\n# Filesystems (only ext2,ext3,ext4,vfat,xfs,reiserfs,btrfs are supported).\r\n# Format: fs &lt;device&gt; &lt;mountpoint&gt; &lt;fstype&gt; [uuid=&lt;uuid&gt;] [label=&lt;label&gt;] [&lt;attributes&gt;]\r\nfs /dev/cciss/c0d0p1 /boot ext4 uuid=964edbd0-3eb2-4caa-9704-3fca7540ba71 label= blocksize=1024 fragmentsize=1024 reserved_blocks=5% max_mounts=-1 check_interval=0d bytes_per_inode=4047 default_mount_options=user_xattr,acl options=rw,relatime,barrier=1,data=ordered\r\n</pre>\r\n\r\nThis means the variable options does not contain only the \"options=rw,relatime,barrier=1,data=ordered\" but instead the variable options contains all attributes \"fragmentsize=1024 reserved_blocks=5% max_mounts=-1 check_interval=0d bytes_per_inode=4047 default_mount_options=user_xattr,acl options=rw,relatime,barrier=1,data=ordered\".\r\n\r\nTherefore I suggest to rename the variables options and option to attributes and attribute so that the wording in the code matches the comment in disklayout.conf and avoids confusion by multiple meanings of the word \"option(s)\" as follows:\r\n<pre>\r\n    local fs device mp fstype uuid label attributes\r\n    ## mp: mount point\r\n    read fs device mp fstype uuid label attributes &lt; &lt;(grep \"^fs.* ${1#fs:} \" \"$LAYOUT_FILE\")\r\n\r\n    label=${label#label=}\r\n    uuid=${uuid#uuid=}\r\n\r\n    # Extract mount attributes.\r\n    # For example the attributes variable can contain a value like:\r\n    #   reserved_blocks=5% max_mounts=-1 default_mount_options=user_xattr,acl options=rw,relatime,barrier=1,data=ordered\r\n    local attribute mountopts\r\n    for attribute in $attributes ; do\r\n        # an attribute can contain more '=' signs for example \"options=rw,relatime,barrier=1,data=ordered\"\r\n        name=${attribute%%=*}\r\n        value=${attribute#*=}\r\n        case $name in\r\n            (options)\r\n                # The attribute with name \"options\" contains the mount options.\r\n                # Do not mount nodev, as chrooting later on would fail.\r\n                mountopts=${value//nodev/dev}\r\n                ;;\r\n        esac\r\n    done\r\n</pre>\r\n\r\nIf you agree I make a pull request after rear 1.17 was released.\r\n"},"comment":{"url":"https://api.github.com/repos/rear/rear/issues/comments/153856558","html_url":"https://github.com/rear/rear/issues/561#issuecomment-153856558","issue_url":"https://api.github.com/repos/rear/rear/issues/561","id":153856558,"user":{"login":"gdha","id":888633,"avatar_url":"https://avatars.githubusercontent.com/u/888633?v=3","gravatar_id":"","url":"https://api.github.com/users/gdha","html_url":"https://github.com/gdha","followers_url":"https://api.github.com/users/gdha/followers","following_url":"https://api.github.com/users/gdha/following{/other_user}","gists_url":"https://api.github.com/users/gdha/gists{/gist_id}","starred_url":"https://api.github.com/users/gdha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdha/subscriptions","organizations_url":"https://api.github.com/users/gdha/orgs","repos_url":"https://api.github.com/users/gdha/repos","events_url":"https://api.github.com/users/gdha/events{/privacy}","received_events_url":"https://api.github.com/users/gdha/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T20:41:57Z","updated_at":"2015-11-04T20:41:57Z","body":"@jsmeix do you still want to change the variable names? If not, then just close this request.\r\nThank you."}}