mirror of
https://github.com/rocky-linux/createhdds.git
synced 2024-12-22 10:08:30 +00:00
add 32bit disk creation
Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D534
This commit is contained in:
parent
b8fe095296
commit
75936a2870
@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
function disk_full {
|
||||
echo "Creating disk_full.img..."
|
||||
guestfish <<_EOF_
|
||||
@ -31,14 +32,17 @@ write /testfile "Hello, world!"
|
||||
_EOF_
|
||||
}
|
||||
|
||||
function disk_f22_minimal {
|
||||
echo "Creating disk_f22_minimal.img..."
|
||||
virt-builder fedora-22 -o disk_f22_minimal.img --update --selinux-relabel --root-password password:weakpassword > /dev/null
|
||||
function disk_minimal {
|
||||
version=$1
|
||||
arch=$2
|
||||
echo "Creating disk_f${version}_minimal_${arch}.img..."
|
||||
virt-builder fedora-${version} -o disk_f${version}_minimal_${arch}.img --arch ${arch} --run-command \
|
||||
"setarch ${arch} dnf -y update" --selinux-relabel --root-password password:weakpassword > /dev/null
|
||||
expect <<_EOF_
|
||||
log_user 0
|
||||
set timeout -1
|
||||
|
||||
spawn qemu-kvm -m 2G -nographic disk_f22_minimal.img
|
||||
spawn qemu-kvm -m 2G -nographic disk_f${version}_minimal_${arch}.img
|
||||
|
||||
expect "localhost login:"
|
||||
send "root\r"
|
||||
@ -50,20 +54,24 @@ expect "reboot: Power down"
|
||||
_EOF_
|
||||
}
|
||||
|
||||
function disk_f22_desktop {
|
||||
echo "Creating disk_f22_desktop.img..."
|
||||
function disk_desktop {
|
||||
version=$1
|
||||
arch=$2
|
||||
echo "Creating disk_f${version}_desktop_${arch}.img..."
|
||||
# these steps are required
|
||||
# 1. remove firewalld - firewalld configuration in minimal and desktop are conflicting
|
||||
# 2. update fedora
|
||||
# 3. install @Fedora Workstation group
|
||||
# 4. add new user on first boot
|
||||
# 5. use expect to do selinux relabelling and to set password for user
|
||||
virt-builder fedora-22 -o disk_f22_desktop.img --size 10G --run-command "yum -y remove firewalld*" --update --selinux-relabel --install "@^workstation-product-environment" --root-password password:weakpassword --firstboot-command 'useradd -m -p "" ejohn' > /dev/null
|
||||
virt-builder fedora-${version} -o disk_f${version}_desktop_${arch}.img --size 20G --arch ${arch} --run-command \
|
||||
"setarch ${arch} dnf -y remove firewalld* && setarch ${arch} dnf -y update && setarch ${arch} dnf -y install @'Fedora Workstation'" \
|
||||
--selinux-relabel --root-password password:weakpassword --firstboot-command 'useradd -m -p "" ejohn' > /dev/null
|
||||
expect <<_EOF_
|
||||
log_user 0
|
||||
set timeout -1
|
||||
|
||||
spawn qemu-kvm -m 2G -nographic disk_f22_desktop.img
|
||||
spawn qemu-kvm -m 2G -nographic disk_f${version}_desktop_${arch}.img
|
||||
|
||||
expect "localhost login:"
|
||||
send "root\r"
|
||||
@ -105,14 +113,19 @@ upload /tmp/updates.img /updates.img
|
||||
_EOF_
|
||||
}
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
if [[ "$1" != "" ]]; then
|
||||
VERSION="$1"
|
||||
shift
|
||||
if [[ "$#" -eq 0 ]]; then
|
||||
disk_full
|
||||
disk_freespace
|
||||
disk_f22_minimal
|
||||
disk_f22_desktop
|
||||
disk_minimal ${VERSION} "x86_64"
|
||||
disk_minimal ${VERSION} "i686"
|
||||
disk_desktop ${VERSION} "x86_64"
|
||||
disk_desktop ${VERSION} "i686"
|
||||
disk_ks
|
||||
disk_updates_img
|
||||
else
|
||||
else
|
||||
case $1 in
|
||||
full)
|
||||
disk_full
|
||||
@ -120,11 +133,17 @@ else
|
||||
freespace)
|
||||
disk_freespace
|
||||
;;
|
||||
minimal)
|
||||
disk_f22_minimal
|
||||
minimal_64bit)
|
||||
disk_minimal ${VERSION} "x86_64"
|
||||
;;
|
||||
desktop)
|
||||
disk_f22_desktop
|
||||
minimal_32bit)
|
||||
disk_minimal ${VERSION} "i686"
|
||||
;;
|
||||
desktop_64bit)
|
||||
disk_desktop ${VERSION} "x86_64"
|
||||
;;
|
||||
desktop_32bit)
|
||||
disk_desktop ${VERSION} "i686"
|
||||
;;
|
||||
ks)
|
||||
disk_ks
|
||||
@ -133,7 +152,12 @@ else
|
||||
disk_updates_img
|
||||
;;
|
||||
*)
|
||||
echo "$0 [full|freespace|minimal|desktop|ks|updates]"
|
||||
echo "name not in [full|freespace|minimal_64bit|minimal_32bit|desktop_64bit|desktop_32bit|ks|updates]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
echo "USAGE: $0 VERSION [full|freespace|minimal_64bit|minimal_32bit|desktop_64bit|desktop_32bit|ks|updates]"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -285,10 +285,16 @@ TESTSUITES = {
|
||||
"QA:Testcase_kickstart_user_creation",
|
||||
"QA:Testcase_Kickstart_Hd_Device_Path_Ks_Cfg",
|
||||
],
|
||||
"fedup_minimal": [
|
||||
"fedup_minimal_64bit": [
|
||||
"QA:Testcase_upgrade_fedup_cli_previous_minimal",
|
||||
],
|
||||
"fedup_desktop": [
|
||||
"fedup_desktop_64bit": [
|
||||
"QA:Testcase_upgrade_fedup_cli_previous_workstation",
|
||||
],
|
||||
"fedup_minimal_32bit": [
|
||||
"QA:Testcase_upgrade_fedup_cli_previous_minimal",
|
||||
],
|
||||
"fedup_desktop_32bit": [
|
||||
"QA:Testcase_upgrade_fedup_cli_previous_workstation",
|
||||
],
|
||||
"server_btrfs": [
|
||||
|
Loading…
Reference in New Issue
Block a user