User:Moggers87/Installing Opensuse: Difference between revisions

From BitFolk
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
under construction.gif
under construction.gif


==make sure you're in pvh mode==
==Install OpenSUSE==
 
===Make sure you're in pvh mode===


<syntaxhighlight lang="text">
<syntaxhighlight lang="text">
Line 7: Line 9:
</syntaxhighlight>
</syntaxhighlight>


==Boot rescue VM and log in==
===Boot rescue VM and log in===


<syntaxhighlight lang="text">
<syntaxhighlight lang="text">
Line 20: Line 22:
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang="text">
===Install required utilities into rescue VM===
</syntaxhighlight>
==become root==
# apt update
# apt update
# apt install rpm zypper curl btrfs-progs zstd parted
# apt install rpm zypper curl btrfs-progs zstd parted
===Set up partitions on disk===
# wipe existing block devices `for d in a b; do wipefs -a /dev/xvd${d}; done`
# wipe existing block devices `for d in a b; do wipefs -a /dev/xvd${d}; done`
# create partitions
# create partitions
Line 33: Line 35:
## mkswap -L SWAP /dev/xvdb1
## mkswap -L SWAP /dev/xvdb1
# mkdir -vp /target && mount -v /dev/xvda1 /target
# mkdir -vp /target && mount -v /dev/xvda1 /target
===Copy in resolv.conf===
# cp -v /etc/resolv.conf /target/etc/
# cp -v /etc/resolv.conf /target/etc/
===Set up Zypper repoes===
# set up repo files
# set up repo files
## mkdir -p /target/etc/zypp/repos.d/
## mkdir -p /target/etc/zypp/repos.d/
Line 57: Line 62:
  keeppackages=0
  keeppackages=0
  EOF
  EOF
===Install Zypper===
# run `zypper --releasever=15.3 -R /target install zypper`
# run `zypper --releasever=15.3 -R /target install zypper`
## trust the key
## trust the key
## say yes to everything else
## say yes to everything else
# chroot
 
===Mount chroot===
##
##
  mount -v --bind /dev /target/dev
  mount -v --bind /dev /target/dev

Revision as of 19:19, 21 January 2022

under construction.gif

Install OpenSUSE

Make sure you're in pvh mode

xen-shell> virtmode pvh

Boot rescue VM and log in

xen-shell> rescue

After a while you'll be presented with a login prompt. The password is auto-generated and should be printed a few lines above the prompt. Once you're logged in, become root:

user@rescue:~$ sudo -i
root@rescue:~#

Install required utilities into rescue VM

  1. apt update
  2. apt install rpm zypper curl btrfs-progs zstd parted

Set up partitions on disk

  1. wipe existing block devices `for d in a b; do wipefs -a /dev/xvd${d}; done`
  2. create partitions
    1. parted -s /dev/xvda mklabel gpt mkpart root btrfs 0% 100%
    2. parted -s /dev/xvda set 1 boot on
    3. parted -s /dev/xvdb mklabel gpt mkpart swap linux-swap 0% 100%
    4. mkfs.btrfs /dev/xvda1
    5. mkswap -L SWAP /dev/xvdb1
  3. mkdir -vp /target && mount -v /dev/xvda1 /target

Copy in resolv.conf

  1. cp -v /etc/resolv.conf /target/etc/

Set up Zypper repoes

  1. set up repo files
    1. mkdir -p /target/etc/zypp/repos.d/
    2. cat <<-EOF > /target/etc/zypp/repos.d/repo-oss.repo

[repo-oss] name=Main Repository enabled=1 autorefresh=1 baseurl=http://download.opensuse.org/distribution/leap/\$releasever/repo/oss/ path=/ type=rpm-md keeppackages=0 EOF

cat <<-EOF > /target/etc/zypp/repos.d/repo-update.repo
[repo-update]
name=Main Update Repository
enabled=1
autorefresh=1
baseurl=http://download.opensuse.org/update/leap/\$releasever/oss
path=/
type=rpm-md
keeppackages=0
EOF

Install Zypper

  1. run `zypper --releasever=15.3 -R /target install zypper`
    1. trust the key
    2. say yes to everything else

Mount chroot

mount -v --bind /dev /target/dev
mount -v --bind /dev /target/dev
mount -v -t proc procfs /target/proc
mount -v -t sysfs sysfs /target/sys
chroot /target /bin/bash
zypper --releasever=15.3 install openSUSE-release lsb grub2 dracut-tools wicked
cat > /etc/default/grub << EOF
# If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg' afterwarrds to update
# /boot/grub2/grub.cfg.
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="splash=silent mitigations=auto quiet"
GRUB_TERMINAL=console
GRUB_DISABLE_RECOVERY="true"
EOF
  1. zypper --releasever=15.3 install kernel-default
  2. grub2-mkconfig -o /boot/grub2/grub.cfg
  3. networking:
cat > /etc/sysconfig/network/ifcfg-eth0 << EOF
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="no"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="eth0"
DEVICE="eth0"
ONBOOT="yes"
IPADDR=85.119.82.225
PREFIX=21
GATEWAY=85.119.80.1
IPV6ADDR=2001:ba8:1f1:f1d7::2/64
IPV6_DEFAULTGW=2001:ba8:1f1:f1d7::1
DNS1=85.119.80.232
DNS2=85.119.80.233
EOF
  1. fstab
cat > /etc/fstab << EOF
/dev/xvda1  /   btrfs defaults,noatime 0 0
LABEL=SWAP swap swap  defaults         0 0
EOF
  1. passwd root
  2. openSUSE doesn't currently have selinux enabled by default, but if that changes in future you'll need to ask for a relabel *and* disable it for the first boot
  3. exit chroot and dismount
exit
umount /target/sys
umount /target/proc
umount /target/dev
umount /target
  1. halt