From f73bc3835679622088d9d7d2ae179964266c4d7a Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Fri, 4 May 2012 06:58:35 -0300 Subject: adding a new parabola-archiso for test --- .../etc/rc.d/functions.d/automated_script | 23 ++++++++++++++++++++ .../etc/rc.d/functions.d/prepare_locale_gen | 11 ++++++++++ .../etc/rc.d/functions.d/setup_special_console | 25 ++++++++++++++++++++++ .../rc.d/functions.d/symlink_used_block_devices | 7 ++++++ 4 files changed, 66 insertions(+) create mode 100644 parabola-archiso-TEST/root-image/etc/rc.d/functions.d/automated_script create mode 100644 parabola-archiso-TEST/root-image/etc/rc.d/functions.d/prepare_locale_gen create mode 100644 parabola-archiso-TEST/root-image/etc/rc.d/functions.d/setup_special_console create mode 100644 parabola-archiso-TEST/root-image/etc/rc.d/functions.d/symlink_used_block_devices (limited to 'parabola-archiso-TEST/root-image/etc/rc.d') diff --git a/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/automated_script b/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/automated_script new file mode 100644 index 0000000..b89ad9e --- /dev/null +++ b/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/automated_script @@ -0,0 +1,23 @@ +automated_script () +{ + script="$(kernel_cmdline script)" + if [[ -n "${script}" ]]; then + stat_busy "Configuring $script" + if [[ "${script}" =~ ^http:// || "${script}" =~ ^ftp:// ]]; then + wget "${script}" -q -O /tmp/startup_script >/dev/null + rt=$? + else + cp "${script}" /tmp/startup_script + rt=$? + fi + if [ ${rt} -eq 0 ]; then + chmod +x /tmp/startup_script + echo -e '\nif [ $(tty) = "/dev/tty1" ]; then\n /tmp/startup_script\nfi\n' >> /root/.bash_profile + stat_done + else + stat_fail + fi + fi +} + +add_hook multi_end automated_script diff --git a/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/prepare_locale_gen b/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/prepare_locale_gen new file mode 100644 index 0000000..47ed79d --- /dev/null +++ b/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/prepare_locale_gen @@ -0,0 +1,11 @@ +prepare_locale_gen () +{ + if [[ ${LOCALE} != "en_US.UTF-8" ]]; then + stat_busy "Generating locales..." + sed -i "s/#\(${LOCALE/[@.]*}\)/\1/" /etc/locale.gen + /usr/sbin/locale-gen > /dev/null + stat_done + fi +} + +add_hook sysinit_postmount prepare_locale_gen diff --git a/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/setup_special_console b/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/setup_special_console new file mode 100644 index 0000000..7badfe3 --- /dev/null +++ b/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/setup_special_console @@ -0,0 +1,25 @@ +# If an alternate console was specified on the kernel command line, +# start agetty on it too. +setup_special_console() +{ + local cmdline_console + if cmdline_console=$(kernel_cmdline console); then + stat_busy "Starting agetty on console: ${cmdline_console}" + local port options baud rts + port=${cmdline_console%%,*} + options=${cmdline_console#${port}} + options=${options#,} + baud=${options%%[neo]*} + [[ ${options} == *r ]] && rts="-h" + if ! grep -q "^${port}" /etc/securetty; then + echo ${port} >> /etc/securetty + fi + if ! grep -q "^z0:" /etc/inittab; then + echo "z0:2345:respawn:/sbin/agetty -8 -s ${rts} ${baud:-9600} ${port} linux" >> /etc/inittab + fi + /sbin/telinit q + stat_done + fi +} + +add_hook sysinit_end setup_special_console diff --git a/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/symlink_used_block_devices b/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/symlink_used_block_devices new file mode 100644 index 0000000..f6b6062 --- /dev/null +++ b/parabola-archiso-TEST/root-image/etc/rc.d/functions.d/symlink_used_block_devices @@ -0,0 +1,7 @@ +symlink_used_block_devices() +{ + mkdir /run/aif + ln -s /run/archiso/used_block_devices /run/aif/ignore_block_devices +} + +add_hook multi_end symlink_used_block_devices -- cgit v1.2.3-54-g00ecf