3 # Copyright (C) 2010 Red Hat Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 # Make an Ubuntu image which is enough to fool the inspection heuristics.
26 LABEL=BOOT /boot ext2 default 0 0
27 /dev/sda2 / ext2 default 1 2
31 cat > release.tmp <<'EOF'
34 DISTRIB_CODENAME=maverick
35 DISTRIB_DESCRIPTION="Ubuntu 10.10 (Phony Pharaoh)"
38 # Create a disk image.
39 ../run ../fish/guestfish <<'EOF'
40 sparse ubuntu.img.tmp 512M
44 part-init /dev/sda mbr
45 part-add /dev/sda p 64 524287
46 part-add /dev/sda p 524288 -64
48 # Phony /boot filesystem.
49 mkfs-opts ext2 /dev/sda1 blocksize:4096
50 set-e2label /dev/sda1 BOOT
51 set-e2uuid /dev/sda1 01234567-0123-0123-0123-012345678901
53 # Phony root filesystem (Ubuntu doesn't use LVM by default).
54 mkfs-opts ext2 /dev/sda2 blocksize:4096
55 set-e2uuid /dev/sda2 01234567-0123-0123-0123-012345678902
57 # Enough to fool inspection API.
58 mount-options "" /dev/sda2 /
60 mount-options "" /dev/sda1 /boot
67 upload fstab.tmp /etc/fstab
68 write /etc/debian_version "5.0.1"
69 upload release.tmp /etc/lsb-release
70 write /etc/hostname "ubuntu.invalid"
72 upload guest-aux/debian-packages /var/lib/dpkg/status
74 upload bin-i586-dynamic /bin/ls
77 touch /boot/grub/grub.conf
80 rm fstab.tmp release.tmp
81 mv ubuntu.img.tmp ubuntu.img