View | Details | Raw Unified | Return to bug 211576
Collapse All | Expand All

(-)inst_kickoff.ycp (-31 / +36 lines)
Lines 25-30 Link Here
25
    import "Arch";
25
    import "Arch";
26
    import "FileUtils";
26
    import "FileUtils";
27
    import "ProductFeatures";
27
    import "ProductFeatures";
28
    import "String";
28
29
29
void AcpiToInitrd () {
30
void AcpiToInitrd () {
30
    if (! (Arch::i386 () || Arch::x86_64 () || Arch::ia64 ()))
31
    if (! (Arch::i386 () || Arch::x86_64 () || Arch::ia64 ()))
Lines 47-56 Link Here
47
	string mtab = (string) WFM::Read(.local.string, mtabname);
48
	string mtab = (string) WFM::Read(.local.string, mtabname);
48
49
49
	SCR::Write(.target.string, tmpdir + "/mtab", mtab);
50
	SCR::Write(.target.string, tmpdir + "/mtab", mtab);
50
	SCR::Execute (.target.bash, "/bin/cat " + tmpdir + "/mtab"
51
	SCR::Execute (.target.bash, "/bin/cat "
52
		      + "'" + String::Quote (tmpdir + "/mtab") + "'"
51
		      + " | /bin/sed \"s: " + Installation::destdir
53
		      + " | /bin/sed \"s: " + Installation::destdir
52
		      + "/: /:\"| /bin/sed \"s: " + Installation::destdir
54
		      + "/: /:\"| /bin/sed \"s: " + Installation::destdir
53
		      + ": /:\" > " + Installation::destdir + mtabname);
55
		      + ": /:\" "
56
		      + "> '" + String::Quote (Installation::destdir) + "'" + mtabname);
54
57
55
    }
58
    }
56
59
Lines 62-68 Link Here
62
65
63
	// remove old junk, script is in yast2-update
66
	// remove old junk, script is in yast2-update
64
	SCR::Execute (.target.bash, Directory::ybindir + "/remove_junk " +
67
	SCR::Execute (.target.bash, Directory::ybindir + "/remove_junk " +
65
		      Installation::destdir);
68
		      "'" + String::Quote (Installation::destdir) + "'");
66
69
67
	// possibly remove /usr/share/info/dir
70
	// possibly remove /usr/share/info/dir
68
	if (!Pkg::TargetFileHasOwner ("/usr/share/info/dir"))
71
	if (!Pkg::TargetFileHasOwner ("/usr/share/info/dir"))
Lines 93-100 Link Here
93
96
94
	if (Update::remove_old_backups)
97
	if (Update::remove_old_backups)
95
	{
98
	{
96
	    SCR::Execute (.target.bash, "/bin/rm -f " + Installation::destdir +
99
	    SCR::Execute (.target.bash, "cd '" + String::Quote (Installation::destdir) + "'; " +
97
			  Update::backup_path + "/*-*-*.tar.{gz,bz2}");
100
			    "/bin/rm -f " + Update::backup_path + "/*-*-*.tar.{gz,bz2}");
98
	}
101
	}
99
102
100
	if (true)
103
	if (true)
Lines 115-123 Link Here
115
		num = num + 1;
118
		num = num + 1;
116
	    }
119
	    }
117
120
118
	    if (SCR::Execute (.target.bash, "cd " + Installation::destdir +
121
	    if (SCR::Execute (.target.bash, "cd '" + String::Quote (Installation::destdir) + "'; " +
119
			      " ; /bin/tar czf " + Installation::destdir +
122
			      "/bin/tar czf ." + filename + " " + "var/log/YaST2") != 0)
120
			      filename + " " + "var/log/YaST2") != 0)
121
	    {
123
	    {
122
		y2error ("backup of %1 to %2 failed", Directory::logdir, filename);
124
		y2error ("backup of %1 to %2 failed", Directory::logdir, filename);
123
		// an error popup
125
		// an error popup
Lines 126-133 Link Here
126
	    }
128
	    }
127
	    else
129
	    else
128
	    {
130
	    {
129
		SCR::Execute (.target.bash, "/bin/rm -rf " + Installation::destdir +
131
		SCR::Execute (.target.bash, "cd '" + String::Quote (Installation::destdir) + "'; " +
130
			      "var/log/YaST2/*");
132
		              "/bin/rm -rf var/log/YaST2/*");
131
	    }
133
	    }
132
	}
134
	}
133
135
Lines 151-159 Link Here
151
		    num = num + 1;
153
		    num = num + 1;
152
		}
154
		}
153
155
154
		if (SCR::Execute (.target.bash, "cd " + Installation::destdir +
156
		if (SCR::Execute (.target.bash, "cd '" + String::Quote (Installation::destdir) + "'; " +
155
				  " ; /bin/tar czf " + Installation::destdir +
157
				  "/bin/tar czf ." + filename + " " + "etc/sysconfig") != 0)
156
				  filename + " " + "etc/sysconfig") != 0)
157
		{
158
		{
158
		    y2error ("backup of %1 to %2 failed", "/etc/sysconfig", filename);
159
		    y2error ("backup of %1 to %2 failed", "/etc/sysconfig", filename);
159
		    // an error popup
160
		    // an error popup
Lines 178-187 Link Here
178
		    num = num + 1;
179
		    num = num + 1;
179
		}
180
		}
180
181
181
		if (SCR::Execute (.target.bash, "cd " + Installation::destdir +
182
		if (SCR::Execute (.target.bash, "cd '" + String::Quote (Installation::destdir) + "'; " +
182
				  " ; /bin/tar czf " + Installation::destdir +
183
				  "/bin/tar czf ." + filename + " " +
183
				  filename + " " + "etc/rc.config" + " " +
184
				  "etc/rc.config etc/rc.config.d") != 0)
184
				  "etc/rc.config.d") != 0)
