|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * installing/installing_with_agent_based_installer/prepare-pxe-assets-agent.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="adding-ibm-z-lpar-agents-day-2_{context}"] |
| 7 | += Adding {ibm-z-title} agents in a Logical Partition (LPAR) to an existing cluster |
| 8 | + |
| 9 | +In {product-title} {product-version}, the `.ins` and `initrd.img.addrsize` files are not automatically generated as part of the boot-artifacts for an existing cluster. You must manually generate these files for {ibm-z-name} clusters running in an LPAR. |
| 10 | + |
| 11 | +The `.ins` file is a special file that includes installation data and is present on the FTP server. You can access this file from the hardware management console (HMC) system. This file contains details such as mapping of the location of installation data on the disk or FTP server and the memory locations where the data is to be copied. |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* A running file server with access to the LPAR. |
| 16 | +
|
| 17 | +.Procedure |
| 18 | + |
| 19 | +. Generate the `.ins` and `initrd.img.addrsize` files: |
| 20 | + |
| 21 | +.. Retrieve the size of the `kernel` and `initrd` by running the following commands: |
| 22 | ++ |
| 23 | +[source,terminal] |
| 24 | +---- |
| 25 | +$ KERNEL_IMG_PATH='./kernel.img' |
| 26 | +---- |
| 27 | ++ |
| 28 | +[source,terminal] |
| 29 | +---- |
| 30 | +$ INITRD_IMG_PATH='./initrd.img' |
| 31 | +---- |
| 32 | ++ |
| 33 | +[source,terminal] |
| 34 | +---- |
| 35 | +$ CMDLINE_PATH='./generic.prm' |
| 36 | +---- |
| 37 | ++ |
| 38 | +[source,terminal] |
| 39 | +---- |
| 40 | +$ kernel_size=$(stat -c%s $KERNEL_IMG_PATH) |
| 41 | +---- |
| 42 | ++ |
| 43 | +[source,terminal] |
| 44 | +---- |
| 45 | +$ initrd_size=$(stat -c%s $INITRD_IMG_PATH) |
| 46 | +---- |
| 47 | + |
| 48 | +.. Round up the `kernel` size to the next Mebibytes (MiB) boundary by running the following command: |
| 49 | ++ |
| 50 | +[source,terminal] |
| 51 | +---- |
| 52 | +$ BYTE_PER_MIB=$(( 1024 * 1024 )) offset=$(( (kernel_size + BYTE_PER_MIB - 1) / BYTE_PER_MIB * BYTE_PER_MIB )) |
| 53 | +---- |
| 54 | + |
| 55 | +.. Create the kernel binary patch file that contains the `initrd` address and size by running the following commands: |
| 56 | ++ |
| 57 | +[source,terminal] |
| 58 | +---- |
| 59 | +$ INITRD_IMG_NAME=$(echo $INITRD_IMG_PATH | rev | cut -d '/' -f 1 | rev) |
| 60 | +---- |
| 61 | ++ |
| 62 | +[source,terminal] |
| 63 | +---- |
| 64 | +$ KERNEL_OFFSET=0x00000000 |
| 65 | +---- |
| 66 | ++ |
| 67 | +[source,terminal] |
| 68 | +---- |
| 69 | +$ KERNEL_CMDLINE_OFFSET=0x00010480 |
| 70 | +---- |
| 71 | ++ |
| 72 | +[source,terminal] |
| 73 | +---- |
| 74 | +$ INITRD_ADDR_SIZE_OFFSET=0x00010408 |
| 75 | +---- |
| 76 | ++ |
| 77 | +[source,terminal] |
| 78 | +---- |
| 79 | +$ OFFSET_HEX=(printf '0x%08x\n' offset) |
| 80 | +---- |
| 81 | + |
| 82 | +.. Convert the address and size to binary format by running the following command: |
| 83 | ++ |
| 84 | +[source,terminal] |
| 85 | +---- |
| 86 | +$ printf "$(printf '%016x\n' $initrd_size)" | xxd -r -p > temp_size.bin |
| 87 | +---- |
| 88 | + |
| 89 | +.. Merge the address and size binaries by running the following command: |
| 90 | ++ |
| 91 | +[source,terminal] |
| 92 | +---- |
| 93 | +$ cat temp_address.bin temp_size.bin > "$INITRD_IMG_NAME.addrsize" |
| 94 | +---- |
| 95 | + |
| 96 | +.. Clean up temporary files by running the following command: |
| 97 | ++ |
| 98 | +[source,terminal] |
| 99 | +---- |
| 100 | +$ rm -rf temp_address.bin temp_size.bin |
| 101 | +---- |
| 102 | + |
| 103 | +.. Create the `.ins` file by running the following command: |
| 104 | ++ |
| 105 | +[source,terminal] |
| 106 | +---- |
| 107 | +$ cat > generic.ins <<EOF |
| 108 | +$KERNEL_IMG_PATH $KERNEL_OFFSET |
| 109 | +$INITRD_IMG_PATH $OFFSET_HEX |
| 110 | +$INITRD_IMG_NAME.addrsize $INITRD_ADDR_SIZE_OFFSET |
| 111 | +$CMDLINE_PATH $KERNEL_CMDLINE_OFFSET |
| 112 | +EOF |
| 113 | +---- |
| 114 | ++ |
| 115 | +[NOTE] |
| 116 | +==== |
| 117 | +The file is based on the paths of the `kernel.img`, `initrd.img`, `initrd.img.addrsize`, and `cmdline` files and the memory locations where the data is to be copied. |
| 118 | +==== |
| 119 | + |
| 120 | +. Transfer the `initrd`, `kernel`, `generic.ins`, and `initrd.img.addrsize` parameter files to the file server. For more information, see link:https://www.ibm.com/docs/en/linux-on-systems?topic=bl-booting-linux-in-lpar-mode[Booting Linux in LPAR mode] (IBM documentation). |
| 121 | + |
| 122 | +. Start the machine. |
| 123 | + |
| 124 | +. Repeat the procedure for all other machines in the cluster. |
0 commit comments