
**ATTENTION:** L'installeur de RedHat est extrêmement picky.

## Serveur d'installation

Il est largement préférable d'utiliser un serveur d'install "standard", aka un vrai Unix.

Problèmes connus:

* Sous Windows, les caractères de fin de ligne sont `CR` suivi de `LF`; sous Unix, la fin de ligne est codée avec le caractère `LF` uniquement.

	Si un client utilise un serveur d'installation FTP sous Windows, prévoir d'utiliser un outil qui permet d'ajuster comment les caractère de fin de ligne sont transférer (comme Filezilla Server). Cf https://wiki.filezilla-project.org/Data_Type
	Sans celà, le programme d'installation ne sera pas en mesure de parser les fichiers textes correctement.

* Le serveur FTP de z/OS utilse l'encodage EBCDIC. Même constat que pour Windows.

## Installation depuis un DASD

Pour #CA-GIP, le client a voulu faire une install de Linux sous z/VM, en utilisant un serveur FTP sous z/OS.
Ca ne fonctionne pas, pour des raisons diverses:
* problème d'encodage / conversion de codepage
* manque de fonctionnalité du serveur FTP de z/OS

Debbie Townsend, du support Linux on Z, a proposé une solution qui permet d'utiliser une image ISO posée sur un MDISK z/VM comme source d'install.
La méthode est indiquée ci-dessous.


This exercise installs RHEL8.4 on a z/VM guest by 
using the installation shell to create a DASD which
hosts the ISO image to do the install. 

Specifically it shows that the installation shell
has the necessary utilities to create a DASD to host
the ISO Image; and that a zLinux installation can
be performed from a DASD which contains an ISO image. 

There are more efficient ways to accomplish this 
is most environments.  This exercise is specifically 
targetted for a customer who has no linux instances
already installed on the CEC ; and whose only FTP 
server is modifying non-binary files. 

PLease note that I am using RHEL 8.4 although the 
customer is using RHEL 8.8.   I am using z/VM user
DEBBY; and DASD 0.0.3614 as my ISO repository 
and DASD 0.0.0100 as my installation disk.  These. 
as well ad the ftp server address, will be different 
for the customer. 

A) Boot the installation shell 
B) Introduce a DASD which we can dedicate to ISO images. 
C) Prepare and populate the DASD 
D) Restart the installation, including the new DASD

A) Boot the installation shell 

So from the 3270 z/VM session, I ran the RH84 script 
and got to the point that it says : 

```bash
[   32.026309] anaconda[1787]: Starting installer, one moment...             
[   32.026350] anaconda[1787]: 21:39:01 Please ssh install@z14debby (9.175.17.38) to begin the install.       
```                                             


`# ssh -l install 9.175.172.238`

Chose 2 for text install 
Chose 8 to get into the shell. 

This shell gives us vmcp, lsdasd, mkfs.ext[234], mkfs.xfs 
dasdfmt and fdasd. 


B) Introduce a DASD which we can dedicate to ISO images. 


I am going to use the DASD with physical address 0.0.3614 
to which I will give virtual address 3614, although since this
is not a boot DASD, the virtual address is not particularly
important. 

From the z/VM MAINT user 
	ATT 3614 DEBBY 

Back in the installation shell: 
```bash
sh-4.4# vmcp q dasd
DASD 0100 ON DASD  3608 R/W 0X0100 SUBCHANNEL = 0007
DASD 0190 3390 M01RES R/O        214 CYL ON DASD  3702 SUBCHANNEL = 000E
DASD 0191 3390 LNXPER R/W        500 CYL ON DASD  3706 SUBCHANNEL = 0009
DASD 019D 3390 M01RES R/O        292 CYL ON DASD  3702 SUBCHANNEL = 000F
DASD 019E 3390 M01RES R/O        500 CYL ON DASD  3702 SUBCHANNEL = 0010
DASD 0402 3390 M01RES R/O        292 CYL ON DASD  3702 SUBCHANNEL = 0011
DASD 0592 3390 M01RES R/O        240 CYL ON DASD  3702 SUBCHANNEL = 0000
DASD 3600 ON DASD  3600 R/W 0X3600 SUBCHANNEL = 0008
DASD 3614 ON DASD  3614 R/W        SUBCHANNEL = 0012
```

