1
0
mirror of https://pagure.io/fedora-qa/createhdds.git synced 2024-11-16 13:13:09 +00:00
createhdds/createhdds.sh

47 lines
1.3 KiB
Bash
Raw Normal View History

2015-01-27 11:35:04 +00:00
#!/bin/bash
2015-03-11 15:19:20 +00:00
echo "Creating disk_full.img..."
2015-01-27 11:35:04 +00:00
guestfish <<_EOF_
sparse disk_full.img 10G
run
part-init /dev/sda mbr
part-add /dev/sda p 1 10485760
part-add /dev/sda p 10485761 -1
mkfs ext4 /dev/sda1
mkfs ext4 /dev/sda2
mount /dev/sda1 /
write /testfile "Hello, world!"
umount /
mount /dev/sda2 /
write /testfile "Oh, hi Mark"
umount /
2015-01-27 11:35:04 +00:00
_EOF_
2015-03-11 15:19:20 +00:00
echo "Creating disk_freespace.img..."
2015-01-27 11:35:04 +00:00
guestfish <<_EOF_
sparse disk_freespace.img 10G
run
part-init /dev/sda mbr
part-add /dev/sda p 4096 2097152
2015-01-27 11:35:04 +00:00
mkfs ext4 /dev/sda1
mount /dev/sda1 /
write /testfile "Hello, world!"
_EOF_
2015-03-11 15:19:20 +00:00
2015-03-18 12:43:40 +00:00
echo "Creating disk_f21_minimal.img..."
2015-03-11 15:19:20 +00:00
# TODO: it should be possible to create updated image, but there is a bug, see https://bugzilla.redhat.com/show_bug.cgi?id=1084221
# so you are required to manually boot this image and run 'yum -y update'
2015-03-18 12:43:40 +00:00
#virt-builder fedora-21 -o disk_f21_minimal.img --update --selinux-relabel --root-password password:weakpassword
virt-builder fedora-21 -o disk_f21_minimal.img --root-password password:weakpassword
2015-03-11 15:19:20 +00:00
echo "Creating disk_ks.img..."
curl -o "/tmp/root-user-crypted-net.ks" "https://jskladan.fedorapeople.org/kickstarts/root-user-crypted-net.ks"
guestfish <<_EOF_
sparse disk_ks.img 100MB
run
part-init /dev/sda mbr
part-add /dev/sda p 4096 -1
mkfs ext4 /dev/sda1
mount /dev/sda1 /
upload /tmp/root-user-crypted-net.ks /root-user-crypted-net.ks
_EOF_