Skip to content

Instantly share code, notes, and snippets.

@papamoose
Created July 2, 2024 05:56
Show Gist options
  • Save papamoose/8ce89e32dc37c34555788084c21f36cb to your computer and use it in GitHub Desktop.
Save papamoose/8ce89e32dc37c34555788084c21f36cb to your computer and use it in GitHub Desktop.
<!-- not working yet -->
<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<general t="map">
<mode t="map">
<confirm t="boolean">false</confirm>
</mode>
<self_update config:type="boolean">false</self_update>
</general>
<bootloader t="map">
<global t="map">
<append>preempt=full mitigations=auto security=apparmor</append>
<cpu_mitigations>auto</cpu_mitigations>
<gfxmode>auto</gfxmode>
<hiddenmenu>false</hiddenmenu>
<os_prober>true</os_prober>
<secure_boot>true</secure_boot>
<terminal>gfxterm</terminal>
<timeout t="integer">8</timeout>
<update_nvram>true</update_nvram>
<xen_kernel_append>vga=gfx-1024x768x16</xen_kernel_append>
</global>
<loader_type>grub2-efi</loader_type>
</bootloader>
<networking t="map">
<dhcp_options t="map">
<dhclient_client_id/>
<dhclient_hostname_option>AUTO</dhclient_hostname_option>
</dhcp_options>
<dns t="map">
<dhcp_hostname t="boolean">true</dhcp_hostname>
<hostname>opensuse-15</hostname>
<resolv_conf_policy>auto</resolv_conf_policy>
</dns>
<interfaces t="list">
<% with_link = network_cards.sort_by { |n| n[:name] }.find { |n| n[:link] } %>
<% if with_link %>
<interface>
<device><%= with_link[:device] %></device>
<startmode>auto</startmode>
<bootproto>dhcp</bootproto>
</interface>
<% end %>
</interfaces>
<ipv6 t="boolean">true</ipv6>
<keep_install_network t="boolean">true</keep_install_network>
<managed t="boolean">false</managed>
<net-udev t="list">
<rule t="map">
<name>eth0</name>
<rule>KERNELS</rule>
<value>0000:00:08.0</value>
</rule>
</net-udev>
<routing t="map">
<ipv4_forward t="boolean">false</ipv4_forward>
<ipv6_forward t="boolean">false</ipv6_forward>
</routing>
</networking>
<ntp-client t="map">
<ntp_policy>auto</ntp_policy>
<ntp_servers t="list"/>
<ntp_sync>systemd</ntp_sync>
</ntp-client>
<partitioning t="list">
<drive t="map">
<% disk = disks.sort_by { |d| d[:size] }.last %> <!-- find the largest disk -->
<!-- disk:device <%= disk[:device] %> -->
<!-- disk:device <%= disk[:udev_names][0] %> -->
<device><%= disk[:udev_names][0] %></device>
<disklabel>gpt</disklabel>
<enable_snapshots t="boolean">false</enable_snapshots>
<partitions t="list">
<partition t="map">
<create t="boolean">true</create>
<filesystem t="symbol">vfat</filesystem>
<format t="boolean">true</format>
<fstopt>utf8</fstopt>
<mount>/boot/efi</mount>
<mountby t="symbol">uuid</mountby>
<partition_id t="integer">259</partition_id>
<partition_nr t="integer">1</partition_nr>
<resize t="boolean">false</resize>
<size>2147483648</size>
</partition>
<partition t="map">
<create t="boolean">true</create>
<create_subvolumes t="boolean">true</create_subvolumes>
<filesystem t="symbol">btrfs</filesystem>
<format t="boolean">true</format>
<mount>/</mount>
<mountby t="symbol">uuid</mountby>
<partition_id t="integer">131</partition_id>
<partition_nr t="integer">2</partition_nr>
<quotas t="boolean">false</quotas>
<resize t="boolean">false</resize>
<size>15031320064</size>
<subvolumes t="list">
<subvolume t="map">
<copy_on_write t="boolean">false</copy_on_write>
<path>var</path>
</subvolume>
<subvolume t="map">
<copy_on_write t="boolean">true</copy_on_write>
<path>usr/local</path>
</subvolume>
<subvolume t="map">
<copy_on_write t="boolean">true</copy_on_write>
<path>tmp</path>
</subvolume>
<subvolume t="map">
<copy_on_write t="boolean">true</copy_on_write>
<path>srv</path>
</subvolume>
<subvolume t="map">
<copy_on_write t="boolean">true</copy_on_write>
<path>root</path>
</subvolume>
<subvolume t="map">
<copy_on_write t="boolean">true</copy_on_write>
<path>opt</path>
</subvolume>
<subvolume t="map">
<copy_on_write t="boolean">true</copy_on_write>
<path>home</path>
</subvolume>
<subvolume t="map">
<copy_on_write t="boolean">true</copy_on_write>
<path>boot/grub2/x86_64-efi</path>
</subvolume>
<subvolume t="map">
<copy_on_write t="boolean">true</copy_on_write>
<path>boot/grub2/i386-pc</path>
</subvolume>
</subvolumes>
<subvolumes_prefix>@</subvolumes_prefix>
</partition>
</partitions>
<type t="symbol">CT_DISK</type>
<use>all</use>
</drive>
</partitioning>
<proxy t="map">
<enabled t="boolean">false</enabled>
</proxy>
<services-manager t="map">
<default_target>multi-user</default_target>
<services t="map">
<enable t="list">
<service>YaST2-Firstboot</service>
<service>YaST2-Second-Stage</service>
<service>apparmor</service>
<service>auditd</service>
<service>klog</service>
<service>chronyd</service>
<service>cron</service>
<service>cups</service>
<service>sshd</service>
<service>firewalld</service>
<service>wickedd-auto4</service>
<service>wickedd-dhcp4</service>
<service>wickedd-dhcp6</service>
<service>wickedd-nanny</service>
<service>irqbalance</service>
<service>issue-generator</service>
<service>kbdsettings</service>
<service>mcelog</service>
<service>wicked</service>
<service>nscd</service>
<service>postfix</service>
<service>purge-kernels</service>
<service>rsyslog</service>
<service>smartd</service>
<service>sshd</service>
<service>systemd-pstore</service>
<service>systemd-remount-fs</service>
</enable>
</services>
</services-manager>
<software t="map">
<install_recommended t="boolean">true</install_recommended>
<instsource/>
<packages t="list">
<package>wicked</package>
<package>shim</package>
<package>os-prober</package>
<package>openssh</package>
<package>openSUSE-release</package>
<package>numactl</package>
<package>mokutil</package>
<package>kexec-tools</package>
<package>irqbalance</package>
<package>grub2-x86_64-efi</package>
<package>glibc</package>
<package>firewalld</package>
<package>e2fsprogs</package>
<package>dosfstools</package>
<package>chrony</package>
<package>btrfsprogs</package>
<package>autoyast2</package>
</packages>
<patterns t="list">
<pattern>apparmor</pattern>
<pattern>base</pattern>
<pattern>documentation</pattern>
<pattern>enhanced_base</pattern>
<pattern>minimal_base</pattern>
<pattern>sw_management</pattern>
<pattern>yast2_basis</pattern>
</patterns>
<products t="list">
<!-- os_release_id: <%= os_release[:id] %> -->
<% if os_release[:id] == 'sle' %>
<product>SLES</product>
<% elsif os_release[:id] == 'opensuse-leap' %>
<product>Leap</product>
<% else %>
<product>openSUSE</product>
<% end %>
</products>
</software>
<ssh_import t="map">
<copy_config t="boolean">false</copy_config>
<import t="boolean">false</import>
</ssh_import>
<timezone t="map">
<timezone>America/Denver</timezone>
</timezone>
<user_defaults t="map">
<expire/>
<home>/home</home>
<inactive>-1</inactive>
<shell>/bin/bash</shell>
<umask>022</umask>
</user_defaults>
<users t="list">
<user t="map">
<authorized_keys t="list"/>
<encrypted t="boolean">true</encrypted>
<fullname>root</fullname>
<gid>0</gid>
<home>/root</home>
<home_btrfs_subvolume t="boolean">false</home_btrfs_subvolume>
<password_settings t="map">
<expire/>
<flag/>
<inact/>
<max/>
<min/>
<warn/>
</password_settings>
<shell>/bin/bash</shell>
<uid>0</uid>
<user_password><PASSWORD></user_password>
<username>root</username>
</user>
<user t="map">
<encrypted t="boolean">true</encrypted>
<fullname>USERNAME</fullname>
<authorized_keys t="list">
<listentry>PUBLIC_KEY</listentry>
</authorized_keys>
<gid>1000</gid>
<home>/home/username</home>
<home_btrfs_subvolume t="boolean">false</home_btrfs_subvolume>
<password_settings t="map">
<expire/>
<flag/>
<inact/>
<max>99999</max>
<min>0</min>
<warn>7</warn>
</password_settings>
<shell>/bin/bash</shell>
<uid>1000</uid>
<user_password>SECRET_PASSWORD</user_password>
<username>USERNAME</username>
</user>
</users>
</profile>
# boot file to use.
# grub
# from RHEL
#dhcp-boot=tag:pxeefi64,BOOTX64.EFI
# From Ubuntu
dhcp-boot=tag:pxeefi64,bootx64.efi
#!/bin/bash
# https://tr.opensuse.org/SuSE_install_with_PXE_boot#Setting_up_PXE_boot_environment
for m in linux initrd; do
mkdir -p ./x86_64/stable ./x86_64/tumbleweed ./x86_64/leap/
for b in 15.5 15.6; do
mkdir -p ./x86_64/leap/${b}
wget -c http://download.opensuse.org/distribution/leap/${b}/repo/oss/boot/x86_64/loader/${m} \
-O ./x86_64/leap/${b}/${m}
done
wget -c http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/boot/x86_64/loader/${m} \
-O ./x86_64/stable/${m}
wget -c http://download.opensuse.org/tumbleweed/repo/oss/boot/x86_64/loader/${m} \
-O ./x86_64/tumbleweed/${m}
done
#!/bin/bash
# Tested on Ubuntu 22.04
# source: https://ubuntu.com/server/docs/install/netboot-amd64
# Read this.. may or may not be useful
# https://www.gnu.org/software/grub/manual/grub/grub.html#Network
wdir="$PWD"
cd /tmp
apt download shim-signed
dpkg-deb --fsys-tarfile shim-signed*deb \
| tar x ./usr/lib/shim/shimx64.efi.dualsigned \
-O > ${wdir}/bootx64.efi
apt download grub-efi-amd64-signed
dpkg-deb --fsys-tarfile grub-efi-amd64-signed*deb \
| tar x ./usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed \
-O > ${wdir}/grubx64.efi
apt download grub-common
dpkg-deb --fsys-tarfile grub-common*deb \
| tar x ./usr/share/grub/unicode.pf2 \
-O > ${wdir}/unicode.pf2
#mkdir -p ${wdir}/grub
# modify this as your menu file
#touch ${wdir}/grup/grub.cfg
rm -f /tmp/shim-signed*deb /tmp/grub-efi-amd64-signed*deb /tmp/grub-common*deb
# Set the default timeout for the Grub menu (in seconds)
set timeout=-1
set default="0"
set boot_ip=<IP of http folder>
set boot_url=http://${boot_ip}/tftp
export boot_ip
export boot_url
# grub_cpu: variable to the CPU type for which GRUB was built (e.g. i386 or powerpc).
# grub_platform: variable to the platform for which GRUB was built (e.g. 'pc' or 'efi')
if cpuid -l; then
set arch=amd64
set archx=x86_64
else
set arch=i386
fi
function hex2ip4 {
set hex=$1
regexp --set mask_octet1 (..)...... $hex
regexp --set mask_octet2 ..(..).... $hex
regexp --set mask_octet3 ....(..).. $hex
regexp --set mask_octet4 ......(..) $hex
set nm=""
for hexguess in $mask_octet1 $mask_octet2 $mask_octet3 $mask_octet4; do
for i in 255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0; do
if [ 0x$hexguess -eq $i ]; then
set nm="${nm}${i}."
continue
fi
done
done
regexp --set $2 (.*). $nm
}
net_get_dhcp_option netmask_hex $net_default_interface 1 hex
hex2ip4 $netmask_hex netmask
net_get_dhcp_option dns_hex $net_default_interface 6 hex
hex2ip4 $dns_hex dns
set mac=${net_default_mac}
set ip=${net_default_ip}
set gateway=${net_default_server}
menuentry "MAC: ${net_default_mac}" { true }
menuentry "IP: ${net_default_ip}" { true }
menuentry "GATEWAY: ${net_default_server}" { true }
menuentry "NETMASK: ${netmask}" { true }
menuentry "DNS: ${dns}" { true }
menuentry "ARCH: ${arch}" { true }
menuentry "" { true }
# START MENU
menuentry "Reboot" {
reboot
}
menuentry "Exit" {
halt
}
menuentry "" { true }
menuentry "Memtest86+ x64" {
linuxefi memtest/memtest64.efi
}
menuentry "netboot.xyz" {
chainloader netboot.xyz-snponly.efi
}
menuentry "" { true }
menuentry "OpenSUSE 15.5 Network Install" {
set dist="leap"
set ver="15.5"
set type=${archx}
#set options="root=/dev/ram0 load_ramdisk=1 initrd=initrd showopts ramdisk_size=8192 init=linuxrc"
set options="root=/dev/ram0 load_ramdisk=1 initrd=initrd showopts init=linuxrc"
set autoyast="${boot_url}/suse/${ver}.autoinst.xml.erb"
set linuxrc="textmode=0 netsetup=dhcp install=https://download.opensuse.org/distribution/leap/${ver}/repo/oss"
linuxefi suse/${type}/${dist}/${ver}/linux ${options} ${linuxrc} autoyast=${autoyast}
initrdefi suse/${type}/${dist}/${ver}/initrd
}
# https://documentation.suse.com/sles/15-SP5/html/SLES-all/Invoking.html
menuentry "OpenSUSE Tumbleweed Network Install" {
set dist="tumbleweed"
set type=${archx}
set options="root=/dev/ram0 load_ramdisk=1 initrd=initrd showopts ramdisk_size=8192 init=linuxrc"
set autoyast="${boot_url}/suse/${dist}.autoinst.xml.erb"
linuxefi suse/${type}/${dist}/linux ${options} textmode=1 netsetup=dhcp autoyast=${autoyast}
initrdefi suse/${type}/${dist}/initrd
}
menuentry "" { true }
menuentry "Live Install Ubuntu 22.04 amd64 Jammy ISO" {
set release="jammy"
set type="desktop"
set arch="amd64"
linuxefi ubuntu/${release}/live-${type}-amd64/casper/vmlinuz initrd=initrd boot=casper nomodeset ethdevice-timeout=300 ip=dhcp url=${boot_url}/ubuntu/${release}/live-${type}-${arch}.iso maybe-ubiquity --
initrdefi ubuntu/${release}/live-${type}-amd64/casper/initrd
}
menuentry "Live Desktop Install Ubuntu 22.04 amd64 NFS" {
set release="jammy"
set type="desktop"
set arch="amd64"
linuxefi ubuntu/${release}/live-${type}-amd64/casper/vmlinuz initrd=initrd boot=casper nomodeset ethdevice-timeout=300 ip=dhcp netboot=nfs nfsroot=${boot_ip}:/srv/tftp/ubuntu/${release}/live-${type}-${arch} maybe-ubiquity --
initrdefi ubuntu/${release}/live-${type}-amd64/casper/initrd
}
menuentry "" { true }
menuentry "Auto Install Ubuntu Server 22.04 amd64 DHCP" {
set release="jammy"
set type="server"
set arch="amd64"
set network="net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1"
set console="console=ttyS0 console=tty0"
set autoinstall="url=${boot_url}/ubuntu/${release}/live-${type}-${arch}.iso autoinstall fsck.mode=skip"
set nocloud="ds=nocloud-net;s=${boot_url}/ubuntu/cloud-init/ cloud-config-url=/dev/null ---"
linuxefi ubuntu/${release}/live-${type}-${arch}/casper/vmlinuz initrd=initrd ramdisk_size=2097152 ${console} ${autoinstall} ${network} ${nocloud}
initrdefi ubuntu/${release}/live-${type}-${arch}/casper/initrd
}
menuentry "Auto Install Ubuntu Server 22.04 amd64 STATIC IP" {
set release="jammy"
set type="server"
set arch="amd64"
set network="net.ifnames=0 biosdevname=0 interface=eth0 ip=${ip}::${gateway}:${netmask}::eth0:none:${dns} nameserver=${dns}"
set console="console=ttyS0 console=tty0"
set autoinstall="url=${boot_url}/ubuntu/${release}/live-${type}-${arch}.iso autoinstall fsck.mode=skip"
set nocloud="ds=nocloud-net;s=${boot_url}/ubuntu/cloud-init/ cloud-config-url=/dev/null ---"
linuxefi ubuntu/${release}/live-${type}-${arch}/casper/vmlinuz initrd=initrd ramdisk_size=2097152 ${console} ${autoinstall} ${network} ${nocloud}
initrdefi ubuntu/${release}/live-${type}-${arch}/casper/initrd
}
grub/
grub/grub.cfg
grub/x86_64-efi/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment