[arch-releng] [PATCH 1/3] Make cmdline_param work and conform to rc.d layout
From: Simo Leone <leone.simo@gmail.com> - Rename cmdline_param to kernel_cmdline - Move to /etc/rc.d/functions.d where it belongs --- configs/syslinux-iso/overlay/etc/archiso/functions | 12 ------------ configs/syslinux-iso/overlay/etc/rc.d/archiso | 1 - .../overlay/etc/rc.d/functions.d/archiso | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+), 13 deletions(-) delete mode 100644 configs/syslinux-iso/overlay/etc/archiso/functions create mode 100644 configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso diff --git a/configs/syslinux-iso/overlay/etc/archiso/functions b/configs/syslinux-iso/overlay/etc/archiso/functions deleted file mode 100644 index fdd48f4..0000000 --- a/configs/syslinux-iso/overlay/etc/archiso/functions +++ /dev/null @@ -1,12 +0,0 @@ -# vim: set ft=sh: - -cmdline_param () -{ - for param in ${CMDLINE}; do - case "${param}" in - $1=*) echo "${param##*=}"; return ;; - *) continue ;; - esac - done - [ -n "${2}" ] && echo "${2}" -} diff --git a/configs/syslinux-iso/overlay/etc/rc.d/archiso b/configs/syslinux-iso/overlay/etc/rc.d/archiso index 435152a..6f26f98 100755 --- a/configs/syslinux-iso/overlay/etc/rc.d/archiso +++ b/configs/syslinux-iso/overlay/etc/rc.d/archiso @@ -1,7 +1,6 @@ # vim: set ft=sh: . /etc/rc.conf . /etc/rc.d/functions -. /etc/archiso/functions scan_network () diff --git a/configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso b/configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso new file mode 100644 index 0000000..02b41cf --- /dev/null +++ b/configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso @@ -0,0 +1,20 @@ +# vim: set ft=sh: + +# kernel_cmdline <param> +# Looks for a parameter on the kernel's boot-time command line. +# +# returns: 0 if param was found. Also prints its value if it was a K=V param. +# 1 if it was not +# +kernel_cmdline () +{ + for param in $(/bin/cat /proc/cmdline); do + case "${param}" in + $1=*) echo "${param##*=}"; return 0 ;; + $1) return 0 ;; + *) continue ;; + esac + done + + return 1 +} -- 1.7.4.1
From: Simo Leone <leone.simo@gmail.com> --- archiso/hooks/archiso_pxe_nbd | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/archiso/hooks/archiso_pxe_nbd b/archiso/hooks/archiso_pxe_nbd index b36b05d..f18fd4c 100644 --- a/archiso/hooks/archiso_pxe_nbd +++ b/archiso/hooks/archiso_pxe_nbd @@ -84,7 +84,7 @@ archiso_pxe_nbd_mount_handler () { archiso_mount_handler ${newroot} if [ "${copytoram}" = "y" ]; then - msg "::: Disconnect NBD from ${nbdserver}:9040 at /dev/nbd0" + msg "::: Disconnect NBD from ${nbdserver} at /dev/nbd0" nbd-client -d /dev/nbd0 fi } -- 1.7.4.1
From: Simo Leone <leone.simo@gmail.com> --- configs/syslinux-iso/overlay/etc/archiso/getshell | 9 --- configs/syslinux-iso/overlay/etc/rc.d/archiso | 59 --------------------- 2 files changed, 0 insertions(+), 68 deletions(-) delete mode 100644 configs/syslinux-iso/overlay/etc/archiso/getshell diff --git a/configs/syslinux-iso/overlay/etc/archiso/getshell b/configs/syslinux-iso/overlay/etc/archiso/getshell deleted file mode 100644 index a6f8775..0000000 --- a/configs/syslinux-iso/overlay/etc/archiso/getshell +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -. /etc/archiso/functions - -shell="$(cmdline_param shell)" -[ -n "${shell}" ] && shell="/bin/bash" -[ ! -e "${shell}" ] && shell="/bin/sh" - -exec ${shell} diff --git a/configs/syslinux-iso/overlay/etc/rc.d/archiso b/configs/syslinux-iso/overlay/etc/rc.d/archiso index 6f26f98..e1b5997 100755 --- a/configs/syslinux-iso/overlay/etc/rc.d/archiso +++ b/configs/syslinux-iso/overlay/etc/rc.d/archiso @@ -2,65 +2,6 @@ . /etc/rc.conf . /etc/rc.d/functions - -scan_network () -{ - netparam () { echo ${2} | sed "s|.*${1}\([^ ]*\).*|\1|gi"; } - # - netdevs=$(cat /proc/net/dev | grep ':' | cut -d':' -f1) - for net in ${netdev}; do - stats=$(ifconfig ${net} | tr -s "\n" " ") - done -} - -scan_mount_pts () -{ - #iterate over all block devices - stat_busy "Scanning local block devices" - for dev in $(echo /sys/block/*/dev /sys/block/*/*/dev); do - - devname="/dev/$(echo ${dev} | cut -d'/' -f3,4 | cut -d'/' -f1)" - mountpt="/mnt/$(basename '${devname}')" - mkdir -p "${mountpt}" 2>/dev/null - mount ${options} "${devname}" "${mountpt}" >/dev/null 2>&1 - - fstype=$(awk '{ if ($1=="${devname}") { print $3" "$4;q }}' /proc/mounts) - fstype="${fstype%%,*}" - case "${fstype%% *}" in - *fat*|ntfs|*dos) options="user,exec,uid=0,gid=100,umask=00070" ;; - *) options="users,defaults,exec" ;; - #TODO handle 'sync' on usb devices... - esac - - echo "${devname} ${mountpt} ${fstype} ${options} 0 0 #configured by archiso" >>/etc/fstab - done - stat_done -} - -scan_swap () -{ - #Archie finds a pagefile.sys for windows/dos machines... may add later - stat_busy "Finding existing swap partitions" - swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)" - if [ -e "${swapdev}" ]; then - swapon ${swapdev} - echo "${swapdev} swap swap defaults 0 0 #configured by archiso" >>/etc/fstab - fi - stat_done -} - -do_homedir () -{ - stat_busy "Scanning for existing HOME directory" - user="$(cmdline_param homeuser)" - for hdir in $(find /mnt -name "home/${user}" 2>/dev/null); do - mkdir -p "/home/arch/" - # break after the first success... - mount --bind "${hdir}" "/home/arch/" && break - done - stat_done -} - do_makeuser () { stat_busy "Making the default user arch" -- 1.7.4.1
Simo, welcome back! I'll be expecting AIF patches now ;) Dieter
From: Simo Leone <leone.simo@gmail.com> --- configs/syslinux-iso/overlay/etc/rc.conf | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configs/syslinux-iso/overlay/etc/rc.conf b/configs/syslinux-iso/overlay/etc/rc.conf index ff18456..3ce3c5a 100644 --- a/configs/syslinux-iso/overlay/etc/rc.conf +++ b/configs/syslinux-iso/overlay/etc/rc.conf @@ -1,19 +1,19 @@ # # /etc/rc.conf - Main Configuration for Arch Linux -. /etc/archiso/functions +. /etc/rc.d/functions LOCALE_DEFAULT="en_US.UTF-8" CLOCK_DEFAULT="" TIMEZONE_DEFAULT="" KEYMAP_DEFAULT="us" -LOCALE="$(cmdline_param locale ${LOCALE_DEFAULT})" -HARDWARECLOCK="$(cmdline_param clock ${CLOCK_DEFAULT})" -TIMEZONE="$(cmdline_param timezone ${TIMEZONE_DEFAULT})" -KEYMAP="$(cmdline_param keymap ${KEYMAP_DEFAULT})" -CONSOLEFONT="$(cmdline_param consolefont)" -CONSOLEMAP="$(cmdline_param consolemap)" +LOCALE="$(kernel_cmdline locale ${LOCALE_DEFAULT})" +HARDWARECLOCK="$(kernel_cmdline clock ${CLOCK_DEFAULT})" +TIMEZONE="$(kernel_cmdline timezone ${TIMEZONE_DEFAULT})" +KEYMAP="$(kernel_cmdline keymap ${KEYMAP_DEFAULT})" +CONSOLEFONT="$(kernel_cmdline consolefont)" +CONSOLEMAP="$(kernel_cmdline consolemap)" USECOLOR="yes" MOD_AUTOLOAD="yes" -- 1.7.4.1
From: Simo Leone<leone.simo@gmail.com>
--- configs/syslinux-iso/overlay/etc/rc.conf | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/configs/syslinux-iso/overlay/etc/rc.conf b/configs/syslinux-iso/overlay/etc/rc.conf index ff18456..3ce3c5a 100644 --- a/configs/syslinux-iso/overlay/etc/rc.conf +++ b/configs/syslinux-iso/overlay/etc/rc.conf @@ -1,19 +1,19 @@ # # /etc/rc.conf - Main Configuration for Arch Linux
-. /etc/archiso/functions +. /etc/rc.d/functions
LOCALE_DEFAULT="en_US.UTF-8" CLOCK_DEFAULT="" TIMEZONE_DEFAULT="" KEYMAP_DEFAULT="us"
-LOCALE="$(cmdline_param locale ${LOCALE_DEFAULT})" -HARDWARECLOCK="$(cmdline_param clock ${CLOCK_DEFAULT})" -TIMEZONE="$(cmdline_param timezone ${TIMEZONE_DEFAULT})" -KEYMAP="$(cmdline_param keymap ${KEYMAP_DEFAULT})" -CONSOLEFONT="$(cmdline_param consolefont)" -CONSOLEMAP="$(cmdline_param consolemap)" +LOCALE="$(kernel_cmdline locale ${LOCALE_DEFAULT})" +HARDWARECLOCK="$(kernel_cmdline clock ${CLOCK_DEFAULT})" +TIMEZONE="$(kernel_cmdline timezone ${TIMEZONE_DEFAULT})" +KEYMAP="$(kernel_cmdline keymap ${KEYMAP_DEFAULT})" +CONSOLEFONT="$(kernel_cmdline consolefont)" +CONSOLEMAP="$(kernel_cmdline consolemap)" USECOLOR="yes"
MOD_AUTOLOAD="yes"
On 03/03/2011 07:44 AM, leone.simo@gmail.com wrote: pushed to master -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
From: Simo Leone<leone.simo@gmail.com>
- Rename cmdline_param to kernel_cmdline - Move to /etc/rc.d/functions.d where it belongs --- configs/syslinux-iso/overlay/etc/archiso/functions | 12 ------------ configs/syslinux-iso/overlay/etc/rc.d/archiso | 1 - .../overlay/etc/rc.d/functions.d/archiso | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+), 13 deletions(-) delete mode 100644 configs/syslinux-iso/overlay/etc/archiso/functions create mode 100644 configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso
diff --git a/configs/syslinux-iso/overlay/etc/archiso/functions b/configs/syslinux-iso/overlay/etc/archiso/functions deleted file mode 100644 index fdd48f4..0000000 --- a/configs/syslinux-iso/overlay/etc/archiso/functions +++ /dev/null @@ -1,12 +0,0 @@ -# vim: set ft=sh: - -cmdline_param () -{ - for param in ${CMDLINE}; do - case "${param}" in - $1=*) echo "${param##*=}"; return ;; - *) continue ;; - esac - done - [ -n "${2}" ]&& echo "${2}" -} diff --git a/configs/syslinux-iso/overlay/etc/rc.d/archiso b/configs/syslinux-iso/overlay/etc/rc.d/archiso index 435152a..6f26f98 100755 --- a/configs/syslinux-iso/overlay/etc/rc.d/archiso +++ b/configs/syslinux-iso/overlay/etc/rc.d/archiso @@ -1,7 +1,6 @@ # vim: set ft=sh: . /etc/rc.conf . /etc/rc.d/functions -. /etc/archiso/functions
scan_network () diff --git a/configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso b/configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso new file mode 100644 index 0000000..02b41cf --- /dev/null +++ b/configs/syslinux-iso/overlay/etc/rc.d/functions.d/archiso @@ -0,0 +1,20 @@ +# vim: set ft=sh: + +# kernel_cmdline<param> +# Looks for a parameter on the kernel's boot-time command line. +# +# returns: 0 if param was found. Also prints its value if it was a K=V param. +# 1 if it was not +# +kernel_cmdline () +{ + for param in $(/bin/cat /proc/cmdline); do + case "${param}" in + $1=*) echo "${param##*=}"; return 0 ;; + $1) return 0 ;; + *) continue ;; + esac + done + + return 1 +}
On 03/02/2011 09:43 AM, leone.simo@gmail.com wrote: pushed all three patches to master. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (3)
-
Dieter Plaetinck
-
Gerardo Exequiel Pozzi
-
leone.simo@gmail.com