PERFORCE change 122649 for review

Ivan Voras ivoras at FreeBSD.org
Sun Jul 1 16:34:10 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=122649

Change 122649 by ivoras at ivoras_finstall on 2007/07/01 16:33:23

	An important milestone: the utility is now perferctly capable of
	creating a LiveCD with X11 embedded on it.
	Bugs fixed: order of installing config files and packages
	New things: start of mtree support infrastructure

Affected files ...

.. //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/bundle-spec#2 edit
.. //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/dot.xinitrc#2 edit
.. //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/font.local.conf#1 add
.. //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/fstab#2 edit
.. //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/hosts#2 edit
.. //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/livecd#2 edit
.. //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/loader.conf#2 edit
.. //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/rc.conf#2 edit
.. //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/xorg.conf#2 edit
.. //depot/projects/soc2007/ivoras_finstall/makeimage/makeimage.py#7 edit
.. //depot/projects/soc2007/ivoras_finstall/makeimage/pkglist#2 edit
.. //depot/projects/soc2007/ivoras_finstall/makeimage/util.py#5 edit

Differences ...

==== //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/bundle-spec#2 (text+ko) ====

@@ -11,3 +11,4 @@
 /etc/hosts=hosts;kw;a
 /etc/fstab=fstab;kw
 /boot/loader.conf=loader.conf;kw
+/usr/local/etc/fonts/local.conf=font.local.conf;kw

==== //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/dot.xinitrc#2 (text+ko) ====


==== //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/fstab#2 (text+ko) ====


==== //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/hosts#2 (text+ko) ====


==== //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/livecd#2 (text+ko) ====

@@ -3,7 +3,7 @@
 # REQUIRE: root
 # KEYWORD: nojail
 #
-/sbin/mount_mfs -s 32m -S -m 3 f 512 -b 4096 md /tmp
+/sbin/mount_mfs -s 32m -S -m 3 -f 512 -b 4096 md /tmp
 /bin/mkdir /tmp/etc /tmp/var /tmp/root
 /sbin/mount_unionfs -o copymode=transparent /tmp/etc /etc
 /sbin/mount_unionfs -o copymode=transparent /tmp/var /var

==== //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/loader.conf#2 (text+ko) ====

@@ -1,3 +1,4 @@
 # $dest_file$ generated by finstall makeimage.py on $date$ $time$
 rootdev="iso9660/$label$"
 boot_cdrom="1"
+ipfw_load="YES"

==== //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/rc.conf#2 (text+ko) ====

@@ -5,3 +5,4 @@
 syslogd_flags="-C"
 usbd_enable="YES"
 moused_enable="YES"
+sendmail_enable="NONE"

==== //depot/projects/soc2007/ivoras_finstall/makeimage/bundles/xorg.conf#2 (text+ko) ====


==== //depot/projects/soc2007/ivoras_finstall/makeimage/makeimage.py#7 (text+ko) ====

@@ -71,6 +71,7 @@
 BUNDLEFILE = "bundle-spec"
 PKGLISTFILE = None
 ISO = None
+STARTDIR = os.path.realpath(".")
 
 opts, args = getopt(sys.argv[1:], "d:s:i:p:bch")
 for o,a in opts:
@@ -137,6 +138,9 @@
 	execute("make distribution DESTDIR=%s" % DESTDIR)
 	execute("make installkernel KERNCONF=%s DESTDIR=%s" % (KERNEL, DESTDIR))
 	execute("rm %s/boot/kernel/*.symbols" % DESTDIR)
+	os.chdir(DESTDIR)
+	execute("mtree -c > livecd.mtree")
+	os.chdir(STARTDIR)
 else:
 	if not os.path.exists(DESTDIR) or not os.path.exists("%s/COPYRIGHT" % DESTDIR):
 		print "%s doesn't look like existing livecd root" % DESTDIR
@@ -145,8 +149,57 @@
 str_time = strftime("%H:%M")
 str_date = strftime("%Y-%m-%d")
 
