Bug 1212152 - virt-builder firstboot-command fails: File name too long
Summary: virt-builder firstboot-command fails: File name too long
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-15 16:24 UTC by Richard W.M. Jones
Modified: 2015-05-13 13:19 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-04-27 15:22:35 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2015-04-15 16:24:49 UTC
Description of problem:

$ virt-builder fedora-21 --firstboot-command '# this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment this is a long comment'
[   1.0] Downloading: http://libguestfs.org/download/builder/fedora-21.xz
[   2.0] Planning how to build this image
[   2.0] Uncompressing
[  13.0] Opening the new disk
[  28.0] Setting a random seed
[...]
virt-builder: error: libguestfs error: internal_write: open: 
/usr/lib/virt-sysprep/scripts/0001---this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment-this-is-a-long-comment: 
File name too long

Version-Release number of selected component (if applicable):

libguestfs-tools-c-1.29.34-1.fc23.x86_64

How reproducible:

100%

Steps to Reproduce:
1. See description above.

Comment 2 Richard W.M. Jones 2015-04-27 15:22:35 UTC
Pushed upstream in 1.29.38.

Comment 3 Kashyap Chamarthy 2015-05-13 13:19:39 UTC
Can confirm 1.29.41 works. Tested with: libguestfs-1.29.41-1.fc23

Test
----

    $ virt-builder fedora-21 \
    [. . .]
        --firstboot-command '
         # Create the user account.
         useradd -m -p "" -G wheel stack
         chage -d 0 stack
         chmod 0755 /home/stack
         mkdir -m 0755 /home/stack/.ssh
         cp /var/tmp/authorized_keys /home/stack/.ssh/
         chown -R stack.stack /home/stack/.ssh
         # Enable some services to not break DevStack restart
         systemctl enable openvswitch mariadb rabbitmq-server httpd
    '

Before applying the fix, tested with '1.28.9-1.fc21'
---------------------------------------------------

[. . .]
virt-builder: error: libguestfs error: internal_write: open: 
/usr/lib/virt-sysprep/scripts/0001---------Create-the-user-account-------useradd--m--p-----G-wheel-stack------chage--d-0-stack------chmod-0755--home-stack------mkdir--m-0755--home-stack--ssh------cp--var-tmp-authorized_keys--home-stack--ssh-------chown--R-stack-stack--home-stack--ssh--------Enable-some-services-to-not-break-DevStack-restart------systemctl-enable-openvswitch-mariadb-rabbitmq-server-httpd-----: 
File name too long
[. . .]


After applying 'libguestfs-1.29.41-1.fc23'
------------------------------------------

The same "--first-command" completes successfully:

    $ virt-builder fedora-21\
    [. . .]
    [1711.0] Installing firstboot command: 
         # Create the user account.
         useradd -m -p "" -G wheel stack
         chage -d 0 stack
         chmod 0755 /home/stack
         mkdir -m 0755 /home/stack/.ssh
         cp /var/tmp/authorized_keys /home/stack/.ssh/
         chown -R stack.stack /home/stack/.ssh
         # Enable some services to not break DevStack restart
         systemctl enable openvswitch mariadb rabbitmq-server httpd
        
    [1711.0] Setting passwords
    [1714.0] SELinux relabelling
    [1714.0] Finishing off
                       Output file: /export/vmimages/devstack1.qcow2
                       Output size: 40.0G
                     Output format: qcow2
                Total usable space: 38.6G
                        Free space: 37.3G (96%)


Note You need to log in before you can comment on or make changes to this bug.