Skip to content

Commit 84bfca1

Browse files
committed
[add] : latest initcpio
1 parent 05dd9f4 commit 84bfca1

15 files changed

Lines changed: 91 additions & 35 deletions

system/initcpio/hooks/archiso

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ _mnt_sfs() {
6363
local img_fullname="${img##*/}"
6464
local sfs_dev
6565

66-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
66+
# shellcheck disable=SC2154
67+
# defined via initcpio's parse_cmdline()
6768
if [ "${copytoram}" = "y" ]; then
6869
msg -n ":: Copying squashfs image to RAM..."
6970
if ! cp -- "${img}" "/run/archiso/copytoram/${img_fullname}" ; then
@@ -129,10 +130,12 @@ run_hook() {
129130
[ -z "${copytoram_size}" ] && copytoram_size="75%"
130131
[ -z "${archisobasedir}" ] && archisobasedir="arch"
131132
[ -z "${dm_snap_prefix}" ] && dm_snap_prefix="arch"
132-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
133+
# shellcheck disable=SC2154
134+
# defined via initcpio's parse_cmdline()
133135
[ -z "${archisodevice}" ] && archisodevice="/dev/disk/by-label/${archisolabel}"
134136
[ -z "${cow_spacesize}" ] && cow_spacesize="256M"
135-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
137+
# shellcheck disable=SC2154
138+
# defined via initcpio's parse_cmdline()
136139
if [ -n "${cow_label}" ]; then
137140
cow_device="/dev/disk/by-label/${cow_label}"
138141
[ -z "${cow_persistent}" ] && cow_persistent="P"
@@ -163,7 +166,8 @@ archiso_mount_handler() {
163166
fi
164167
fi
165168

166-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
169+
# shellcheck disable=SC2154
170+
# defined via initcpio's parse_cmdline()
167171
if [ "${checksum}" = "y" ]; then
168172
if [ -f "/run/archiso/bootmnt/${archisobasedir}/${arch}/airootfs.sha512" ]; then
169173
msg -n ":: Self-test requested, please wait..."
@@ -180,7 +184,8 @@ archiso_mount_handler() {
180184
fi
181185
fi
182186

183-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
187+
# shellcheck disable=SC2154
188+
# defined via initcpio's parse_cmdline()
184189
if [ "${verify}" = "y" ]; then
185190
if [ -f "/run/archiso/bootmnt/${archisobasedir}/${arch}/airootfs.sfs.sig" ]; then
186191
msg -n ":: Signature verification requested, please wait..."
@@ -226,4 +231,4 @@ archiso_mount_handler() {
226231
fi
227232
}
228233

229-
# vim: set ft=sh:
234+
# vim: set ft=sh:

system/initcpio/hooks/archiso_loop_mnt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/bin/ash
22

33
run_hook () {
4-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
4+
# shellcheck disable=SC2154
5+
# defined via initcpio's parse_cmdline()
56
[ -n "${img_label}" ] && img_dev="/dev/disk/by-label/${img_label}"
67
[ -z "${img_flags}" ] && img_flags="defaults"
7-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
8+
# shellcheck disable=SC2154
9+
# defined via initcpio's parse_cmdline()
810
if [ -n "${img_dev}" ] && [ -n "${img_loop}" ]; then
911
export mount_handler="archiso_loop_mount_handler"
1012
fi
@@ -17,7 +19,8 @@ archiso_loop_mount_handler () {
1719

1820
msg ":: Setup a loop device from ${img_loop} located at device ${img_dev}"
1921
_mnt_dev "${img_dev}" "/run/archiso/img_dev" "-r" "${img_flags}"
20-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
22+
# shellcheck disable=SC2154
23+
# defined via initcpio's parse_cmdline()
2124
if [ "${copytoram}" != "y" ]; then
2225
readlink -f "${img_dev}" >> /run/archiso/used_block_devices
2326
fi
@@ -37,4 +40,4 @@ archiso_loop_mount_handler () {
3740
fi
3841
}
3942

40-
# vim: set ft=sh:
43+
# vim: set ft=sh:

system/initcpio/hooks/archiso_pxe_common

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ run_hook () {
1111
if [ -n "${ip}" ]; then
1212
if [ -n "${BOOTIF}" ]; then
1313
bootif_mac="${BOOTIF#01-}"
14-
# shellcheck disable=SC2169 # ash supports bash-like string replacment
14+
# shellcheck disable=SC2169
15+
# ash supports bash-like string replacment
1516
bootif_mac="${bootif_mac//-/:}"
1617
for i in /sys/class/net/*/address; do
1718
read -r net_mac < "${i}"
@@ -36,7 +37,8 @@ run_hook () {
3637
launch_interactive_shell
3738
fi
3839

39-
# shellcheck disable=SC1090 # ipconfig generates these files
40+
# shellcheck disable=SC1090
41+
# ipconfig generates these files
4042
. /tmp/net-*.conf
4143

4244
export pxeserver="${ROOTSERVER}"
@@ -60,7 +62,8 @@ run_latehook () {
6062
if [ -n "${ip}" ]; then
6163
[ -z "${copy_resolvconf}" ] && copy_resolvconf="y"
6264

63-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
65+
# shellcheck disable=SC2154
66+
# defined via initcpio's parse_cmdline()
6467
if [ "${copytoram}" = "y" ]; then
6568
if [ -n "${bootif_dev}" ]; then
6669
ip addr flush dev "${bootif_dev}"
@@ -72,4 +75,4 @@ run_latehook () {
7275
fi
7376
}
7477

75-
# vim: set ft=sh:
78+
# vim: set ft=sh:

system/initcpio/hooks/archiso_pxe_http

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/ash
22

33
run_hook() {
4-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
4+
# shellcheck disable=SC2154
5+
# defined via initcpio's parse_cmdline()
56
if [ -n "${ip}" ] && [ -n "${archiso_http_srv}" ]; then
67

78
# booting with http is always copy-to-ram, so set here to make sure
@@ -24,7 +25,8 @@ _curl_get() {
2425
local _dst="${2}"
2526

2627
msg ":: Downloading '${_url}'"
27-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
28+
# shellcheck disable=SC2154
29+
# defined via initcpio's parse_cmdline()
2830
if ! curl -L -f -o "/run/archiso/httpspace/${archisobasedir}${_dst}/${_url##*/}" --create-dirs "${_url}"; then
2931
echo "ERROR: Downloading '${_url}'"
3032
echo " Falling back to interactive prompt"
@@ -40,14 +42,17 @@ archiso_pxe_http_mount_handler () {
4042
mkdir -p "/run/archiso/httpspace"
4143
mount -t tmpfs -o size="${archiso_http_spc}",mode=0755 httpspace "/run/archiso/httpspace"
4244

43-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
45+
# shellcheck disable=SC2154
46+
# defined via initcpio's parse_cmdline()
4447
_curl_get "${archiso_http_srv}${archisobasedir}/${arch}/airootfs.sfs" "/${arch}"
4548

46-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
49+
# shellcheck disable=SC2154
50+
# defined via initcpio's parse_cmdline()
4751
if [ "${checksum}" = "y" ]; then
4852
_curl_get "${archiso_http_srv}${archisobasedir}/${arch}/airootfs.sha512" "/${arch}"
4953
fi
50-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
54+
# shellcheck disable=SC2154
55+
# defined via initcpio's parse_cmdline()
5156
if [ "${verify}" = "y" ]; then
5257
_curl_get "${archiso_http_srv}${archisobasedir}/${arch}/airootfs.sfs.sig" "/${arch}"
5358
fi
@@ -58,4 +63,4 @@ archiso_pxe_http_mount_handler () {
5863
archiso_mount_handler "${newroot}"
5964
}
6065

61-
# vim: set ft=sh:
66+
# vim: set ft=sh:

system/initcpio/hooks/archiso_pxe_nbd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/ash
22

33
run_earlyhook() {
4-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
4+
# shellcheck disable=SC2154
5+
# defined via initcpio's parse_cmdline()
56
if [ -n "${ip}" ] && [ -n "${archiso_nbd_srv}" ]; then
67
# Module autoloading like with loop devices does not work, doing manually...
78
modprobe nbd 2> /dev/null
@@ -47,4 +48,4 @@ archiso_pxe_nbd_mount_handler () {
4748
fi
4849
}
4950

50-
# vim: set ft=sh:
51+
# vim: set ft=sh:

system/initcpio/hooks/archiso_pxe_nfs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/ash
22

33
run_hook() {
4-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
4+
# shellcheck disable=SC2154
5+
# defined via initcpio's parse_cmdline()
56
if [ -n "${ip}" ] && [ -n "${archiso_nfs_srv}" ]; then
67

78
archiso_nfs_srv=$(eval echo "${archiso_nfs_srv}")
@@ -15,7 +16,8 @@ archiso_nfs_mount_handler() {
1516
newroot="${1}"
1617
mkdir -p "/run/archiso/bootmnt"
1718
msg ":: Mounting '${archiso_nfs_srv}'"
18-
# shellcheck disable=SC2154 # defined via initcpio's parse_cmdline()
19+
# shellcheck disable=SC2154
20+
# defined via initcpio's parse_cmdline()
1921
if [ -n "${archiso_nfs_opt}" ]; then
2022
nfsmount -o "${archiso_nfs_opt}" "${archiso_nfs_srv}" "/run/archiso/bootmnt"
2123
mount_status=$?
@@ -37,4 +39,4 @@ archiso_nfs_mount_handler() {
3739
archiso_mount_handler "${newroot}"
3840
}
3941

40-
# vim: set ft=sh:
42+
# vim: set ft=sh:

system/initcpio/hooks/archiso_shutdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ run_cleanuphook() {
55
cp -ax / /run/initramfs
66
}
77

8-
# vim: set ft=sh:
8+
# vim: set ft=sh:

system/initcpio/install/archiso

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ build() {
2525
mkdir -p "$BUILDROOT/gpg"
2626
gpg --homedir "$BUILDROOT/gpg" --import <& "$ARCHISO_GNUPG_FD"
2727
fi
28-
}
28+
}

system/initcpio/install/archiso_loop_mnt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ help() {
88
cat<<HELPEOF
99
This hook loads the necessary modules for boot via loop device.
1010
HELPEOF
11-
}
11+
}

system/initcpio/install/archiso_pxe_common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ help() {
2121
cat<<HELPEOF
2222
This hook loads the necessary modules for boot via PXE.
2323
HELPEOF
24-
}
24+
}

0 commit comments

Comments
 (0)