workround for init=/bin/bash only on upstream images
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 17 Sep 2010 22:00:49 +0000 (22:00 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 17 Sep 2010 22:00:49 +0000 (22:00 +0000)
if we remastered squashfs, using bin/squashfs-overlay.sh
then this isn't problem so we don't insert init

lib/PXElator/config.pm

index 0fa0ea3..ce56653 100644 (file)
@@ -44,14 +44,20 @@ sub debian_live {
 
        my $hostname = client::conf( $ip => 'hostname' ) || 'debian-live';
 
-       # FIXME drop in shell because we can't create user
+       # FIXME drop in shell because users doesn't work in current image
+       my $custom_init = 'init=/bin/hash';
+
+       if ( my $custom_squashfs = client::conf( $ip => 'squashfs' ) ) {
+               $squashfs = $custom_squashfs;
+               $custom_init = '';
+       }
 
        pxelinux::config_for_ip( $ip, qq{
 
 default debian_live
 label debian_live
        kernel $vmlinuz
-       append initrd=$initrd fetch=http://$server_ip:7777/debian_live/$squashfs boot=live nopersistent hostname=$hostname union=aufs noprompt autologin username=user debug init=/bin/bash
+       append initrd=$initrd fetch=http://$server_ip:7777/debian_live/$squashfs boot=live nopersistent hostname=$hostname union=aufs noprompt autologin username=user debug $custom_init
        });
 
 }