From 133c2610d1ba73d54411ebc184ffc2e5130bbb46 Mon Sep 17 00:00:00 2001 From: Josh Curl Date: Sun, 25 Sep 2016 11:39:46 -0700 Subject: [PATCH] Remove rancher.state.formatzero kernel parameter --- config/types.go | 1 - images/02-autoformat/auto-format.sh | 6 ------ init/bootstrap.go | 4 +--- scripts/run | 2 +- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/config/types.go b/config/types.go index 92af8617..5822877a 100644 --- a/config/types.go +++ b/config/types.go @@ -160,7 +160,6 @@ type StateConfig struct { Wait bool `yaml:"wait,omitempty"` Required bool `yaml:"required,omitempty"` Autoformat []string `yaml:"autoformat,omitempty"` - FormatZero bool `yaml:"formatzero,omitempty"` MdadmScan bool `yaml:"mdadm_scan,omitempty"` Script string `yaml:"script,omitempty"` OemFsType string `yaml:"oem_fstype,omitempty"` diff --git a/images/02-autoformat/auto-format.sh b/images/02-autoformat/auto-format.sh index e56f7c02..48e7994c 100755 --- a/images/02-autoformat/auto-format.sh +++ b/images/02-autoformat/auto-format.sh @@ -2,10 +2,7 @@ set -ex MAGIC=${MAGIC:-"boot2docker, please format-me"} - -AUTOFORMAT=${AUTOFORMAT:-"/dev/sda /dev/vda"} DEVS=(${AUTOFORMAT}) -FORMATZERO=${FORMATZERO:-false} for dev in ${DEVS[@]}; do if [ -b "${dev}" ]; then @@ -16,9 +13,6 @@ for dev in ${DEVS[@]}; do if [ "$HEADER" = "$MAGIC" ]; then # save the preload userdata.tar file dd if=${dev} of=/userdata.tar bs=1 count=8192 - elif [ "${FORMATZERO}" != "true" ]; then - # do not try to guess whether to auto-format a disk beginning with 1MB filled with 00 - continue elif ! od -A d -N 1048576 ${dev} | head -n 3 | diff ./od-1m0 - >/dev/null 2>&1; then # do not auto-format if the disk does not begin with 1MB filled with 00 continue diff --git a/init/bootstrap.go b/init/bootstrap.go index bb0dc92d..9b4f35f1 100644 --- a/init/bootstrap.go +++ b/init/bootstrap.go @@ -3,7 +3,6 @@ package init import ( "syscall" - "fmt" "strings" log "github.com/Sirupsen/logrus" @@ -18,9 +17,8 @@ func autoformat(cfg *config.CloudConfig) (*config.CloudConfig, error) { return cfg, nil } AUTOFORMAT := "AUTOFORMAT=" + strings.Join(cfg.Rancher.State.Autoformat, " ") - FORMATZERO := "FORMATZERO=" + fmt.Sprint(cfg.Rancher.State.FormatZero) t := *cfg - t.Rancher.Autoformat["autoformat"].Environment = []string{AUTOFORMAT, FORMATZERO} + t.Rancher.Autoformat["autoformat"].Environment = []string{AUTOFORMAT} log.Info("Running Autoformat services") _, err := compose.RunServiceSet("autoformat", &t, t.Rancher.Autoformat) return &t, err diff --git a/scripts/run b/scripts/run index 9ce13714..00e738ce 100755 --- a/scripts/run +++ b/scripts/run @@ -83,7 +83,7 @@ fi KERNEL_ARGS="${DEFAULT_KERNEL_ARGS} ${QEMU_APPEND}" if [ "$FORMAT" == "1" ]; then - KERNEL_ARGS="${KERNEL_ARGS} rancher.state.dev=LABEL=RANCHER_STATE rancher.state.formatzero=true rancher.state.autoformat=[/dev/sda,/dev/vda]" + KERNEL_ARGS="${KERNEL_ARGS} rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/sda,/dev/vda]" fi if [ "$RM_USR" == "1" ]; then KERNEL_ARGS="${KERNEL_ARGS} rancher.rm_usr"