+if PKGLISTFILE != None:
+	# Install packages into the liveCD tree, using chroot
+	printmsg("Bundling packages")
+	master_pkglist = []
+	f = file(PKGLISTFILE, "r")
+	for line in f.readlines():
+		line = line.strip()
+		if len(line) == 0:
+			continue
+		if line[0] == "#":
+			continue
+		fullname = getpkgfullname(line)
+		if fullname == None:
+			printmsg("Fatal error: cannot find package %s" % line)
+			sys.exit(1)
+		master_pkglist.append(fullname)
+	dest_pkgs = {}
+	for pkg in master_pkglist:
+		dest_pkgs[pkg] = True
+		for p2 in getpkgdeps(pkg):
+			if p2 != None:
+				dest_pkgs[p2] = True
+	os.chdir("%s/tmp" % DESTDIR)
+	for pkg in dest_pkgs:
+		pkg_file = "%s.tgz" % pkg
+		execute("pkg_create -v -z -b %s %s" % (pkg, pkg_file))
+		dest_pkgs[pkg] = pkg_file
+	f = file("pkginst.sh", "w")
+	f.write("#!/bin/sh\ncd /tmp\n")
+	if not DoMakeRoot:
+		f.write("echo Deleting existing packages...\n")
+		f.write("pkg_delete -a\n")
+	for pkg in master_pkglist:
+		f.write("echo  --- Installing %s\n" % pkg)
+		f.write("/usr/sbin/pkg_add %s\n" % dest_pkgs[pkg])
+	f.close()
+	for pkg in dest_pkgs.keys():
+		if pkg == None:
+			printmsg("NULL key!")
+	printmsg("LiveCD will contain packages: %s" % " ".join(dest_pkgs.keys()))
+	execute("chroot %s /bin/sh /tmp/pkginst.sh" % DESTDIR)
+	for pkg in dest_pkgs:
+		os.unlink(dest_pkgs[pkg])
+	os.unlink("pkginst.sh")
+	os.chdir(STARTDIR)
+
+
+# Now we can bundle config files
 if os.path.exists("%s/%s" % (BUNDLEDIR, BUNDLEFILE)):
 	printmsg("Bundling config files")
+	cflist = []
 	f = file("%s/%s" % (BUNDLEDIR, BUNDLEFILE), "r")
 	for line in f.readlines():
 		line = line.strip()
@@ -163,6 +216,7 @@
 		else:
 			flags = []
 			dest_file, src_file = line.split("=", 1)
+		cflist.append(dest_file)
 		file_contents = file("%s/%s" % (BUNDLEDIR, src_file), "r").read()
 		if "kw" in flags:
 			file_contents = file_contents.replace("$label$", LABEL)
@@ -178,44 +232,15 @@
 		df.close()
 		if "x" in flags:
 			os.chmod("%s%s" % (DESTDIR, dest_file), stat.S_IRUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
+	if len(cflist) != 0:
+		printmsg("LiveCD will contain config files: %s" % " ".join(cflist))
 	f.close()
-
-if PKGLISTFILE != None:
-	printmsg("Bundling packages")
-	# Install packages into the liveCD tree, using chroot
-	master_pkglist = []
-	f = file(PKGLISTFILE, "r")
-	for line in f.readlines():
-		line = line.strip()
-		if len(line) == 0:
-			continue
-		if line[0] == "#":
-			continue
-		master_pkglist.append(getpkgfullname(line))
-	dest_pkgs = {}
-	for pkg in master_pkglist:
-		dest_pkgs[pkg] = True
-		for p2 in getpkgdeps(pkg):
-			dest_pkgs[p2] = True
-	os.chdir("%s/tmp" % DESTDIR)
-	for pkg in dest_pkgs:
-		pkg_file = "%s.tgz" % pkg
-		execute("pkg_create -v -b %s %s" % (pkg, pkg_file))
-		dest_pkgs[pkg] = pkg_file
-	f = file("pkginst.sh", "w")
-	f.write("#!/bin/sh\ncd /tmp\npkg_delete -av\n")
-	for pkg in master_pkglist:
-		f.write("/usr/sbin/pkg_add -v %s\n" % dest_pkgs[pkg])
-		printmsg("LiveCD will contain package: %s" % pkg)
-	f.close()
-	execute("chroot %s /bin/sh /tmp/pkginst.sh" % DESTDIR)
-	for pkg in dest_pkgs:
-		os.unlink(dest_pkgs[pkg])
-	os.unlink("pkginst.sh")
+else:
+	printmsg("WARNING: Not bundling any config files")
 
-
 os.chdir(WORKDIR)
 if ISO == None:
 	ISO = "%s/image.iso" % WORKDIR
 execute("mkisofs -l -nobak -V %s -T -J -r -ldots -b boot/cdboot -no-emul-boot -o %s %s" % (LABEL, ISO, DESTDIR))
+os.chdir(STARTDIR)
 

==== //depot/projects/soc2007/ivoras_finstall/makeimage/pkglist#2 (text+ko) ====

@@ -1,4 +1,14 @@
-vim-gtk2
+#vim-gtk2
 py24-gtk
 xorg-server
+xf86-input-keyboard
+xf86-input-mouse
+xkeyboard-config
 xf86-video-vesa
+xf86-video-fbdev
+xf86-video-vga
+xorg-fonts-7.2
+xkbcomp
+xinit
+#gnome-icons-slick
+xfce-4

==== //depot/projects/soc2007/ivoras_finstall/makeimage/util.py#5 (text+ko) ====



More information about the p4-projects mailing list