Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

imaginator "expected integer" error while building the bootstrap image #448

Description

@masiulaniec
# cat /var/log/imaginator/2018-05-21:15:16:13.994
2018/05/21 15:16:14 Building new image for stream: bootstrap/Debian-9
2018/05/21 15:21:30 Error building image: bootstrap/Debian-9: expected integer
# 

The following patch works around it:

diff -purN imagebuilder/builder/bootstrapImage.go imagebuilder/builder/bootstrapImage.go
--- imagebuilder/builder/bootstrapImage.go	2018-05-21 15:50:22.388786285 +0000
+++ imagebuilder/builder/bootstrapImage.go	2018-05-21 15:50:59.807545192 +0000
@@ -117,8 +117,8 @@ func (packager *packagerType) writePacka
 func (packager *packagerType) writePackageInstallerContents(writer io.Writer) {
 	fmt.Fprintln(writer, "#! /bin/sh")
 	fmt.Fprintln(writer, "# Created by imaginator.")
-	fmt.Fprintln(writer, "mount -n none -t proc /proc")
-	fmt.Fprintln(writer, "mount -n none -t sysfs /sys")
+	fmt.Fprintln(writer, "mount -n none -t proc /proc 2>/dev/null")
+	fmt.Fprintln(writer, "mount -n none -t sysfs /sys 2>/dev/null")
 	for _, line := range packager.Verbatim {
 		fmt.Fprintln(writer, line)
 	}

The error is due to fmt.Fscanf in (*bootstrapStream).build:

	output := new(bytes.Buffer)
	err := runInTarget(nil, output, rootDir, packagerPathname,
		"show-size-multiplier")
	if err != nil {
		return nil, err
	}
	sizeMultiplier := uint64(1)
	nScanned, err := fmt.Fscanf(output, "%d", &sizeMultiplier)

... trying to parse the following error from mount as an integer:

mount: none is already mounted or /sys busy
       none is already mounted on /proc
       none is already mounted on /sys
       none is already mounted on /proc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions