<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=LnkLst</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=LnkLst"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/LnkLst"/>
	<updated>2026-05-05T21:02:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26121</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26121"/>
		<updated>2024-01-03T14:47:23Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Create the directories on the HOST */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on {{ic|2 or more DASDs}} (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is {{ic|not supported}} in the installer script ({{ic|setup-alpine}}) at the moment. If you want to install/extend on more than 1 DASD. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : {{ic|https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt}})&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}dhcp}} : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2}} : use static IP configuration, each field is separated by a colon {{ic|:}}&lt;br /&gt;
* {{ic|client-ip}} ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* {{ic|server-ip}} not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|gw-ip}}     the gateway ip address&lt;br /&gt;
* {{ic|netmask}}   the netmask&lt;br /&gt;
* {{ic|hostname}}  not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|device}}    the network interface of the guest VM, default is {{ic|eth0}} if left blank&lt;br /&gt;
* {{ic|autoconf}}  not used, leave blank or fill with {{ic|none}} or {{ic|off}}&lt;br /&gt;
* {{ic|dns1}}      address of the DNS server&lt;br /&gt;
* {{ic|dns2}}      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
{{ic|alpine_repo{{=}}}} : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/v3.19/main}}&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/edge/main}}&lt;br /&gt;
&lt;br /&gt;
{{ic|modloop{{=}}}} : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the {{ic|modloop}} image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
{{ic|ssh_key{{=}}}} : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into {{ic|/root/.ssh/authorized_keys}} in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{ic|dasd{{=}}}} : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
{{ic|s390x_net{{=}}}} : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name {{ic|qeth_l2}} is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
{{cmd|$ qemu-img create alpine_disk.qcow2 5G}}&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso}}&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify {{ic|ip{{=}}}} {{ic|alpine_repo{{=}}}} {{ssh_key{{=}}}} for your needs)&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip{{=}}192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo{{=}}&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://www.example.net/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
                                      [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
The host is a Fedora Linux V39&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine mkdir Alpine/rdrr Alpine/dasd /Alpine/prtrr &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.3::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File] for details&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 GB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# !!!Don&#039;t put any IP over the QETH device!!!&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at the moment of send the alpine-setup.sh script the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
This script must be executed before the IPL of the guest zLinux&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use {{ic|only}} 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
{{ic|This step is not necessary under Hercules (Hyperion) Emulator installation}}&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
{{ic|$ ssh root@192.168.1.2}} (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing {{key|Ctrl}} + {{key|C}}. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# setup-disk -s 0}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26120</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26120"/>
		<updated>2024-01-03T14:47:00Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on {{ic|2 or more DASDs}} (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is {{ic|not supported}} in the installer script ({{ic|setup-alpine}}) at the moment. If you want to install/extend on more than 1 DASD. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : {{ic|https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt}})&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}dhcp}} : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2}} : use static IP configuration, each field is separated by a colon {{ic|:}}&lt;br /&gt;
* {{ic|client-ip}} ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* {{ic|server-ip}} not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|gw-ip}}     the gateway ip address&lt;br /&gt;
* {{ic|netmask}}   the netmask&lt;br /&gt;
* {{ic|hostname}}  not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|device}}    the network interface of the guest VM, default is {{ic|eth0}} if left blank&lt;br /&gt;
* {{ic|autoconf}}  not used, leave blank or fill with {{ic|none}} or {{ic|off}}&lt;br /&gt;
* {{ic|dns1}}      address of the DNS server&lt;br /&gt;
* {{ic|dns2}}      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
{{ic|alpine_repo{{=}}}} : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/v3.19/main}}&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/edge/main}}&lt;br /&gt;
&lt;br /&gt;
{{ic|modloop{{=}}}} : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the {{ic|modloop}} image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
{{ic|ssh_key{{=}}}} : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into {{ic|/root/.ssh/authorized_keys}} in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{ic|dasd{{=}}}} : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
{{ic|s390x_net{{=}}}} : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name {{ic|qeth_l2}} is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
{{cmd|$ qemu-img create alpine_disk.qcow2 5G}}&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso}}&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify {{ic|ip{{=}}}} {{ic|alpine_repo{{=}}}} {{ssh_key{{=}}}} for your needs)&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip{{=}}192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo{{=}}&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://www.example.net/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
                                      [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
The host is a Fedora Linux V39&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine mkdir Alpine/rdrr Alpine/dasd /Alpine/prtrr&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.3::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File] for details&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 GB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# !!!Don&#039;t put any IP over the QETH device!!!&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at the moment of send the alpine-setup.sh script the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
This script must be executed before the IPL of the guest zLinux&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use {{ic|only}} 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
{{ic|This step is not necessary under Hercules (Hyperion) Emulator installation}}&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
{{ic|$ ssh root@192.168.1.2}} (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing {{key|Ctrl}} + {{key|C}}. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# setup-disk -s 0}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26088</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26088"/>
		<updated>2023-12-29T08:37:01Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Customize the hercules.cnf file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on {{ic|2 or more DASDs}} (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is {{ic|not supported}} in the installer script ({{ic|setup-alpine}}) at the moment. If you want to install/extend on more than 1 DASD. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : {{ic|https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt}})&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}dhcp}} : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2}} : use static IP configuration, each field is separated by a colon {{ic|:}}&lt;br /&gt;
* {{ic|client-ip}} ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* {{ic|server-ip}} not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|gw-ip}}     the gateway ip address&lt;br /&gt;
* {{ic|netmask}}   the netmask&lt;br /&gt;
* {{ic|hostname}}  not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|device}}    the network interface of the guest VM, default is {{ic|eth0}} if left blank&lt;br /&gt;
* {{ic|autoconf}}  not used, leave blank or fill with {{ic|none}} or {{ic|off}}&lt;br /&gt;
* {{ic|dns1}}      address of the DNS server&lt;br /&gt;
* {{ic|dns2}}      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
{{ic|alpine_repo{{=}}}} : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/v3.19/main}}&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/edge/main}}&lt;br /&gt;
&lt;br /&gt;
{{ic|modloop{{=}}}} : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the {{ic|modloop}} image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
{{ic|ssh_key{{=}}}} : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into {{ic|/root/.ssh/authorized_keys}} in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{ic|dasd{{=}}}} : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
{{ic|s390x_net{{=}}}} : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name {{ic|qeth_l2}} is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
{{cmd|$ qemu-img create alpine_disk.qcow2 5G}}&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso}}&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify {{ic|ip{{=}}}} {{ic|alpine_repo{{=}}}} {{ssh_key{{=}}}} for your needs)&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip{{=}}192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo{{=}}&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://www.example.net/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
                                      [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
The host is a Fedora Linux V39&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.3::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File] for details&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 GB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# !!!Don&#039;t put any IP over the QETH device!!!&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at the moment of send the alpine-setup.sh script the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
This script must be executed before the IPL of the guest zLinux&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use {{ic|only}} 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
{{ic|This step is not necessary under Hercules (Hyperion) Emulator installation}}&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
{{ic|$ ssh root@192.168.1.2}} (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing {{key|Ctrl}} + {{key|C}}. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# setup-disk -s 0}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26087</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26087"/>
		<updated>2023-12-29T08:27:05Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on {{ic|2 or more DASDs}} (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is {{ic|not supported}} in the installer script ({{ic|setup-alpine}}) at the moment. If you want to install/extend on more than 1 DASD. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : {{ic|https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt}})&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}dhcp}} : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2}} : use static IP configuration, each field is separated by a colon {{ic|:}}&lt;br /&gt;
* {{ic|client-ip}} ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* {{ic|server-ip}} not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|gw-ip}}     the gateway ip address&lt;br /&gt;
* {{ic|netmask}}   the netmask&lt;br /&gt;
* {{ic|hostname}}  not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|device}}    the network interface of the guest VM, default is {{ic|eth0}} if left blank&lt;br /&gt;
* {{ic|autoconf}}  not used, leave blank or fill with {{ic|none}} or {{ic|off}}&lt;br /&gt;
* {{ic|dns1}}      address of the DNS server&lt;br /&gt;
* {{ic|dns2}}      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
{{ic|alpine_repo{{=}}}} : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/v3.19/main}}&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/edge/main}}&lt;br /&gt;
&lt;br /&gt;
{{ic|modloop{{=}}}} : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the {{ic|modloop}} image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
{{ic|ssh_key{{=}}}} : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into {{ic|/root/.ssh/authorized_keys}} in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{ic|dasd{{=}}}} : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
{{ic|s390x_net{{=}}}} : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name {{ic|qeth_l2}} is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
{{cmd|$ qemu-img create alpine_disk.qcow2 5G}}&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso}}&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify {{ic|ip{{=}}}} {{ic|alpine_repo{{=}}}} {{ssh_key{{=}}}} for your needs)&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip{{=}}192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo{{=}}&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://www.example.net/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
                                      [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
The host is a Fedora Linux V39&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.3::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File] for details&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# !!!Don&#039;t put any IP over the QETH device!!!&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at the moment of send the alpine-setup.sh script the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
This script must be executed before the IPL of the guest zLinux&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use {{ic|only}} 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
{{ic|This step is not necessary under Hercules (Hyperion) Emulator installation}}&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
{{ic|$ ssh root@192.168.1.2}} (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing {{key|Ctrl}} + {{key|C}}. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# setup-disk -s 0}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26086</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26086"/>
		<updated>2023-12-29T08:24:46Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on {{ic|2 or more DASDs}} (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is {{ic|not supported}} in the installer script ({{ic|setup-alpine}}) at the moment. If you want to install/extend on more than 1 DASD. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : {{ic|https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt}})&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}dhcp}} : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2}} : use static IP configuration, each field is separated by a colon {{ic|:}}&lt;br /&gt;
* {{ic|client-ip}} ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* {{ic|server-ip}} not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|gw-ip}}     the gateway ip address&lt;br /&gt;
* {{ic|netmask}}   the netmask&lt;br /&gt;
* {{ic|hostname}}  not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|device}}    the network interface of the guest VM, default is {{ic|eth0}} if left blank&lt;br /&gt;
* {{ic|autoconf}}  not used, leave blank or fill with {{ic|none}} or {{ic|off}}&lt;br /&gt;
* {{ic|dns1}}      address of the DNS server&lt;br /&gt;
* {{ic|dns2}}      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
{{ic|alpine_repo{{=}}}} : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/v3.19/main}}&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/edge/main}}&lt;br /&gt;
&lt;br /&gt;
{{ic|modloop{{=}}}} : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the {{ic|modloop}} image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
{{ic|ssh_key{{=}}}} : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into {{ic|/root/.ssh/authorized_keys}} in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{ic|dasd{{=}}}} : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
{{ic|s390x_net{{=}}}} : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name {{ic|qeth_l2}} is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
{{cmd|$ qemu-img create alpine_disk.qcow2 5G}}&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso}}&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify {{ic|ip{{=}}}} {{ic|alpine_repo{{=}}}} {{ssh_key{{=}}}} for your needs)&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip{{=}}192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo{{=}}&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://www.example.net/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
                                      [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
The host is a Fedora Linux V39&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.3::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File] for details&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# {{ic|Don&#039;t put any IP over the QETH device}}&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at the moment of send the alpine-setup.sh script the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
This script must be executed before the IPL of the guest zLinux&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use {{ic|only}} 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
{{ic|This step is not necessary under Hercules (Hyperion) Emulator installation}}&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
{{ic|$ ssh root@192.168.1.2}} (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing {{key|Ctrl}} + {{key|C}}. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# setup-disk -s 0}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26085</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26085"/>
		<updated>2023-12-29T08:19:41Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on {{ic|2 or more DASDs}} (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is {{ic|not supported}} in the installer script ({{ic|setup-alpine}}) at the moment. If you want to install/extend on more than 1 DASD. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : {{ic|https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt}})&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}dhcp}} : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
{{ic|ip{{=}}client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2}} : use static IP configuration, each field is separated by a colon {{ic|:}}&lt;br /&gt;
* {{ic|client-ip}} ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* {{ic|server-ip}} not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|gw-ip}}     the gateway ip address&lt;br /&gt;
* {{ic|netmask}}   the netmask&lt;br /&gt;
* {{ic|hostname}}  not used, leave blank or fill with {{ic|none}}&lt;br /&gt;
* {{ic|device}}    the network interface of the guest VM, default is {{ic|eth0}} if left blank&lt;br /&gt;
* {{ic|autoconf}}  not used, leave blank or fill with {{ic|none}} or {{ic|off}}&lt;br /&gt;
* {{ic|dns1}}      address of the DNS server&lt;br /&gt;
* {{ic|dns2}}      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
{{ic|alpine_repo{{=}}}} : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/v3.19/main}}&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use {{ic|https://dl-cdn.alpinelinux.org/alpine/edge/main}}&lt;br /&gt;
&lt;br /&gt;
{{ic|modloop{{=}}}} : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the {{ic|modloop}} image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
{{ic|ssh_key{{=}}}} : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into {{ic|/root/.ssh/authorized_keys}} in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{ic|dasd{{=}}}} : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
{{ic|s390x_net{{=}}}} : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name {{ic|qeth_l2}} is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
{{cmd|$ qemu-img create alpine_disk.qcow2 5G}}&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso}}&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify {{ic|ip{{=}}}} {{ic|alpine_repo{{=}}}} {{ssh_key{{=}}}} for your needs)&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname{{=}}tap0,script{{=}}no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip{{=}}192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo{{=}}&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://www.example.net/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
The host is a Fedora Linux V39&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.3::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File] for details&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# {{ic|Don&#039;t put any IP over the QETH device}}&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at the moment of send the alpine-setup.sh script the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
This script must be executed before the IPL of the guest zLinux&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use {{ic|only}} 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
{{ic|This step is not necessary under Hercules (Hyperion) Emulator installation}}&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
{{ic|$ ssh root@192.168.1.2}} (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing {{key|Ctrl}} + {{key|C}}. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
{{cmd|# setup-disk -s 0}}&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26043</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26043"/>
		<updated>2023-12-28T11:46:49Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Customize the hercules.cnf file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
The host is a Fedora Linux V39&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.3::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File] for details&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# &#039;&#039;&#039;Don&#039;t put any IP over the QETH device&#039;&#039;&#039;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at the of send the alpine-setup.sh script the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
This script must be executed before the IPL of the guest zLinux&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26042</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26042"/>
		<updated>2023-12-28T11:45:41Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Create the parm file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
The host is a Fedora Linux V39&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.3::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# &#039;&#039;&#039;Don&#039;t put any IP over the QETH device&#039;&#039;&#039;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at the of send the alpine-setup.sh script the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
This script must be executed before the IPL of the guest zLinux&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26041</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26041"/>
		<updated>2023-12-28T11:45:11Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Hercules (Hyperion) Emulator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
The host is a Fedora Linux V39&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# &#039;&#039;&#039;Don&#039;t put any IP over the QETH device&#039;&#039;&#039;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at the of send the alpine-setup.sh script the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
This script must be executed before the IPL of the guest zLinux&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26040</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26040"/>
		<updated>2023-12-28T11:37:44Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Networking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# &#039;&#039;&#039;Don&#039;t put any IP over the QETH device&#039;&#039;&#039;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26039</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26039"/>
		<updated>2023-12-28T11:33:47Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Networking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# &#039;&#039;&#039;Don&#039;t put any IP over the QETH device&#039;&#039;&#039;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26038</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26038"/>
		<updated>2023-12-28T11:32:41Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Customize the hercules.cnf file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# ipaddr $(IPTAP)&lt;br /&gt;
# &#039;&#039;&#039;Don&#039;t put any IP over the QETH device&#039;&#039;&#039;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26032</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26032"/>
		<updated>2023-12-27T10:29:33Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Download the vmlinuz &amp;amp; initramfs to the host machine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] page take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26031</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26031"/>
		<updated>2023-12-27T10:19:34Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
AlpinezLinuxshell.png| the shell under Emulator&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=File:AlpinezLinuxshell.png&amp;diff=26030</id>
		<title>File:AlpinezLinuxshell.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=File:AlpinezLinuxshell.png&amp;diff=26030"/>
		<updated>2023-12-27T10:11:10Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An image for the shell under Hercules (Hyperion) Emulator&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26029</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26029"/>
		<updated>2023-12-27T10:05:35Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Customize the hercules.cnf file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
Create a file on $HOME/Alpine with name Alpine.cnf and copy the follow contents&lt;br /&gt;
See [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26028</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26028"/>
		<updated>2023-12-27T10:04:01Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Download the vmlinuz &amp;amp; initramfs to the host machine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] take the vmlinuz &amp;amp; initramfs files and put on $HOME/Alpine/rdrr directory&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26027</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26027"/>
		<updated>2023-12-27T10:03:09Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: /* Create the directorys on the HOST */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the directories on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] take the vmlinuz &amp;amp; initramfs files. &lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26026</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26026"/>
		<updated>2023-12-27T10:02:09Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the directorys on the HOST ====&lt;br /&gt;
&lt;br /&gt;
on $HOME&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir Alpine&lt;br /&gt;
cd Alpine&lt;br /&gt;
mkdir rdrr&lt;br /&gt;
mkdir dasd&lt;br /&gt;
mkdir prtr&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] take the vmlinuz &amp;amp; initramfs files. &lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your $HOME/Alpine/rdrr directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
On the $HOME/Alpine/dasd directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26025</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26025"/>
		<updated>2023-12-27T09:54:37Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] take the vmlinuz &amp;amp; initramfs files. &lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    $(PRTR)/PUNCH0005.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26024</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26024"/>
		<updated>2023-12-27T05:47:41Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: Refinate the procedure for install on Hercules (Hyperion) emulator&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Download the vmlinuz &amp;amp; initramfs to the host machine ====&lt;br /&gt;
&lt;br /&gt;
From the alpine [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/ download] take the vmlinuz &amp;amp; initramfs files. &lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for root user (123@@@)&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier) Pwd 123@@@.&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ip link   set dev  tap0     master    br0&lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26017</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26017"/>
		<updated>2023-12-26T15:42:15Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM &amp;amp; Hercules (Hyperion) Emulator is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observ the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for admin user&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ifconfig tap0 down&lt;br /&gt;
$sudo ifconfig tap0 up &lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26016</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26016"/>
		<updated>2023-12-26T15:41:36Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observ the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for admin user&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ifconfig tap0 down&lt;br /&gt;
$sudo ifconfig tap0 up &lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
&lt;br /&gt;
On hercules (Hyperion) emulator use &#039;&#039;&#039;only&#039;&#039;&#039; 1 dasd (the 0120 address preferibly)&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26015</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26015"/>
		<updated>2023-12-26T15:36:06Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121,0.0.0122,0.0.0123 &lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
Use only 3390 Model 3 (2.8 GB)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0122 3390-3 LIN122&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0123 3390-3 LIN123&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-3 LIN120  # Model 3 = 2.8GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-3 LIN121  # Model 3 = 2.8GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-3&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-3&lt;br /&gt;
0122 3390    $(DASD)/ZLINUX.0122  # 3390-3&lt;br /&gt;
0123 3390    $(DASD)/ZLINUX.0123  # 3390-3&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observ the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for admin user&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
if you obtain and &amp;quot;connection refused&amp;quot; at this point of the installation on the host machine use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$sudo ifconfig tap0 down&lt;br /&gt;
$sudo ifconfig tap0 up &lt;br /&gt;
$sudo firewall-cmd --zone=trusted --add-interface=tap0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
With hercules (hyperion) emulator do an IPL over the address of the boot disk to start the Alpine zLinux , in this case&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl 0120        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26014</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26014"/>
		<updated>2023-12-26T14:34:10Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
