summaryrefslogtreecommitdiff
path: root/README
blob: 16c318f375836495536a385caf0065b655dbdf06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
INDEX
-----

* Boot parameters (initramfs stage)
  * hooks/archiso
  * hooks/archiso_pxe_nbd
  * hooks/archiso_loop_mnt
* Boot parameters (only for configs/releng)
  * etc/rc.conf
* Build requirements
* Image types generated by mkarchiso.
* File format for aitab.
* Why the /isolinux and /arch/boot/syslinux directories?
* Building the most basic Arch Linux live media. (configs/baseline)
* Building official Arch Linux live media. (configs/releng)



*** Boot parameters (initramfs stage)

** hooks/archiso

* archisolabel=     Set the filesystem label where archiso files reside.
                    Default: (unset)
* archisodevice=    Set the device node where archiso medium is located.
                    Default: "/dev/disk/by-label/${archisolabel}"
* archisobasedir=   Set the base directory where all files reside.
                    Default: "arch"
* aitab=            Set the path for "aitab" file.
                    Default: ${archisobasedir}/aitab
* copytoram=        If set to "y" or just "copytoram" without arguments,
                    all SquashFS are copied to "RAM".
                    Default: (unset)
* checksum=         If set to "y" or just "checksum" without arguments,
                    performs a self-test of all files inside ${install_dir},
                    and continue booting if ok.
                    Default: (unset)
* cow_label=        Set the filesystem label where COW (dm-snapshot)
                    files must be stored.
                    Default: (unset)
* cow_device=       Set the device node where COW (dm-snapshot) files
                    must be stored.
                    Default: (unset) or "/dev/disk/by-label/${cow_label}"
* cow_directory=    Set a directory inside ${cow_device}.
                    Default: "/persistent_${archisolabel}/${arch}"
* cow_persistent=   Set if snapshots are persistent "P" or non-persistent "N".
                    Default: "N" (if no ${cow_device} is used) otherwise "P".
* cowspace_size=    Set the size of tmpfs /cowspace. This space is used for
                    Copy-On-Write files of dm-snapshot.
                    Size is in bytes (suffix with "k", "m" and "g") or
                    in percentage of available RAM.
                    Default: "75%"
* copytoram_size=   Set the size of tmpfs. This space is used for
                    copy of all SquashFS images used, if copytoram=y.
                    Size is in bytes (suffix with "k", "m" and "g") or
                    in percentage of available RAM.
                    Default: "75%"
* dm_snap_prefix=   Set a prefix for device-mapper snapshot node names.
                    Default: "arch"
* arch=             Force an architecture type (i686 | x86_64).
                    Do not set it for normal operations.
                    Useful for running a 64 bit kernel / 32 bit userspace.
                    Default: (architecture of running kernel)


** hooks/archiso_pxe_nbd

* ip=               This parameter is setup automatically by PXELINUX
                    when option "IPAPPEND" is set to 1 or 2 in config.
                    ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask>
                    Default: (set via PXE server)
* BOOTIF=           This parameter is setup automatically by PXELINUX
                    when option "IPAPPEND" is set to 2 or 3 in config.
                    BOOTIF=<hardware-address-of-boot-interface>
                    Default: (set via PXELINUX)
* archiso_nbd_name= Set NBD export name used by the server.
                    Default: archiso


** hooks/archiso_loop_mnt

* img_dev=          Device where archiso-image.iso reside.
                    Default: (unset)
* img_loop=         Full path where archiso-image.iso is located on ${img_dev}
                    Default: (unset)



*** Boot parameters (only for configs/releng)

** /etc/rc.conf

By default these parameters are set by default to these values
if nothing is specified on command line.

* locale=             "en_US.UTF-8"
* daemon_locale=      "no"
* hardwareclock=      "UTC"
* timezone=           "Canada/Pacific"
* keymap=             "us"
* consolefont=        (unset)
* consolemap=         (unset)
* usecolor=           "yes"



*** Build requirements

** For mkarchiso script needs these packages (build host):
 + devtools                for mkarchroot
 + squashfs-tools          for mksquashfs
 + libisoburn              for xorriso

** For these hooks needs these packages (on target root-image)
* archiso
 + (none)
* archiso_loop_mnt
 + (none)
* archiso_pxe_nbd
 + mkinitcpio-nfs-utils    for ipconfig
 + nbd                     for nbd-client



*** Image types generated by mkarchiso.

* image-name.sfs     SquashFS image with all files directly on it.
* image-name.fs.sfs  SquashFS with only one file inside (image-name.fs),
                     which is an image of some type of filesystem
                     (ext4, ext3, ext2, xfs), all files reside on it.
* image-name.fs      Like image-name.fs.sfs but without SquashFS.
                     (For testing purposes only. The option copytoram
                     for archiso hook does not have any effect on these images)



*** File format for aitab.

The aitab file holds information about the filesystems images that must be
created by mkarchiso and mounted at initramfs stage from the archiso hook.
It consists of some fields which define the behaviour of images.

# <img>         <mnt>                 <arch>   <sfs_comp>  <fs_type>  <fs_size>

<img>      Image name without extension (.fs .fs.sfs .sfs).
<mnt>      Mount point.
<arch>     Architecture { i686 | x86_64 | any }.
<sfs_comp> SquashFS compression type { gzip | lzo | xz }.
           A special value of "none" denotes no usage of SquashFS.