```bash
sh-4.4# lsdasd
Bus-ID    Status    Name      Device  Type         BlkSz  Size      Blocks
================================================================================
0.0.0100  active    dasda     94:0    ECKD         4096   7043MB    1803060

sh-4.4# cio_ignore -r 3614
sh-4.4# chccwdev -e 3614
Setting device 0.0.3614 online
Done
```
```bash
sh-4.4# lsdasd
Bus-ID    Status    Name      Device  Type         BlkSz  Size      Blocks
================================================================================
0.0.0100  active    dasda     94:0    ECKD         4096   7043MB    1803060
0.0.3614  n/f       dasdb     94:4    ECKD
```


C) Prepare and populate the DASD 

```bash
sh-4.4# dasdfmt -y /dev/dasdb
Please enter the blocksize of the formatting [4096]:

Finished formatting the device.
Rereading the partition table... ok
```

```bash
sh-4.4# lsdasd
Bus-ID    Status    Name      Device  Type         BlkSz  Size      Blocks
================================================================================
0.0.0100  active    dasda     94:0    ECKD         4096   7043MB    1803060
0.0.3614  active    dasdb     94:4    ECKD         4096   7043MB    1803060
```

```bash
sh-4.4# fdasd -a /dev/dasdb
reading volume label ..: VOL1
reading vtoc ..........: ok

auto-creating one partition for the whole disk...
writing volume label...
writing VTOC...
rereading partition table...
```

```bash
sh-4.4# mkfs.ext2 /dev/dasdb1
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 1803036 4k blocks and 451584 inodes
Filesystem UUID: 07b41741-56e7-4104-b74d-545ba9851df7
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

sh-4.4# mkdir /mnt2
sh-4.4# mount /dev/dasdb1 /mnt2
sh-4.4# cd /mnt2
```


```bash
sh-4.4# ftp  9.175.172.168
...
ftp> binary
200 Switching to Binary mode.
ftp> get RHEL-8.4.0-20210503.1-s390x-dvd1.iso
...
226 Transfer complete.
7194284032 bytes received in 90.5 secs (79487.50 Kbytes/sec)
```

So now the ISO image resides on the 1st partition of DASD 0.0.3614 

Exit back into the installation menu and choose option 
3) Installation source 
2) local ISO file 

Note that the new DASD is not an option.  At this point we have to 
restart the installation and let 0.0.3614 be one of the DASD 
defined in the parameter file. 

----
----

D) Restart the installation, including the new DASD
Exit back to CMS 


Added to the parameter file 
`rd.dasd=0.0.3614` 
( So there are now two rd.dasd assignments in the parm file ) 

Restarted the installation ssh'd to the installation shell. 

`ssh -l install 9.175.172.238`

```bash
Choose options : 
2) Use text mode 
3) Installation Source 
2) Local ISO file 
```

Now I see :

```bash
Select device containing the ISO file

1)  /dev/dasda1 (1 GiB) xfs e8e0cca0-bb3b-4d82-8e19-a5cab0ea3f56
2)  /dev/dasdb1 (6.88 GiB) ext2 07b41741-56e7-4104-b74d-545ba9851df7

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 2
================================================================================
================================================================================
Select an ISO to use as install source

1) RHEL-8.4.0-20210503.1-s390x-dvd1.iso

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 1  
```

--
I am then back in the main installation menu.

After a few minutes, I press 'r' to refresh ; and 'Installation Source' is now correct: 

```bash
3) [x] Installation source               4) [!] Software selection
       (dasdb1:/RHEL-8.4.0-20210503.1-s         (Source changed - please verify)
       390x-dvd1.iso)
```

Continued with the installation . Do not choose the DASD which contains
the ISO image as your destination . 

The installation worked as expected after that point.  Of course you 
are restricted to products that are on this particular ISO. 