[https://sdl-hercules-390.github.io/html/ Hercules (Hyperion) zSeries Emulator]&lt;br /&gt;
&lt;br /&gt;
Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture. Hercules runs under Linux, Windows, Solaris, FreeBSD, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121&lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-9 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-9 LIN121&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-9 LIN120  # Model 9 = 8.5GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-9 LIN121  # Model 9 = 8.5GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-9&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-9&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observ the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for admin user&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26013</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26013"/>
		<updated>2023-12-26T14:27:15Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
This procedure is not tested on a native zSeries LPAR but will most likely work.&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121&lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-9 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-9 LIN121&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-9 LIN120  # Model 9 = 8.5GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-9 LIN121  # Model 9 = 8.5GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-9&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-9&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observ the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for admin user&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26012</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26012"/>
		<updated>2023-12-26T14:21:57Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121&lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-9 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-9 LIN121&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-9 LIN120  # Model 9 = 8.5GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-9 LIN121  # Model 9 = 8.5GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-9&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-9&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start $sysroot/etc/local.d/&lt;br /&gt;
chmod a+x $sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local $sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observ the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for admin user&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26011</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26011"/>
		<updated>2023-12-26T14:18:27Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules (Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121&lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-9 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-9 LIN121&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-9 LIN120  # Model 9 = 8.5GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-9 LIN121  # Model 9 = 8.5GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-9&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-9&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start \$sysroot/etc/local.d/&lt;br /&gt;
chmod a+x \$sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local \$sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observ the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
Start de Hercules (Hyperion) emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ sudo hercules -f Alpine.cnf &amp;gt; salida.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do the IPL from the CLI of the emulator&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
herc =====&amp;gt; ipl a        &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for admin user&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26010</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26010"/>
		<updated>2023-12-26T14:10:12Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: Add the Hercules (Hyperion) installation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules(Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hercules (Hyperion) Emulator ==&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;parmfile&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
dasd=0.0.0120,0.0.0121&lt;br /&gt;
s390x_net=qeth_l2,0.0.0600,0.0.0601,0.0.0602&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 &lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the dasd file(s) ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0120 3390-9 LIN120&lt;br /&gt;
dasdinit -lfs -linux ZLINUX.0121 3390-9 LIN121&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Customize the hercules.cnf file ====&lt;br /&gt;
see [https://sdl-hercules-390.github.io/html/hercconf.html#subs Hercules Configuration File]&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Hercules cnf File for zLinux (Alpine)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Define Vars&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
DEFSYM RUTA      /home/&amp;lt;user&amp;gt;/zLinux&lt;br /&gt;
DEFSYM DISTRO   &amp;quot;Alpine&amp;quot; &lt;br /&gt;
DEFSYM IPTAP    &amp;quot;192.168.1.3&amp;quot;&lt;br /&gt;
DEFSYM IFNM     &amp;quot;/dev/net/tun&amp;quot;&lt;br /&gt;
DEFSYM TAP0     &amp;quot;tap0&amp;quot;&lt;br /&gt;
DEFSYM DASD     $(RUTA)/$(DISTRO)/dasd&lt;br /&gt;
DEFSYM PRTR     $(RUTA)/$(DISTRO)/prtr&lt;br /&gt;
DEFSYM RDRR     $(RUTA)/$(DISTRO)/rdrr&lt;br /&gt;
DEFSYM PROD     $(RUTA)/$(DISTRO)&lt;br /&gt;
DEFSYM NUMCPU   &amp;quot;2&amp;quot;&lt;br /&gt;
DEFSYM MAXCPU   &amp;quot;3&amp;quot;&lt;br /&gt;
DEFSYM MAINSIZE &amp;quot;4196&amp;quot;         # 4 MB Ram&lt;br /&gt;
DEFSYM CPUM     &amp;quot;1090&amp;quot;         # &amp;quot;8561&amp;quot; # &amp;quot;2817&amp;quot;&lt;br /&gt;
DEFSYM CPUSER   &amp;quot;000001&amp;quot; &lt;br /&gt;
DEFSYM CNSLPORT &amp;quot;3270&amp;quot;&lt;br /&gt;
DEFSYM LPNAME   $(DISTRO)&lt;br /&gt;
DEFSYM LPNUM    &amp;quot;01&amp;quot;&lt;br /&gt;
DEFSYM LOADPARM &amp;quot;0120....&amp;quot;     #CS NS  SAM1&lt;br /&gt;
DEFSYM TIMERI   &amp;quot;500&amp;quot;          #400  &lt;br /&gt;
DEFSYM ARCHL    &amp;quot;z/ARCH&amp;quot;    &lt;br /&gt;
DEFSYM OS       &amp;quot;LINUX&amp;quot;       &lt;br /&gt;
DEFSYM HTTPPORT &amp;quot;8081&amp;quot; &lt;br /&gt;
DEFSYM TYPECPU  &amp;quot;IL&amp;quot;           #CP,IL,IP,AP GCP,IFL,ZIIP,ZAAP  &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# HMC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
ARCHLVL   $(ARCHL)     #z/ARCH&lt;br /&gt;
CNSLPORT  $(CNSLPORT)  #3270&lt;br /&gt;
CPUMODEL  $(CPUM)      #1090&lt;br /&gt;
CPUSERIAL $(CPUSER)    #000001&lt;br /&gt;
HTTP PORT $(HTTPPORT)  #8081&lt;br /&gt;
LPARNAME  $(LPNAME)    #Distro&lt;br /&gt;
LPARNUM   $(LPNUM)     #01 &lt;br /&gt;
ENGINES   $(MAXCPU)*$(TYPECPU) #3*IL (IFL)&lt;br /&gt;
MAINSIZE  $(MAINSIZE)  #4096 MB&lt;br /&gt;
MAXCPU    $(MAXCPU)    #3&lt;br /&gt;
NUMCPU    $(NUMCPU)    #2&lt;br /&gt;
TIMERINT  $(TIMERI)    #500&lt;br /&gt;
OSTAILOR  $(OS)        #LINUX&lt;br /&gt;
MOUNTED_TAPE_REINIT DISALLOW&lt;br /&gt;
DEVTMAX   0&lt;br /&gt;
PANOPT    TITLE=&amp;quot;zLinux on x86&amp;quot; RATE=SLOW&lt;br /&gt;
HERCLOGO  $(PROD)/Herclogo.txt&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
#SYSGPORT  3271&lt;br /&gt;
#LOADPARM  $(LOADPARM)  #0120..&lt;br /&gt;
#LPARNUM   BASIC       #BASIC 1 xx &lt;br /&gt;
#CPUIDFMT  BASIC       # 0 | 1 | BASIC&lt;br /&gt;
#DIAG8CMD  ENABLE&lt;br /&gt;
#CONKPALV  (3,1,10)&lt;br /&gt;
#SHCMDOPT  NODIAG8&lt;br /&gt;
#&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals Char-Type &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 0000 3215-C  $ NOPROMPT&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Punchs&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0005 3525    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Readers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000A 3505    $(RDRR)/vmlinuz-lts $(RDRR)/parmfile $(RDRR)/initramfs-lts autopad eof&lt;br /&gt;
000B 3505    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Terminals&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000C 3215    * &lt;br /&gt;
000D 3215    * &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Printers&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
000E 1403    $(PRTR)/PRT000E.txt crlf&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# BSC&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# 000F 2703    lnctl=TELE2 term=tty dial=no lport=3271&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Dasd&lt;br /&gt;
# Use dasdinit -lfs -linux ZLINUX.0120 3390-9 LIN120  # Model 9 = 8.5GB&lt;br /&gt;
#     dasdinit -lfs -linux ZLINUX.0121 3390-9 LIN121  # Model 9 = 8.5GB&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0120 3390    $(DASD)/ZLINUX.0120  # 3390-9&lt;br /&gt;
0121 3390    $(DASD)/ZLINUX.0121  # 3390-9&lt;br /&gt;
# .........&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Tapes&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0580 3420    *&lt;br /&gt;
0581 3420    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Comunications IP (OSA)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0600-0602 QETH ifname $(TAP0) ipaddr $(IPTAP) iface $(IFNM) mtu 1500 chpid 0 #debug &lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# Consoles&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
0700 3270    *&lt;br /&gt;
0701 3270    *&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
# End(and Fun)&lt;br /&gt;
# --------------------------------------------------------------------#&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Customize the Alpine initramfs-lts file ====&lt;br /&gt;
&lt;br /&gt;
This step is necessary because the emulator don&#039;t have a Linux tty console and at this point the ssh session with root is not permitted.&lt;br /&gt;
The trick is put a root password and create a admin user. This &amp;quot;hack&amp;quot; is taken from [https://unix.stackexchange.com/questions/689678/automate-alpine-linux-installation Automate Alpine Linux Installation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Alpine has a service called local.&lt;br /&gt;
When this service start, it will execute all scripts named *.start found in /etc/local.d/.&lt;br /&gt;
But local service is not enabled by default.&lt;br /&gt;
Follow these Steps to enable local service, and let it execute our script:&lt;br /&gt;
&lt;br /&gt;
1.- write your installation script, save to myscript.start&lt;br /&gt;
extract initramfs-lts. Need to do this in an empty folder&lt;br /&gt;
&lt;br /&gt;
zcat initramfs-lts | cpio -idm&lt;br /&gt;
rm -f initramfs-lts&lt;br /&gt;
edit init file. &lt;br /&gt;
&lt;br /&gt;
find&lt;br /&gt;
exec switch_root $switch_root_opts $sysroot $chart_init &amp;quot;$KOPT_init&amp;quot; $KOPT_init_args&lt;br /&gt;
&lt;br /&gt;
2.-Add these 3 lines before the exec command:&lt;br /&gt;
&lt;br /&gt;
cp /myscript.start \$sysroot/etc/local.d/&lt;br /&gt;
chmod a+x \$sysroot/etc/local.d/myscript.start&lt;br /&gt;
ln -s /etc/init.d/local \$sysroot/etc/runlevels/default/&lt;br /&gt;
copy myscript.start to the same folder of init file&lt;br /&gt;
&lt;br /&gt;
3.-repack initramfs-lts&lt;br /&gt;
&lt;br /&gt;
find . | cpio -o -H newc | gzip -1 &amp;gt;initramfs-lts&lt;br /&gt;
replace initramfs-lts from iso to the new one.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reference: https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html&lt;br /&gt;
&lt;br /&gt;
The myscript.start &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# delete this hack otherwise this script will run forever&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
rm -f /etc/local.d/myscript.start&lt;br /&gt;
rm -f /etc/runlevels/default/local&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# change root pwd to 123@@@ &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
echo root:123@@@ | chpasswd&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# create a admin user &amp;amp; change pwd to 123@@@  &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
setup-user -a -u -f Admin admin&lt;br /&gt;
echo admin:123@@@ | chpasswd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Networking ====&lt;br /&gt;
The access to internet needs a Bridge &amp;amp; TAP interface. Write a script as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Define tap zLinux zOS&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
BRIDGE=br0&lt;br /&gt;
ETH=eno1&lt;br /&gt;
TAP0=tap0&lt;br /&gt;
IPBR0=192.168.1.2&lt;br /&gt;
IPTAP=192.168.1.3&lt;br /&gt;
BROADC=192.168.1.255&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Conectivity&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip link   add name &amp;quot;$BRIDGE&amp;quot;   type bridge&lt;br /&gt;
sudo ip tuntap add      &amp;quot;$TAP0&amp;quot;     mode tap &lt;br /&gt;
sudo ip addr   add      &amp;quot;$IPBR0&amp;quot;/24 broadcast &amp;quot;$BROADC&amp;quot; dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$BRIDGE&amp;quot;   up&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$TAP0&amp;quot;     master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
sudo ip link   set dev  &amp;quot;$ETH&amp;quot;      master    &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# FW Rules&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --permanent --zone=trusted \&lt;br /&gt;
#                  --add-interface=&amp;quot;$TAP0&amp;quot;&lt;br /&gt;
#sudo firewall-cmd --reload&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
# Routes&lt;br /&gt;
# --------------------------------------------------------------------&lt;br /&gt;
sudo ip route add default via 192.168.1.1 dev &amp;quot;$BRIDGE&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observ the firewall rules to permit the trafic over this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with user admin, after login do it root with su - &amp;amp; the password of the mysscript.start for admin user&lt;br /&gt;
&lt;br /&gt;
 $ ssh admin@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26009</id>
		<title>S390x/Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=S390x/Installation&amp;diff=26009"/>
		<updated>2023-12-26T12:55:37Z</updated>

		<summary type="html">&lt;p&gt;LnkLst: Change version of Alpine &amp;amp; reference to Hercules (Hyperion) Emulator&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
= 1. Known Issues =&lt;br /&gt;
1. Installation on 2 or more DASDs (either ECKD and FBA) on z/VM is not supported in the installer script (&amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;) at the moment. If you want to install/extend on more than 1 DASD, see [[S390x#Extending_LVM_volume|Extending LVM volume]. However, installation on 2 or more virtio (SCSI) disks on KVM is supported just like other architectures.&lt;br /&gt;
&lt;br /&gt;
= 2. The boot media =&lt;br /&gt;
&lt;br /&gt;
For KVM, both ISO image and netboot media (kernel and initramfs) are supported.&lt;br /&gt;
&lt;br /&gt;
For z/VM and Hercules (Hyperion) emulator, netboot media is supported.&lt;br /&gt;
&lt;br /&gt;
For LPAR, netboot media is supported. See [[S390x/Installation/LPAR|LPAR]] for more information.&lt;br /&gt;
&lt;br /&gt;
Boot media are found at:&lt;br /&gt;
&lt;br /&gt;
* https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel parameters (and parmfile) ==&lt;br /&gt;
The Alpine s390x boot media requires following kernel parameters to work: (Details at : &amp;lt;code&amp;gt;https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=dhcp&amp;lt;/code&amp;gt; : use DHCP for network configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf:dns1:dns2&amp;lt;/code&amp;gt; : use static IP configuration, each field is separated by a colon &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;client-ip&amp;lt;/code&amp;gt; ip address of the guest VM where we are going to run the installer&lt;br /&gt;
* &amp;lt;code&amp;gt;server-ip&amp;lt;/code&amp;gt; not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;gw-ip&amp;lt;/code&amp;gt;     the gateway ip address&lt;br /&gt;
* &amp;lt;code&amp;gt;netmask&amp;lt;/code&amp;gt;   the netmask&lt;br /&gt;
* &amp;lt;code&amp;gt;hostname&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;device&amp;lt;/code&amp;gt;    the network interface of the guest VM, default is &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt; if left blank&lt;br /&gt;
* &amp;lt;code&amp;gt;autoconf&amp;lt;/code&amp;gt;  not used, leave blank or fill with &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;dns1&amp;lt;/code&amp;gt;      address of the DNS server&lt;br /&gt;
* &amp;lt;code&amp;gt;dns2&amp;lt;/code&amp;gt;      address of the 2nd DNS server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; : the location of the Alpine repository from which packages are downloaded.&lt;br /&gt;
&lt;br /&gt;
:For stable release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:For rolling release, use &amp;lt;code&amp;gt;https://dl-cdn.alpinelinux.org/alpine/edge/main&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modloop=&amp;lt;/code&amp;gt; : the remote location of the image containing kernel&#039;s modules, required for LVM and raid setup.&lt;br /&gt;
&lt;br /&gt;
:The remote location of the &amp;lt;code&amp;gt;modloop&amp;lt;/code&amp;gt; image is the same as the kernel and initramfs (see below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; : the remote location of your SSH public key which is used to allow SSH connection into the installer. It will be downloaded and copied into &amp;lt;code&amp;gt;/root/.ssh/authorized_keys&amp;lt;/code&amp;gt; in the installer.&lt;br /&gt;
&lt;br /&gt;
{{Note|Fetching public keys from HTTP, HTTPS and FTPS is supported. HTTP should be used only in a local environment where you own the network.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux security policies are against using passwords for root access via SSH as we consider using public-private key pairs to be a much better approach.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;z/VM &amp;amp; Hercules(Hyperion) Emulator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt; : the addresses of the DASD devices, either ECKD or FBA DASDs. Each device is separated with a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; : the network interface type and its subchannels. At the moment, only QETH layer 2 is supported, thus the name &amp;lt;code&amp;gt;qeth_l2&amp;lt;/code&amp;gt; is used (see below).&lt;br /&gt;
&lt;br /&gt;
= 3. Pre-installation =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KVM ==&lt;br /&gt;
Create a virtual disk:&lt;br /&gt;
 $ qemu-img create alpine_disk.qcow2 5G&lt;br /&gt;
&lt;br /&gt;
==== Using iso image ====&lt;br /&gt;
Download latest iso image from : https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x&lt;br /&gt;
&lt;br /&gt;
Start qemu:&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -boot d -cdrom alpine-standard-3.19.0-s390x.iso&lt;br /&gt;
&lt;br /&gt;
==== Using netboot media ====&lt;br /&gt;
Download the latest [https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts kernel] and [https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/s390x/netboot/initramfs-lts initramfs].&lt;br /&gt;
&lt;br /&gt;
Start qemu: (modify &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
 $ qemu-system-s390x -M s390-ccw-virtio \&lt;br /&gt;
        -m 1024 -smp 2 -nographic -enable-kvm \&lt;br /&gt;
        -net nic -net tap,ifname=tap0,script=no \&lt;br /&gt;
        -hda alpine_disk.qcow2 \&lt;br /&gt;
        -kernel vmlinuz-lts \&lt;br /&gt;
        -initrd initramfs-lts \&lt;br /&gt;
        -append &amp;quot;ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1 alpine_repo=&amp;lt;nowiki&amp;gt;https://dl-cdn.alpinelinux.org/alpine/v3.19/main modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts ssh_key=https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you have direct access to the qemu console, &amp;lt;code&amp;gt;ssh_key&amp;lt;/code&amp;gt; might not be required.}}&lt;br /&gt;
&lt;br /&gt;
== z/VM ==&lt;br /&gt;
To ease out the process of downloading the images, punch the readers, ipl, etc., [https://github.com/trothr/znetboot &#039;&#039;&#039;ZNETBOOT&#039;&#039;&#039;] is used.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using a FTP server to host the images and download them from x3270 console also works - thus no need to use ZNETBOOT. }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Create the parm file ====&lt;br /&gt;
On your workstation/laptop, create a file named &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt; in your home directory with contents below (modify &amp;lt;code&amp;gt;dasd=&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;s390x_net=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ip=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;alpine_repo=&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ssh_key=&amp;lt;/code&amp;gt; for your needs)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ZNETBOOT_KERNEL=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/vmlinuz-lts&lt;br /&gt;
ZNETBOOT_INITRD=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/initramfs-lts&lt;br /&gt;
ZNETBOOT_PROGRESS=1M&lt;br /&gt;
&lt;br /&gt;
alpine_repo=https://dl-cdn.alpinelinux.org/alpine/v3.19/main&lt;br /&gt;
modloop=https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/s390x/netboot/modloop-lts&lt;br /&gt;
&lt;br /&gt;
dasd=0.0.04c0,0.0.05d1&lt;br /&gt;
s390x_net=qeth_l2,0.0.0560,0.0.0561,0.0.0562&lt;br /&gt;
ip=192.168.1.2::192.168.1.1:255.255.255.0::::8.8.8.8:1.1.1.1&lt;br /&gt;
&lt;br /&gt;
ssh_key=https://your-website.com/your-ssh-key.pub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Upload to z/VM system via 3270 client ====&lt;br /&gt;
[[File:X3270-1.png|right|300px|thumb|Figure 1.]]&lt;br /&gt;
On your workstation/laptop, download 2 files [https://raw.githubusercontent.com/trothr/znetboot/master/znetboot.exec &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;], and [https://raw.githubusercontent.com/trothr/znetboot/master/curl.rexx &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt;] to your home directory.&lt;br /&gt;
&lt;br /&gt;
Open 3270 client and log in the z/VM system with your z/VM username and password.&lt;br /&gt;
&lt;br /&gt;
Upload 3 files &amp;lt;code&amp;gt;alpine.znetboot&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; to the z/VM environment using the 3270 client (this tutorial uses x3270). On the top left corner, click &amp;quot;File&amp;quot;, then &amp;quot;File Transfer&amp;quot;. (Figure 1.)&lt;br /&gt;
&lt;br /&gt;
Do following steps : (Figure 2.) [[File:X3270-2.png|right|300px|thumb|Figure 2.]]&lt;br /&gt;
* On &amp;quot;Local File Name&amp;quot; box, enter &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; (the file in your laptop/workstation, at &#039;&#039;&#039;~/alpine.znetboot&#039;&#039;&#039;)&lt;br /&gt;
* On &amp;quot;Host File Name&amp;quot; box, enter &#039;&#039;&#039;alpine znetboot&#039;&#039;&#039; (the file will be in z/VM console)&lt;br /&gt;
&lt;br /&gt;
{{Note|Beware the difference between &#039;&#039;&#039;the dot &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&#039;&#039;&#039; and &#039;&#039;&#039;the space &amp;lt;code&amp;gt; &amp;lt;/code&amp;gt;&#039;&#039;&#039; characters in the file names.}}&lt;br /&gt;
&lt;br /&gt;
* Choose &#039;&#039;&#039;Send to host&#039;&#039;&#039;&lt;br /&gt;
* Choose &#039;&#039;&#039;Host is VM/CMS&#039;&#039;&#039;&lt;br /&gt;
* Choose either &#039;&#039;&#039;Fixed&#039;&#039;&#039; or &#039;&#039;&#039;Variable&#039;&#039;&#039; for &#039;&#039;&#039;Record Format&#039;&#039;&#039;&lt;br /&gt;
:Enter a number for LRECL and BLKSIZE, respectively&lt;br /&gt;
{{Note|Any line in &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; that has more 80 chars (columns) will be splitted into more than 1 line when uploaded to z/VM (CMS) console via 3270. Count the number of characters/column of the longest line in your &#039;&#039;&#039;alpine.znetboot&#039;&#039;&#039; and fill it in LRECL. There is no restriction for BLKSIZE but 80 is preferred.}}&lt;br /&gt;
&lt;br /&gt;
* Click &#039;&#039;&#039;Transfer File&#039;&#039;&#039; box&lt;br /&gt;
&lt;br /&gt;
Repeat the same steps with &amp;lt;code&amp;gt;znetboot.exec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;curl.rexx&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Check the configuration files ====&lt;br /&gt;
On 3270 client, enter following commands to check if the configuration files are correctly transferred:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit alpine znetboot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit znetboot exec&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;xedit curl rex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or &amp;lt;code&amp;gt;filel&amp;lt;/code&amp;gt; and put &amp;lt;code&amp;gt;xedit&amp;lt;/code&amp;gt; on CMD column to edit respective file.&lt;br /&gt;
&lt;br /&gt;
==== Start ZNETBOOT ====&lt;br /&gt;
On 3270 client, type below command and wait till Figure 3.: [[File:X3270-3.png|right|300px|thumb|Figure 3.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;znetboot alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Installation =&lt;br /&gt;
If you install on z/VM or Hercules (Hyperion) Emulator, steps in this part does not involve the interaction with the 3270 client anymore. Everything is done in the terminal with SSH client.&lt;br /&gt;
&lt;br /&gt;
If you install on KVM, you can either SSH into the installer (below) or directly use the console starting qemu.&lt;br /&gt;
&lt;br /&gt;
Either installing in KVM or z/VM environments, from your workstation/laptop, you will be able to run:&lt;br /&gt;
 $ ssh root@192.168.1.2 (change ip address to what you specified earlier).&lt;br /&gt;
On Hercules (Hyperion) emulator will be with other user (see below)&lt;br /&gt;
&lt;br /&gt;
Remaining steps are similar to installing Alpine on other architectures (x86, arm, ppc, etc.), either on KVM (using virtio/SCSI disks) or on z/VM and Hercules (Hyperion) emulator with FBA DASDs. Installing on ECKD DASDs requires an additional step, as described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Below is the detailed walkthrough of installing Alpine on a single ECKD DASD using LVM and extend that LVM to the second ECKD DASD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After SSH-ing into the Alpine installer, run:&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Select keyboard layout [none]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter system hostname (short form, e.g. &#039;foo&#039;) [localhost]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter your hostname&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available interfaces are: eth0.&lt;br /&gt;
Enter &#039;?&#039; for help on bridges, bonding and vlans.&lt;br /&gt;
Which one do you want to initialize? (or &#039;?&#039; or &#039;done&#039;) [eth0]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:type &#039;eth0&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Ip address for eth0? (or &#039;dhcp&#039;, &#039;none&#039;, &#039;?&#039;) [192.168.1.2]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter ip address or &#039;dhcp&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Netmask? [255.255.255.0]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter netmask&lt;br /&gt;
&amp;lt;code&amp;gt;Gateway? (or &#039;none&#039;) [192.168.1.1]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter gateway&#039;s ip address&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Do you want to do any manual network configuration? [no]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;no&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS domain name? (e.g &#039;bar.com&#039;) []&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter domain name or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DNS nameserver(s)? [8.8.8.8 ]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter DNS nameserver&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Changing password for root&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter root password&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which timezone are you in? (&#039;?&#039; for list) [UTC]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter timezone or &#039;?&#039; for list of timezones&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HTTP/FTP proxy URL? (e.g. &#039;&amp;lt;nowiki&amp;gt;http://proxy:8080&amp;lt;/nowiki&amp;gt;&#039;, or &#039;none&#039;) [none]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter proxy or press Enter for none&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Enter mirror number (1-27) or URL to add (or r/f/e/done) [f]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter a number or &#039;r&#039; or &#039;f&#039; or &#039;e&#039; or &#039;done&#039; as described&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which SSH server? (&#039;openssh&#039;, &#039;dropbear&#039; or &#039;none&#039;) [openssh]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter SSH server or press Enter for openssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Which NTP client to run? (&#039;busybox&#039;, &#039;openntpd&#039;, &#039;chrony&#039; or &#039;none&#039;) [chrony]&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;busybox&#039; or press Enter for chrony&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; (next step is the additional step for ECKD DASDs on z/VM)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available ECKD DASD(s) are:&lt;br /&gt;
  0.0.04c0	(3390/0c 3990/e9 IBM)&lt;br /&gt;
  0.0.05d1	(3390/0c 3990/e9 IBM)&lt;br /&gt;
Which ECKD DASD(s) would you like to be formatted using dasdfmt? (enter &#039;?&#039; for help) [all]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;all&#039; or &#039;0.0.04c0 0.0.05d1&#039; &#039;&#039;&#039;(separated by a space)&#039;&#039;&#039; to format all/both DASDs&lt;br /&gt;
:enter &#039;0.0.04c0&#039; or &#039;0.0.05d1&#039; to format respective DASD&lt;br /&gt;
:enter &#039;?&#039; for help&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WARNING: Erase ECKD DASD 0.0.04c0? [y/N]:&amp;lt;/code&amp;gt;&lt;br /&gt;
:enter &#039;y&#039; to format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Available disks are:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [dasda]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;dasda&#039; or press Enter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039;, &#039;lvm&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;lvm&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The following disk is selected (with LVM):&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
How would you like to use it? (&#039;sys&#039;, &#039;data&#039; or &#039;?&#039; for help) [?]&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;sys&#039; to install Alpine on disk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WARNING: The following disk(s) will be erased:&lt;br /&gt;
  dasda	(2.5 GB IBM 0.0.04c0)&lt;br /&gt;
WARNING: Erase the above disk(s) and continue? [y/N]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
:enter &#039;y&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;&lt;br /&gt;
:the installation is finished&lt;br /&gt;
&lt;br /&gt;
At this point, don&#039;t poweroff the installer right away. Go to [[S390x/Installation#Copying_SSH_keys_to_new_Alpine_system|Copying SSH keys to new Alpine system]] (below) to have SSH access to your new Alpine system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copying SSH keys to new Alpine system ==&lt;br /&gt;
&lt;br /&gt;
By default, Alpine disables root login with a password via SSH. SSH keys are used instead.&lt;br /&gt;
&lt;br /&gt;
After the installer&#039;s done running (&amp;lt;code&amp;gt;Installation is complete. Please reboot.&amp;lt;/code&amp;gt;), there are 2 ways to copy your SSH key into the new Alpine system:&lt;br /&gt;
* Option 1: mount the installed disk and copy the SSH keys while still at the installer&#039;s terminal&lt;br /&gt;
* Option 2: poweroff the installer, start the new Alpine system and directly add the SSH keys&lt;br /&gt;
::: if you install on KVM, boot the new Alpine system on qemu, and copy the SSH keys&lt;br /&gt;
::: if you install on z/VM, use the 3270 client to ipl the new Alpine system and copy the SSH keys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;lvm&#039; + &#039;sys&#039; installation (like in above example), do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/vg0/lv_root /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use &#039;sys&#039; (without LVM) installation, do:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # mount /dev/dasda3 /mnt&amp;lt;/code&amp;gt; (change dasda to dasdb or dasdc, etc. for whichever DASD you chose)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; # cp -ar /root/.ssh /mnt/root&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In &#039;sys&#039; installation, 1st partition is boot, 2nd partition is swap, 3rd partition is root }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Option 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt; # poweroff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use KVM, start qemu with new Alpine system (removing &amp;lt;code&amp;gt;-kernel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-initrd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-append&amp;lt;/code&amp;gt; options)&lt;br /&gt;
&lt;br /&gt;
If you use z/VM, open the 3270 client, login with your z/VM username and password. You may need to run &amp;lt;code&amp;gt; ipl cms&amp;lt;/code&amp;gt;. Then run &amp;lt;code&amp;gt; ipl 04c0&amp;lt;/code&amp;gt; (or whichever DASD device you chose as root disk in earlier steps).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait for new Alpine system go up, then login as root user while in the qemu console (on KVM) or 3270 client (on z/VM). Then run:&lt;br /&gt;
::&amp;lt;code&amp;gt; # mkdir /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # wget &amp;lt;nowiki&amp;gt;https://your-website.com/your-ssh-key.pub&amp;lt;/nowiki&amp;gt; -O /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 700 /root/.ssh&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt; # chmod 600 /root/.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Go to [[S390x/Installation#Login_to_new_Alpine_system|Login to new Alpine system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login to new Alpine system ==&lt;br /&gt;
On your workstation/laptop, use SSH client to login new Alpine system:&lt;br /&gt;
&amp;lt;code&amp;gt; $ ssh root@192.168.1.2&amp;lt;/code&amp;gt; (or whichever ip address you used)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending LVM volume ==&lt;br /&gt;
After logging in to your new Alpine system, run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add -q util-linux e2fsprogs-extra&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  1.6G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk&lt;br /&gt;
&lt;br /&gt;
# dasdfmt -b 4096 -d cdl -yp /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# fdasd -a /dev/dasdb&lt;br /&gt;
&lt;br /&gt;
# pvcreate /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# vgextend vg0 /dev/dasdb1&lt;br /&gt;
&lt;br /&gt;
# lvextend -l +100%FREE /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# resize2fs /dev/vg0/lv_root&lt;br /&gt;
&lt;br /&gt;
# lsblk&lt;br /&gt;
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT&lt;br /&gt;
dasda            94:0    0  2.3G  0 disk &lt;br /&gt;
├─dasda1         94:1    0  100M  0 part /boot&lt;br /&gt;
└─dasda2         94:2    0  2.2G  0 part &lt;br /&gt;
  ├─vg0-lv_swap 254:0    0  588M  0 lvm  [SWAP]&lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
dasdb            94:4    0  2.3G  0 disk &lt;br /&gt;
└─dasdb1         94:5    0  2.3G  0 part &lt;br /&gt;
  └─vg0-lv_root 254:1    0  3.9G  0 lvm  /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 5. Tips =&lt;br /&gt;
If you want to disable swap partition, after finishing NTP client step, quit the installer by pressing &amp;lt;code&amp;gt;Ctrl + C&amp;lt;/code&amp;gt;. Then run following command to complete remaining steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# setup-disk -s 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|If you do &#039;sys&#039; installation, there will be no swap partition anymore and 1st partition will be boot, 2nd partition will be root}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:IBM]]&lt;/div&gt;</summary>
		<author><name>LnkLst</name></author>
	</entry>
</feed>