<fs_type>  Set the filesystem type of the image { ext4 | ext3 | ext2 | xfs }.
           A special value of "none" denotes no usage of a filesystem.
           In that case all files are pushed directly to SquashFS filesystem.
<fs_size>  An absolute value of file system image size in MiB.
           (example: 100, 1000, 4096, etc)
           A relative value of file system free space [in percent].
           {1%..99%} (example 50%, 10%, 7%).
           This is an estimation, and calculated in a simple way.
           Space used + 10% (estimated for metadata overhead) + desired %

Note: Some combinations are invalid, example: sfs_comp=none and fs_type=none



*** Why the /isolinux and /arch/boot/syslinux directories?

The /isolinux directory holds files needed for the ISOLINUX boot loader
module of SYSLINUX. ISOLINUX can not find config files on
/arch/boot/syslinux, like other boot loaders modules (EXTLINUX, SYSLINUX, etc).
When make your custom boot-pendrive, you need to copy /arch directory to it.
/isolinux/isolinux.cfg just holds /arch/boot/syslinux/syslinux.cfg



*** Building the most basic Arch Linux live media. (configs/baseline)

* Install devtools if needed, mkarchroot needs it
  [host] # pacman -S devtools --needed

* Create a base chroot to work on it.
  (prefix with linux32 if you want to build a 32 bits enviroment under 64 bits)
  [host] # mkarchroot /tmp/chroot base

* Install archiso on chroot (needs git and make)
  [host] # pacman -S git make --needed
  [host] # git clone git://projects.archlinux.org/archiso.git
  [host] # make -C archiso/archiso DESTDIR=/tmp/chroot install

* Enter to chroot (prefix with linux32 if needed).
  [host] # mkarchroot -r bash /tmp/chroot

* Create a loopback device.
  (mkarchroot does not create it, use other number if not available)
  [chroot] # mknod /dev/loop0 b 7 0

* Setup a mirror.
  [chroot] # echo 'Server = MIRROR/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist

* Install aditional packages needed for mkarchiso.
  [chroot] # pacman -S devtools squashfs-tools libisoburn

* Build a basic iso.
  [chroot] # cp -r /usr/share/archiso/configs/baseline /tmp
  [chroot] # cd /tmp/baseline
  [chroot] # ./build.sh

* Exit from chroot.
  [chroot] # exit

Note: If you want to customize, just see the configs/releng directory which is
used to build official images with much more things.



*** Building official Arch Linux live media. (configs/releng)

Note: These steps should be done with 64 bits support.

* Prepare a 32 bit chroot enviroment.

  [host64] # linux32 mkarchroot /tmp/chroot32 base
  [host64] # linux32 mkarchroot -r bash /tmp/chroot32
  [chroot32] # echo 'Server = MIRROR/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist
  [chroot32] # pacman -S devtools squashfs-tools libisoburn
  [chroot32] # exit

* Prepare a 64 bits chroot enviroment.

  [host64] # mkarchroot /tmp/chroot64 base
  [host64] # mkarchroot -r bash /tmp/chroot64
  [chroot64] # echo 'Server = MIRROR/archlinux/$repo/os/$arch' >> /etc/pacman.d/mirrorlist
  [chroot64] # pacman -S devtools squashfs-tools libisoburn
  [chroot64] # exit

* Install archiso on both chroots.

  [host64] # git clone git://projects.archlinux.org/archiso.git
  [host64] # make -C archiso/archiso DESTDIR=/tmp/chroot32 install
  [host64] # make -C archiso/archiso DESTDIR=/tmp/chroot64 install

* Create a shared /tmp directory between two chroots for working.

  [host64] # mkdir /tmp/shared
  [host64] # chmod 1777 /tmp/shared
  [host64] # mount --bind /tmp/shared /tmp/chroot32/tmp
  [host64] # mount --bind /tmp/shared /tmp/chroot64/tmp

* Enter 32 bits chroot enviroment then build core and netinstall single images.

  [chroot32] # linux32 mkarchroot -r bash /tmp/chroot32
  [chroot32] # mknod /dev/loop1032 b 7 1032  # assumed loop.max_part=0 (by default)
  [chroot32] # cp -r /usr/share/archiso/configs/releng /tmp
  [chroot32] # cd /tmp/releng
  [chroot32] # ./build.sh build single all
  [chroot32] # ./build.sh purge single       # optional step

* Enter 64 bits chroot enviroment then build core and netinstall single images.

  [chroot64] # mkarchroot -r bash /tmp/chroot64
  [chroot64] # mknod /dev/loop1064 b 7 1064  # assumed loop.max_part=0 (by default)
  [chroot64] # cp -r /usr/share/archiso/configs/releng /tmp
  [chroot64] # cd /tmp/releng
  [chroot64] # ./build.sh build single all
  [chroot64] # ./build.sh purge single       # optional step

* Build core and netinstall dual images from any of the chroot enviroments.

  [host64] # mkarchroot -r bash /tmp/chroot64
  [chroot64] # cd /tmp/releng
  [chroot64] # ./build.sh build dual all
  [chroot64] # ./build.sh purge dual         # optional step