Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>remotes/origin/feature_files_export
parent
b142435abd
commit
acc64caf95
@ -0,0 +1,36 @@ |
|||||||
|
#!/bin/sh |
||||||
|
# |
||||||
|
# 2011 Steven Armstrong (steven-cdist at armstrong.cc) |
||||||
|
# |
||||||
|
# This file is part of cdist. |
||||||
|
# |
||||||
|
# cdist is free software: you can redistribute it and/or modify |
||||||
|
# it under the terms of the GNU General Public License as published by |
||||||
|
# the Free Software Foundation, either version 3 of the License, or |
||||||
|
# (at your option) any later version. |
||||||
|
# |
||||||
|
# cdist is distributed in the hope that it will be useful, |
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
# GNU General Public License for more details. |
||||||
|
# |
||||||
|
# You should have received a copy of the GNU General Public License |
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>. |
||||||
|
# |
||||||
|
|
||||||
|
device="(cat "$__object/parameter/device")" |
||||||
|
type="(cat "$__object/parameter/type")" |
||||||
|
|
||||||
|
command="mkfs -t $type" |
||||||
|
|
||||||
|
if [ -f "$__object/parameter/options" ]; then |
||||||
|
options="(cat "$__object/parameter/options")" |
||||||
|
command="$command -o '$options'" |
||||||
|
fi |
||||||
|
command="$command $device" |
||||||
|
if [ -f "$__object/parameter/blocks" ]; then |
||||||
|
blocks="(cat "$__object/parameter/blocks")" |
||||||
|
command="$command $blocks" |
||||||
|
fi |
||||||
|
|
||||||
|
echo "$command" |
@ -0,0 +1,57 @@ |
|||||||
|
cdist-type__mkfs(7) |
||||||
|
=================== |
||||||
|
Steven Armstrong <steven-cdist--@--armstrong.cc> |
||||||
|
|
||||||
|
|
||||||
|
NAME |
||||||
|
---- |
||||||
|
cdist-type__mkfs - build a linux file system |
||||||
|
|
||||||
|
|
||||||
|
DESCRIPTION |
||||||
|
----------- |
||||||
|
This cdist type is a wrapper for the mkfs command. |
||||||
|
|
||||||
|
|
||||||
|
REQUIRED PARAMETERS |
||||||
|
------------------- |
||||||
|
type:: |
||||||
|
The filesystem type to use. Same as mkfs -t. |
||||||
|
|
||||||
|
|
||||||
|
OPTIONAL PARAMETERS |
||||||
|
------------------- |
||||||
|
device:: |
||||||
|
defaults to object_id |
||||||
|
|
||||||
|
options:: |
||||||
|
file system-specific options to be passed to the mkfs command |
||||||
|
|
||||||
|
blocks:: |
||||||
|
the number of blocks to be used for the file system |
||||||
|
|
||||||
|
|
||||||
|
EXAMPLES |
||||||
|
-------- |
||||||
|
|
||||||
|
-------------------------------------------------------------------------------- |
||||||
|
# reiserfs /dev/sda5 |
||||||
|
__mkfs /dev/sda5 --type reiserfs |
||||||
|
# same thing with explicit device |
||||||
|
__mkfs whatever --device /dev/sda5 --type reiserfs |
||||||
|
|
||||||
|
# jfs with journal on /dev/sda2 |
||||||
|
__mkfs /dev/sda1 --type jfs --options "-j /dev/sda2" |
||||||
|
-------------------------------------------------------------------------------- |
||||||
|
|
||||||
|
|
||||||
|
SEE ALSO |
||||||
|
-------- |
||||||
|
- cdist-type(7) |
||||||
|
- mkfs(8) |
||||||
|
|
||||||
|
|
||||||
|
COPYING |
||||||
|
------- |
||||||
|
Copyright \(C) 2011 Steven Armstrong. Free use of this software is |
||||||
|
granted under the terms of the GNU General Public License version 3 (GPLv3). |
@ -0,0 +1,31 @@ |
|||||||
|
#!/bin/sh |
||||||
|
# |
||||||
|
# 2011 Steven Armstrong (steven-cdist at armstrong.cc) |
||||||
|
# |
||||||
|
# This file is part of cdist. |
||||||
|
# |
||||||
|
# cdist is free software: you can redistribute it and/or modify |
||||||
|
# it under the terms of the GNU General Public License as published by |
||||||
|
# the Free Software Foundation, either version 3 of the License, or |
||||||
|
# (at your option) any later version. |
||||||
|
# |
||||||
|
# cdist is distributed in the hope that it will be useful, |
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
# GNU General Public License for more details. |
||||||
|
# |
||||||
|
# You should have received a copy of the GNU General Public License |
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>. |
||||||
|
# |
||||||
|
|
||||||
|
# set defaults |
||||||
|
if [ -f "$__object/parameter/device" ]; then |
||||||
|
device="(cat "$__object/parameter/device")" |
||||||
|
else |
||||||
|
device="/$__object_id" |
||||||
|
echo "$device" > "$__object/parameter/device" |
||||||
|
fi |
||||||
|
|
||||||
|
type="(cat "$__object/parameter/type")" |
||||||
|
|
||||||
|
options="(cat "$__object/parameter/options")" |
@ -0,0 +1,3 @@ |
|||||||
|
device |
||||||
|
options |
||||||
|
blocks |
@ -0,0 +1 @@ |
|||||||
|
type |
Loading…
Reference in new issue