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 a Debian image which is enough to fool the inspection heuristics.
26 LABEL=BOOT /boot ext2 default 0 0
27 /dev/debian/root / ext2 default 0 0
28 /dev/debian/usr /usr ext2 default 1 2
29 /dev/debian/var /var ext2 default 1 2
30 /dev/debian/home /home ext2 default 1 2
33 # Create a disk image.
34 ../fish/guestfish <<'EOF'
35 sparse debian.img.tmp 512M
39 part-init /dev/sda mbr
40 part-add /dev/sda p 64 524287
41 part-add /dev/sda p 524288 -64
44 vgcreate debian /dev/sda2
45 lvcreate root debian 64
46 lvcreate usr debian 32
47 lvcreate var debian 32
48 lvcreate home debian 32
50 # Phony /boot filesystem.
51 mkfs-opts ext2 /dev/sda1 blocksize:4096
52 set-e2label /dev/sda1 BOOT
53 set-e2uuid /dev/sda1 01234567-0123-0123-0123-012345678901
55 # Phony root and other filesystems.
56 mkfs-opts ext2 /dev/debian/root blocksize:4096
57 set-e2uuid /dev/debian/root 01234567-0123-0123-0123-012345678902
58 mkfs-opts ext2 /dev/debian/usr blocksize:4096
59 set-e2uuid /dev/debian/usr 01234567-0123-0123-0123-012345678903
60 mkfs-opts ext2 /dev/debian/var blocksize:4096
61 set-e2uuid /dev/debian/var 01234567-0123-0123-0123-012345678904
62 mkfs-opts ext2 /dev/debian/home blocksize:4096
63 set-e2uuid /dev/debian/home 01234567-0123-0123-0123-012345678905
65 # Enough to fool inspection API.
66 mount-options "" /dev/debian/root /
68 mount-options "" /dev/sda1 /boot
70 mount-options "" /dev/debian/usr /usr
72 mount-options "" /dev/debian/var /var
74 mount-options "" /dev/debian/home /home
79 upload fstab.tmp /etc/fstab
80 write /etc/debian_version "5.0.1"
81 write /etc/hostname "debian.invalid"
83 upload guest-aux/debian-packages /var/lib/dpkg/status
85 upload bin-x86_64-dynamic /bin/ls
88 touch /boot/grub/grub.conf
92 mv debian.img.tmp debian.img