185
		{
185
		{
186
		    y2error ("backup of %1 to %2 failed", "/etc/rc.config", filename);
186
		    y2error ("backup of %1 to %2 failed", "/etc/rc.config", filename);
187
		    // an error popup
187
		    // an error popup
Lines 204-211 Link Here
204
	// have to handle older version in a special case.
204
	// have to handle older version in a special case.
205
205
206
	string idfile = (string) SCR::Read(.target.tmpdir) + "/idline";
206
	string idfile = (string) SCR::Read(.target.tmpdir) + "/idline";
207
	if (SCR::Execute (.target.bash, "/bin/grep ^id: " + Installation::destdir +
207
	if (SCR::Execute (.target.bash, "/bin/grep ^id: " +
208
			  "/etc/inittab >" + idfile) == 0)
208
			 "'" + String::Quote (Installation::destdir) + "/etc/inittab" + "'" +
209
			 " >" + idfile) == 0)
209
	{
210
	{
210
	    // idline = "id:X:initdefault:"
211
	    // idline = "id:X:initdefault:"
211
212
Lines 255-261 Link Here
255
	}
256
	}
256
257
257
	// get the current raid configuration
258
	// get the current raid configuration
258
	map out = (map) SCR::Execute (.target.bash_output, "chroot " + Installation::destdir + " mdadm -Ds");
259
	map out = (map) SCR::Execute (.target.bash_output,
260
	    "chroot '" + String::Quote (Installation::destdir) + "' " +
261
	    "mdadm -Ds");
259
	if (out["exit"]:-1 != 0) {
262
	if (out["exit"]:-1 != 0) {
260
	    y2error ("Error occurred while getting raid configuration: %1", out);
263
	    y2error ("Error occurred while getting raid configuration: %1", out);
261
	    return;
264
	    return;
Lines 318-333 Link Here
318
        {
321
        {
319
            string template_dir= "/var/adm/fillup-templates";
322
            string template_dir= "/var/adm/fillup-templates";
320
            // hack 'pre-req' cyclic dependency between bash, aaa_base, and perl
323
            // hack 'pre-req' cyclic dependency between bash, aaa_base, and perl
321
            SCR::Execute(.target.bash, "/bin/cp " + template_dir + "/passwd.aaa_base " 
324
            SCR::Execute(.target.bash, "/bin/cp " + template_dir + "/passwd.aaa_base " +
322
                    + Installation::destdir + "/etc/passwd");
325
		    "'" + String::Quote (Installation::destdir) + "/etc/passwd" + "'");
323
            SCR::Execute(.target.bash, "/bin/cp " + template_dir + "/group.aaa_base " 
326
            SCR::Execute(.target.bash, "/bin/cp " + template_dir + "/group.aaa_base " +
324
                    + Installation::destdir + "/etc/group");
327
                    "'" + String::Quote (Installation::destdir) + "/etc/group" + "'");
325
            SCR::Execute(.target.bash, "/bin/cp " + template_dir + "/shadow.aaa_base " 
328
            SCR::Execute(.target.bash, "/bin/cp " + template_dir + "/shadow.aaa_base " +
326
                    + Installation::destdir + "/etc/shadow");
329
                    "'" + String::Quote (Installation::destdir) + "/etc/shadow" + "'");
327
        } else
330
        } else
328
        {
331
        {
329
	    SCR::Execute(.target.bash, "/bin/cp /etc/passwd " + Installation::destdir + "/etc");
332
	    SCR::Execute(.target.bash, "/bin/cp /etc/passwd " +
330
	    SCR::Execute(.target.bash, "/bin/cp /etc/group " + Installation::destdir + "/etc");
333
		    "'" + String::Quote (Installation::destdir) + "/etc" + "'");
334
	    SCR::Execute(.target.bash, "/bin/cp /etc/group " +
335
		    "'" + String::Quote (Installation::destdir) + "/etc" + "'");
331
        }
336
        }
332
337
333
	// fake mtab
338
	// fake mtab
Lines 368-374 Link Here
368
373
369
            // check passwd and group of target
374
            // check passwd and group of target
370
            SCR::Execute (.target.bash, "/usr/lib/YaST2/bin/update_users_groups " +
375
            SCR::Execute (.target.bash, "/usr/lib/YaST2/bin/update_users_groups " +
371
                    Installation::destdir);
376
                    "'" + String::Quote (Installation::destdir) + "'");
372
377
373
            // update inittab
378
            // update inittab
374
            update_inittab ();
379
            update_inittab ();
Lines 397-405 Link Here
397
    {
402
    {
398
	ProductFeatures::Save();
403
	ProductFeatures::Save();
399
	WFM::Execute (.local.bash, sformat (
404
	WFM::Execute (.local.bash, sformat (
400
	    "/bin/mkdir -p %1/etc/YaST2", Installation::destdir));
405
	    "/bin/mkdir -p '%1/etc/YaST2'", String::Quote (Installation::destdir)));
401
	WFM::Execute (.local.bash, sformat (
406
	WFM::Execute (.local.bash, sformat (
402
	    "/bin/cp %1 %2/%1", "/etc/YaST2/ProductFeatures", Installation::destdir));
407
	    "/bin/cp '%1' '%2/%1'", "/etc/YaST2/ProductFeatures", String::Quote (Installation::destdir)));
403
    }
408
    }
404
409
405
    return `next;
410
    return `next;

Return to bug 211576