[archiso] Misc style cleanups

* Add #!/bin/bash to install hooks and fixed vimlines.
* Removed empty variables.
* Reorder variables, adjust brace/parens in functions.
* Removed things implemented in base hook (/tmp, /etc/fstab).

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
This commit is contained in:
Gerardo Exequiel Pozzi 2012-02-03 11:13:37 -03:00
parent c593c2bd24
commit 27940c420f
8 changed files with 41 additions and 53 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/ash
# /oldroot depends on things inside /oldroot/run/archiso...
mkdir /oldrun

View File

@ -1,9 +1,8 @@
build ()
{
MODULES="cdrom loop dm-snapshot"
#!/bin/bash
BINARIES=""
FILES=""
build() {
MODULES="cdrom loop dm-snapshot"
SCRIPT="archiso"
add_binary /lib/udev/cdrom_id
add_binary blockdev
@ -15,11 +14,6 @@ build ()
add_file /lib/udev/rules.d/10-dm.rules
add_file /lib/udev/rules.d/95-dm-notify.rules
add_file /lib/initcpio/udev/11-dm-initramfs.rules /lib/udev/rules.d/11-dm-initramfs.rules
# Add an empty fstab to avoid mount warning when -o remount is used (this should go to install/base)
: > "$BUILDROOT/etc/fstab"
SCRIPT="archiso"
}
# vim:ft=sh:ts=4:sw=4:et:
# vim: set ft=sh ts=4 sw=4 et:

View File

@ -1,18 +1,13 @@
# vim: set ft=sh:
build ()
{
MODULES=""
BINARIES=""
FILES=""
#!/bin/bash
build() {
SCRIPT="archiso_loop_mnt"
}
help ()
{
help() {
cat<<HELPEOF
This hook loads the necessary modules for boot via loop device.
HELPEOF
}
# vim: set ft=sh ts=4 sw=4 et:

View File

@ -1,33 +1,30 @@
# vim: set ft=sh:
#!/bin/bash
build ()
{
build() {
MODULES="${MODULES} $(comm -2 -3 <(checked_modules "/drivers/net/" | sort) \
<(find $MODULEDIR/kernel/drivers/net/{irda,phy,wimax,wireless} \
-name '*.ko*' \
-exec bash -c 'printf "%s\n" "${@%%.ko*}" | sed "s@.*/@@;s@-@_@" | sort' _ {} +) \
| grep -v -e 'ppp_' -e 'plip' -e 'pppoe')"
BINARIES=""
FILES=""
SCRIPT="archiso_pxe_common"
# Add here for now, but this should go to "install/base".
add_dir /tmp
add_dir /etc
add_binary "/lib/initcpio/ipconfig" "/bin/ipconfig"
add_binary /lib/initcpio/ipconfig /bin/ipconfig
# Add hosts support files+dns
add_symlink /lib/libnss_files.so.2 $(readlink /lib/libnss_files.so.2)
add_binary $(readlink -f /lib/libnss_files.so.2)
add_symlink /lib/libnss_dns.so.2 $(readlink /lib/libnss_dns.so.2)
add_binary $(readlink -f /lib/libnss_dns.so.2)
add_dir /etc
echo "hosts: files dns" > $BUILDROOT/etc/nsswitch.conf
}
help ()
{
help() {
cat<<HELPEOF
This hook loads the necessary modules for boot via PXE.
HELPEOF
}
# vim: set ft=sh ts=4 sw=4 et:

View File

@ -1,18 +1,15 @@
# vim: set ft=sh:
#!/bin/bash
build ()
{
MODULES=""
BINARIES=""
FILES=""
build() {
SCRIPT="archiso_pxe_http"
add_binary curl
}
help ()
{
help() {
cat<<HELPEOF
This hook loads the necessary modules for boot via PXE and HTTP.
HELPEOF
}
# vim: set ft=sh ts=4 sw=4 et:

View File

@ -1,20 +1,18 @@
# vim: set ft=sh:
#!/bin/bash
build ()
{
build() {
MODULES="nbd"
BINARIES=""
FILES=""
SCRIPT="archiso_pxe_nbd"
add_binary nbd-client
add_file "/lib/initcpio/archiso_pxe_nbd" "/archiso_pxe_nbd"
add_file /lib/initcpio/archiso_pxe_nbd /archiso_pxe_nbd
}
help ()
{
help() {
cat<<HELPEOF
This hook loads the necessary modules for boot via PXE and NBD.
HELPEOF
}
# vim: set ft=sh ts=4 sw=4 et:

View File

@ -1,10 +1,10 @@
# vim: set ft=sh:
#!/bin/bash
build() {
MODULES="nfs"
SCRIPT="archiso_pxe_nfs"
add_binary "/lib/initcpio/nfsmount" "/bin/nfsmount"
add_binary /lib/initcpio/nfsmount /bin/nfsmount
}
help() {
@ -12,3 +12,5 @@ help() {
This hook loads the necessary modules for boot via PXE and NFS.
HELPEOF
}
# vim: set ft=sh ts=4 sw=4 et:

View File

@ -1,6 +1,9 @@
#!/bin/bash
build() {
SCRIPT="archiso_shutdown"
add_binary /lib/initcpio/archiso_shutdown /shutdown
add_file /lib/initcpio/archiso_shutdown /shutdown
}
help() {
@ -11,3 +14,5 @@ and others mount points, dm-snapshot devices and loopback devices.
Mostly usefull for dm-snapshot persistent.
HELPEOF
}
# vim: set ft=sh ts=4 sw=4 et: