[arch-releng] [RFC] Move to systemd by default
The only issue is on shutdown, because systemd will try to unmount all fs, detach loop devs, and detach device-mapper devices, in a loop of 50 times, so lots of messages will see on console. But does not cause any harm, shutdown initramfs is reached and proper shutdown is done. (mostly important when persisten is used)
Signed-off-by: Gerardo Exequiel Pozzi
Also makes a custom autologin unit.
Signed-off-by: Gerardo Exequiel Pozzi
Signed-off-by: Gerardo Exequiel Pozzi
Signed-off-by: Gerardo Exequiel Pozzi
Signed-off-by: Gerardo Exequiel Pozzi
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
Also makes a custom autologin unit.
Signed-off-by: Gerardo Exequiel Pozzi
--- configs/releng/build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configs/releng/build.sh b/configs/releng/build.sh index 7aad14e..502f842 100755 --- a/configs/releng/build.sh +++ b/configs/releng/build.sh @@ -150,6 +150,9 @@ make_customize_root_image() { sed -i "s/#Server/Server/g" ${work_dir}/root-image/etc/pacman.d/mirrorlist patch ${work_dir}/root-image/usr/bin/pacman-key < ${script_path}/pacman-key-4.0.3_unattended-keyring-init.patch sed -i 's/#\(en_US\.UTF-8\)/\1/' ${work_dir}/root-image/etc/locale.gen + sed 's#\(^ExecStart=-/sbin/agetty\)#\1 --autologin root#; + s#\(^Restart=\).\+$#\1no#' \ + ${work_dir}/root-image/usr/lib/systemd/system/getty@.service > ${work_dir}/root-image/etc/systemd/system/autologin@.service mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ -r 'locale-gen' \ run
This should go to /etc directly.
@@ -159,6 +162,9 @@ make_customize_root_image() { mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ -r 'useradd -m -p "" -g users -G "audio,disk,optical,wheel" -s /bin/zsh arch' \ run + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ + -r 'systemctl -f enable multi-user.target haveged.service pacman-init.service autologin@.service dhcpcd@eth0.service ntpd.service || true' \ + run : > ${work_dir}/build.${FUNCNAME} fi }
Do you actually want to autologin on all TTYs? Won't there be a conflict between autologin and getty?
On 09/12/2012 04:24 AM, Thomas Bächler wrote:
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
Also makes a custom autologin unit.
Signed-off-by: Gerardo Exequiel Pozzi
--- configs/releng/build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configs/releng/build.sh b/configs/releng/build.sh index 7aad14e..502f842 100755 --- a/configs/releng/build.sh +++ b/configs/releng/build.sh @@ -150,6 +150,9 @@ make_customize_root_image() { sed -i "s/#Server/Server/g" ${work_dir}/root-image/etc/pacman.d/mirrorlist patch ${work_dir}/root-image/usr/bin/pacman-key < ${script_path}/pacman-key-4.0.3_unattended-keyring-init.patch sed -i 's/#\(en_US\.UTF-8\)/\1/' ${work_dir}/root-image/etc/locale.gen + sed 's#\(^ExecStart=-/sbin/agetty\)#\1 --autologin root#; + s#\(^Restart=\).\+$#\1no#' \ + ${work_dir}/root-image/usr/lib/systemd/system/getty@.service > ${work_dir}/root-image/etc/systemd/system/autologin@.service mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ -r 'locale-gen' \ run This should go to /etc directly. Nope, I want to maintain few files as posible. @@ -159,6 +162,9 @@ make_customize_root_image() { mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ -r 'useradd -m -p "" -g users -G "audio,disk,optical,wheel" -s /bin/zsh arch' \ run + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ + -r 'systemctl -f enable multi-user.target haveged.service pacman-init.service autologin@.service dhcpcd@eth0.service ntpd.service || true' \ + run : > ${work_dir}/build.${FUNCNAME} fi }
Do you actually want to autologin on all TTYs? Won't there be a conflict between autologin and getty? Only on tty1 is enabled (see Install section, there is and Alias to tty1). Sure I can add @tty1 but is reduntant like for dhcpcd adding eth0 on enable command. (different case is when start command is used)
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 12.09.2012 17:32, schrieb Gerardo Exequiel Pozzi:
This should go to /etc directly. Nope, I want to maintain few files as posible.
This is not a system file from a package, but a site-specific file - it belongs to /etc/systemd/system/.
Do you actually want to autologin on all TTYs? Won't there be a conflict between autologin and getty? Only on tty1 is enabled (see Install section, there is and Alias to tty1). Sure I can add @tty1 but is reduntant like for dhcpcd adding eth0 on enable command. (different case is when start command is used)
I see now - but don't autologin@tty1 and getty@tty1 conflict?
________________________________ De: Thomas Bächler
Para: arch-releng@archlinux.org Enviado: miércoles, 12 de septiembre de 2012 13:26 Asunto: Re: [arch-releng] [PATCH 2/5] [configs/releng] Enable systemd services Am 12.09.2012 17:32, schrieb Gerardo Exequiel Pozzi:
This should go to /etc directly. Nope, I want to maintain few files as posible.
This is not a system file from a package, but a site-specific file - it belongs to /etc/systemd/system/.
Sorry, I do not understand what are trying to say here. I do not want to maintain a whole copy of a file with modification if I can keep with a simple serach/replace from original file.
Do you actually want to autologin on all TTYs? Won't there be a conflict between autologin and getty? Only on tty1 is enabled (see Install section, there is and Alias to tty1). Sure I can add @tty1 but is reduntant like for dhcpcd adding eth0 on enable command. (different case is when start command is used)
I see now - but don't autologin@tty1 and getty@tty1 conflict?
Nope, -f is used, so currently getty@tty1 symlink is removed.
Am 12.09.2012 21:03, schrieb Gerardo Exequiel Pozzi:
Am 12.09.2012 17:32, schrieb Gerardo Exequiel Pozzi:
This should go to /etc directly. Nope, I want to maintain few files as posible.
This is not a system file from a package, but a site-specific file - it belongs to /etc/systemd/system/.
Sorry, I do not understand what are trying to say here.
I do not want to maintain a whole copy of a file with modification if I can keep with a simple serach/replace from original file.
You put the file to /usr/lib/systemd/system, while it should be in /etc/systemd/system.
Do you actually want to autologin on all TTYs? Won't there be a conflict between autologin and getty? Only on tty1 is enabled (see Install section, there is and Alias to tty1). Sure I can add @tty1 but is reduntant like for dhcpcd adding eth0 on enable command. (different case is when start command is used)
I see now - but don't autologin@tty1 and getty@tty1 conflict?
Nope, -f is used, so currently getty@tty1 symlink is removed.
Oh, I see now - it uses the same alias as getty@.service. I overlooked that.
On 09/12/2012 05:57 PM, Thomas Bächler wrote:
Am 12.09.2012 21:03, schrieb Gerardo Exequiel Pozzi:
Am 12.09.2012 17:32, schrieb Gerardo Exequiel Pozzi:
This should go to /etc directly. Nope, I want to maintain few files as posible. This is not a system file from a package, but a site-specific file - it belongs to /etc/systemd/system/.
Sorry, I do not understand what are trying to say here.
I do not want to maintain a whole copy of a file with modification if I can keep with a simple serach/replace from original file. You put the file to /usr/lib/systemd/system, while it should be in /etc/systemd/system. Nope. See it again:
+ ${work_dir}/root-image/usr/lib/systemd/system/getty@.service > ${work_dir}/root-image/etc/systemd/system/autologin@.service
Do you actually want to autologin on all TTYs? Won't there be a conflict between autologin and getty? Only on tty1 is enabled (see Install section, there is and Alias to tty1). Sure I can add @tty1 but is reduntant like for dhcpcd adding eth0 on enable command. (different case is when start command is used) I see now - but don't autologin@tty1 and getty@tty1 conflict?
Nope, -f is used, so currently getty@tty1 symlink is removed. Oh, I see now - it uses the same alias as getty@.service. I overlooked that.
exactly! -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 09/12/2012 07:15 PM, Gerardo Exequiel Pozzi wrote: > On 09/12/2012 05:57 PM, Thomas Bächler wrote: >> Am 12.09.2012 21:03, schrieb Gerardo Exequiel Pozzi: >>>> Am 12.09.2012 17:32, schrieb Gerardo Exequiel Pozzi: >>>>>> This should go to /etc directly. >>>>> Nope, I want to maintain few files as posible. >>>> This is not a system file from a package, but a site-specific file >>>> - it >>>> belongs to /etc/systemd/system/. >>>> >>>> >>> Sorry, I do not understand what are trying to say here. >>> >>> I do not want to maintain a whole copy of a file with modification >>> if I can keep with a simple serach/replace from original file. >> You put the file to /usr/lib/systemd/system, while it should be in >> /etc/systemd/system. > Nope. See it again: > > + ${work_dir}/root-image/usr/lib/systemd/system/getty@.service > > ${work_dir}/root-image/etc/systemd/system/autologin@.service maybe you are confused with pacman-init.service, I will move it to /etc. (also tmpfiles.d) >> >>>>>> Do you actually want to autologin on all TTYs? Won't there be a >>>>>> conflict >>>>>> between autologin and getty? >>>>> Only on tty1 is enabled (see Install section, there is and Alias to >>>>> tty1). Sure I can add @tty1 but is reduntant like for dhcpcd >>>>> adding eth0 >>>>> on enable command. (different case is when start command is used) >>>> I see now - but don't autologin@tty1 and getty@tty1 conflict? >>>> >>>> >>> Nope, -f is used, so currently getty@tty1 symlink is removed. >> Oh, I see now - it uses the same alias as getty@.service. I >> overlooked that. >> >> > exactly! > -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 13.09.2012 00:15, schrieb Gerardo Exequiel Pozzi:
On 09/12/2012 05:57 PM, Thomas Bächler wrote:
Am 12.09.2012 21:03, schrieb Gerardo Exequiel Pozzi:
Am 12.09.2012 17:32, schrieb Gerardo Exequiel Pozzi:
This should go to /etc directly. Nope, I want to maintain few files as posible. This is not a system file from a package, but a site-specific file - it belongs to /etc/systemd/system/.
Sorry, I do not understand what are trying to say here.
I do not want to maintain a whole copy of a file with modification if I can keep with a simple serach/replace from original file. You put the file to /usr/lib/systemd/system, while it should be in /etc/systemd/system. Nope. See it again:
+ ${work_dir}/root-image/usr/lib/systemd/system/getty@.service > ${work_dir}/root-image/etc/systemd/system/autologin@.service
I must be blind.
On 09/12/2012 04:10 AM, Gerardo Exequiel Pozzi wrote:
Signed-off-by: Gerardo Exequiel Pozzi
--- .../root-image/usr/lib/systemd/system/pacman-init.service | 13 +++++++++++++ .../releng/root-image/usr/lib/tmpfiles.d/pacman-init.conf | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 configs/releng/root-image/usr/lib/systemd/system/pacman-init.service create mode 100644 configs/releng/root-image/usr/lib/tmpfiles.d/pacman-init.conf diff --git a/configs/releng/root-image/usr/lib/systemd/system/pacman-init.service b/configs/releng/root-image/usr/lib/systemd/system/pacman-init.service new file mode 100644 index 0000000..2154476 --- /dev/null +++ b/configs/releng/root-image/usr/lib/systemd/system/pacman-init.service @@ -0,0 +1,13 @@ +[Unit] +Description=Initializes Pacman keyring +Wants=haveged.service +After=haveged.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/pacman-key --init +ExecStart=/usr/bin/pacman-key --populate archlinux + +[Install] +WantedBy=multi-user.target diff --git a/configs/releng/root-image/usr/lib/tmpfiles.d/pacman-init.conf b/configs/releng/root-image/usr/lib/tmpfiles.d/pacman-init.conf new file mode 100644 index 0000000..8f3d6c9 --- /dev/null +++ b/configs/releng/root-image/usr/lib/tmpfiles.d/pacman-init.conf @@ -0,0 +1,2 @@ +d /run/pacman.d/gnupg - - - - - +L /etc/pacman.d/gnupg - - - - /run/pacman.d/gnupg Moved respetively to /etc.
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
dhcpcd@eth0.service ntpd.service || true' \
This is not going to work. You only enable dhcp on eth0 here. It should be enabled on all devices. You cannot know if there is an eth0 device or if it is the one connected to the lan. We just need to implement this: https://bugs.archlinux.org/task/31543 -- Pierre Schmitz, https://pierre-schmitz.com
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
Signed-off-by: Gerardo Exequiel Pozzi
--- configs/releng/build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configs/releng/build.sh b/configs/releng/build.sh index 502f842..65193a8 100755 --- a/configs/releng/build.sh +++ b/configs/releng/build.sh @@ -26,6 +26,14 @@ setup_workdir() { make_basefs() { mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" init mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" -p "memtest86+ mkinitcpio-nfs-utils nbd curl" install + + # Install systemd-sysvcompat in this way until hits {base} group + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ + -r 'pacman -R --noconfirm --noprogressbar initscripts sysvinit' \ + run + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ + -p "systemd-sysvcompat" \ + install }
# Additional packages (root-image)
Maybe use Rn here so rc.conf etc. gets removed. -- Pierre Schmitz, https://pierre-schmitz.com
Am 16.09.2012 10:40, schrieb Pierre Schmitz:
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
dhcpcd@eth0.service ntpd.service || true' \
This is not going to work. You only enable dhcp on eth0 here. It should be enabled on all devices. You cannot know if there is an eth0 device or if it is the one connected to the lan. We just need to implement this: https://bugs.archlinux.org/task/31543
The service proposed there uses dhcpcd -w, which is a bad idea for us.
Am 16.09.2012 11:17, schrieb Thomas Bächler:
Am 16.09.2012 10:40, schrieb Pierre Schmitz:
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
dhcpcd@eth0.service ntpd.service || true' \
This is not going to work. You only enable dhcp on eth0 here. It should be enabled on all devices. You cannot know if there is an eth0 device or if it is the one connected to the lan. We just need to implement this: https://bugs.archlinux.org/task/31543
The service proposed there uses dhcpcd -w, which is a bad idea for us.
Why? Don't we get a login when the network target is not reached? -- Pierre Schmitz, https://pierre-schmitz.com
Am 16.09.2012 14:01, schrieb Pierre Schmitz:
Am 16.09.2012 11:17, schrieb Thomas Bächler:
Am 16.09.2012 10:40, schrieb Pierre Schmitz:
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
dhcpcd@eth0.service ntpd.service || true' \
This is not going to work. You only enable dhcp on eth0 here. It should be enabled on all devices. You cannot know if there is an eth0 device or if it is the one connected to the lan. We just need to implement this: https://bugs.archlinux.org/task/31543
The service proposed there uses dhcpcd -w, which is a bad idea for us.
Why? Don't we get a login when the network target is not reached?
No idea. Certain services might be ordered After=network.target and stall booting. This whole "network.target" thing is complete voodoo anyway. It is stupid to assume that you will always know whether a network connection is established. No daemon should rely on that.
On Sun, Sep 16, 2012 at 02:01:03PM +0200, Pierre Schmitz wrote:
Am 16.09.2012 11:17, schrieb Thomas Bächler:
Am 16.09.2012 10:40, schrieb Pierre Schmitz:
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
dhcpcd@eth0.service ntpd.service || true' \
This is not going to work. You only enable dhcp on eth0 here. It should be enabled on all devices. You cannot know if there is an eth0 device or if it is the one connected to the lan. We just need to implement this: https://bugs.archlinux.org/task/31543
The service proposed there uses dhcpcd -w, which is a bad idea for us.
Why? Don't we get a login when the network target is not reached?
The daemon would have 90s or so (whatever the default timeout is) to pick up a network connection and fork. If it doesn't do that, it's going to stall boot until the timeout, and then get brutally killed by systemd.
Am 16.09.2012 14:38, schrieb Dave Reisner:
On Sun, Sep 16, 2012 at 02:01:03PM +0200, Pierre Schmitz wrote:
Am 16.09.2012 11:17, schrieb Thomas Bächler:
Am 16.09.2012 10:40, schrieb Pierre Schmitz:
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
dhcpcd@eth0.service ntpd.service || true' \
This is not going to work. You only enable dhcp on eth0 here. It should be enabled on all devices. You cannot know if there is an eth0 device or if it is the one connected to the lan. We just need to implement this: https://bugs.archlinux.org/task/31543
The service proposed there uses dhcpcd -w, which is a bad idea for us.
Why? Don't we get a login when the network target is not reached?
The daemon would have 90s or so (whatever the default timeout is) to pick up a network connection and fork. If it doesn't do that, it's going to stall boot until the timeout, and then get brutally killed by systemd.
Well, then this unit file is kind of broken. What's the problem with just using -b as we do on the current media. I don't know of any issues with this. The network target could be reached even if there is no network, but for the live media I don't see a real problem here. (Or we use networkmanager, but that seems to do something similar). Either way, this is still better than just trying to run dhcp on eth0 only. -- Pierre Schmitz, https://pierre-schmitz.com
On Sun, Sep 16, 2012 at 02:42:59PM +0200, Pierre Schmitz wrote:
Am 16.09.2012 14:38, schrieb Dave Reisner:
On Sun, Sep 16, 2012 at 02:01:03PM +0200, Pierre Schmitz wrote:
Am 16.09.2012 11:17, schrieb Thomas Bächler:
Am 16.09.2012 10:40, schrieb Pierre Schmitz:
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
dhcpcd@eth0.service ntpd.service || true' \
This is not going to work. You only enable dhcp on eth0 here. It should be enabled on all devices. You cannot know if there is an eth0 device or if it is the one connected to the lan. We just need to implement this: https://bugs.archlinux.org/task/31543
The service proposed there uses dhcpcd -w, which is a bad idea for us.
Why? Don't we get a login when the network target is not reached?
The daemon would have 90s or so (whatever the default timeout is) to pick up a network connection and fork. If it doesn't do that, it's going to stall boot until the timeout, and then get brutally killed by systemd.
Well, then this unit file is kind of broken. What's the problem with just using -b as we do on the current media. I don't know of any issues with this. The network target could be reached even if there is no network, but for the live media I don't see a real problem here. (Or we use networkmanager, but that seems to do something similar). Either way, this is still better than just trying to run dhcp on eth0 only.
It's fine to do it that way. I'm not convinced that using -w is the proper thing to do with the default dhcpcd.service anyways.
On 09/16/2012 05:45 AM, Pierre Schmitz wrote:
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
Signed-off-by: Gerardo Exequiel Pozzi
--- configs/releng/build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configs/releng/build.sh b/configs/releng/build.sh index 502f842..65193a8 100755 --- a/configs/releng/build.sh +++ b/configs/releng/build.sh @@ -26,6 +26,14 @@ setup_workdir() { make_basefs() { mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" init mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" -p "memtest86+ mkinitcpio-nfs-utils nbd curl" install + + # Install systemd-sysvcompat in this way until hits {base} group + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ + -r 'pacman -R --noconfirm --noprogressbar initscripts sysvinit' \ + run + mkarchiso ${verbose} -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" \ + -p "systemd-sysvcompat" \ + install }
# Additional packages (root-image) Maybe use Rn here so rc.conf etc. gets removed.
Is irrelevant, since rc.conf is not modified, so there is no rc.conf.pacsave file like for others "backup=()" from both packages ;) TIP: if you found "rc.conf" file, then your build enviroment is not clear (old files present on /usr/share/archiso/configs/releng. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit :
Signed-off-by: Gerardo Exequiel Pozzi
--- .../releng/root-image/root/.automated_script.sh | 34 ++++++++++++++++++++++ configs/releng/root-image/root/.zlogin | 1 + 2 files changed, 35 insertions(+) create mode 100755 configs/releng/root-image/root/.automated_script.sh create mode 100644 configs/releng/root-image/root/.zlogin diff --git a/configs/releng/root-image/root/.automated_script.sh b/configs/releng/root-image/root/.automated_script.sh new file mode 100755 index 0000000..859452f --- /dev/null +++ b/configs/releng/root-image/root/.automated_script.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +script_cmdline () +{ + local param + for param in $(< /proc/cmdline); do + case "${param}" in + script=*) echo "${param##*=}" ; return 0 ;; + esac + done +} + +automated_script () +{ + local script rt + script="$(script_cmdline)" + if [[ -n "${script}" ]]; then + 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 + /tmp/startup_script + fi + fi +} + +if [[ $(tty) == "/dev/tty1" ]]; then + automated_script +fi diff --git a/configs/releng/root-image/root/.zlogin b/configs/releng/root-image/root/.zlogin new file mode 100644 index 0000000..f598e43 --- /dev/null +++ b/configs/releng/root-image/root/.zlogin @@ -0,0 +1 @@ +~/.automated_script.sh Hi,
Two problems: - when the script is run, the network is not ready, making automated_script to fail. Adding the parameter "--retry-connrefused" to wget will fixed it. - the hook /etc/rc.d/functions.d/automated_script has not been removed. Thanks for trying to make this function work. Very useful to me ! Regards, Charles
On 09/16/2012 06:01 PM, Charles wrote:
Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit :
Signed-off-by: Gerardo Exequiel Pozzi
--- .../releng/root-image/root/.automated_script.sh | 34 ++++++++++++++++++++++ configs/releng/root-image/root/.zlogin | 1 + 2 files changed, 35 insertions(+) create mode 100755 configs/releng/root-image/root/.automated_script.sh create mode 100644 configs/releng/root-image/root/.zlogin diff --git a/configs/releng/root-image/root/.automated_script.sh b/configs/releng/root-image/root/.automated_script.sh new file mode 100755 index 0000000..859452f --- /dev/null +++ b/configs/releng/root-image/root/.automated_script.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +script_cmdline () +{ + local param + for param in $(< /proc/cmdline); do + case "${param}" in + script=*) echo "${param##*=}" ; return 0 ;; + esac + done +} + +automated_script () +{ + local script rt + script="$(script_cmdline)" + if [[ -n "${script}" ]]; then + 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 + /tmp/startup_script + fi + fi +} + +if [[ $(tty) == "/dev/tty1" ]]; then + automated_script +fi diff --git a/configs/releng/root-image/root/.zlogin b/configs/releng/root-image/root/.zlogin new file mode 100644 index 0000000..f598e43 --- /dev/null +++ b/configs/releng/root-image/root/.zlogin @@ -0,0 +1 @@ +~/.automated_script.sh Hi,
Two problems: - when the script is run, the network is not ready, making automated_script to fail. Adding the parameter "--retry-connrefused" to wget will fixed it. "network ready" issues is a thing that should be fixed in some way. For now adding such switch seems to be fine ;) - the hook /etc/rc.d/functions.d/automated_script has not been removed. Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
rm -r /usr/lib/initcpio/archiso_* /usr/lib/initcpio/hooks/archiso* /usr/lib/initcpio/install/archiso* /usr/share/doc/archiso /usr/share/archiso /usr/sbin/mkarchiso
Thanks for trying to make this function work. Very useful to me !
Thanks you for testing.
Regards,
Charles
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Le 17/09/2012 01:12, Gerardo Exequiel Pozzi a écrit :
On 09/16/2012 06:01 PM, Charles wrote:
Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit :
Signed-off-by: Gerardo Exequiel Pozzi
--- .../releng/root-image/root/.automated_script.sh | 34 ++++++++++++++++++++++ configs/releng/root-image/root/.zlogin | 1 + 2 files changed, 35 insertions(+) create mode 100755 configs/releng/root-image/root/.automated_script.sh create mode 100644 configs/releng/root-image/root/.zlogin diff --git a/configs/releng/root-image/root/.automated_script.sh b/configs/releng/root-image/root/.automated_script.sh new file mode 100755 index 0000000..859452f --- /dev/null +++ b/configs/releng/root-image/root/.automated_script.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +script_cmdline () +{ + local param + for param in $(< /proc/cmdline); do + case "${param}" in + script=*) echo "${param##*=}" ; return 0 ;; + esac + done +} + +automated_script () +{ + local script rt + script="$(script_cmdline)" + if [[ -n "${script}" ]]; then + 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 + /tmp/startup_script + fi + fi +} + +if [[ $(tty) == "/dev/tty1" ]]; then + automated_script +fi diff --git a/configs/releng/root-image/root/.zlogin b/configs/releng/root-image/root/.zlogin new file mode 100644 index 0000000..f598e43 --- /dev/null +++ b/configs/releng/root-image/root/.zlogin @@ -0,0 +1 @@ +~/.automated_script.sh Hi,
Two problems: - when the script is run, the network is not ready, making automated_script to fail. Adding the parameter "--retry-connrefused" to wget will fixed it. "network ready" issues is a thing that should be fixed in some way. For now adding such switch seems to be fine ;) - the hook /etc/rc.d/functions.d/automated_script has not been removed. Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
rm -r /usr/lib/initcpio/archiso_* /usr/lib/initcpio/hooks/archiso* /usr/lib/initcpio/install/archiso* /usr/share/doc/archiso /usr/share/archiso /usr/sbin/mkarchiso
Thanks for trying to make this function work. Very useful to me !
Thanks you for testing.
Regards,
Charles
Hi Gerardo,
Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
I don't get that. the file "http://projects.archlinux.org/archiso.git/tree/configs/releng/root-image/etc..." is still there, isn't it ? or is there another patch ? Charles
On 09/17/2012 06:42 AM, Charles wrote:
Le 17/09/2012 01:12, Gerardo Exequiel Pozzi a écrit :
On 09/16/2012 06:01 PM, Charles wrote:
Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit :
Signed-off-by: Gerardo Exequiel Pozzi
--- .../releng/root-image/root/.automated_script.sh | 34 ++++++++++++++++++++++ configs/releng/root-image/root/.zlogin | 1 + 2 files changed, 35 insertions(+) create mode 100755 configs/releng/root-image/root/.automated_script.sh create mode 100644 configs/releng/root-image/root/.zlogin diff --git a/configs/releng/root-image/root/.automated_script.sh b/configs/releng/root-image/root/.automated_script.sh new file mode 100755 index 0000000..859452f --- /dev/null +++ b/configs/releng/root-image/root/.automated_script.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +script_cmdline () +{ + local param + for param in $(< /proc/cmdline); do + case "${param}" in + script=*) echo "${param##*=}" ; return 0 ;; + esac + done +} + +automated_script () +{ + local script rt + script="$(script_cmdline)" + if [[ -n "${script}" ]]; then + 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 + /tmp/startup_script + fi + fi +} + +if [[ $(tty) == "/dev/tty1" ]]; then + automated_script +fi diff --git a/configs/releng/root-image/root/.zlogin b/configs/releng/root-image/root/.zlogin new file mode 100644 index 0000000..f598e43 --- /dev/null +++ b/configs/releng/root-image/root/.zlogin @@ -0,0 +1 @@ +~/.automated_script.sh Hi,
Two problems: - when the script is run, the network is not ready, making automated_script to fail. Adding the parameter "--retry-connrefused" to wget will fixed it. "network ready" issues is a thing that should be fixed in some way. For now adding such switch seems to be fine ;) - the hook /etc/rc.d/functions.d/automated_script has not been removed. Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
rm -r /usr/lib/initcpio/archiso_* /usr/lib/initcpio/hooks/archiso* /usr/lib/initcpio/install/archiso* /usr/share/doc/archiso /usr/share/archiso /usr/sbin/mkarchiso
Thanks for trying to make this function work. Very useful to me !
Thanks you for testing.
Regards,
Charles
Hi Gerardo,
Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
I don't get that. the file "http://projects.archlinux.org/archiso.git/tree/configs/releng/root-image/etc..." is still there, isn't it ? or is there another patch ?
Charles
These RFC patchs are not merged in master and main repo. Only in my repo, inside experimental branch. https://github.com/djgera/archiso/compare/master...experimental -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 09/17/2012 09:22 AM, Gerardo Exequiel Pozzi wrote:
On 09/17/2012 06:42 AM, Charles wrote:
Le 17/09/2012 01:12, Gerardo Exequiel Pozzi a écrit :
On 09/16/2012 06:01 PM, Charles wrote:
Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit :
Signed-off-by: Gerardo Exequiel Pozzi
--- .../releng/root-image/root/.automated_script.sh | 34 ++++++++++++++++++++++ configs/releng/root-image/root/.zlogin | 1 + 2 files changed, 35 insertions(+) create mode 100755 configs/releng/root-image/root/.automated_script.sh create mode 100644 configs/releng/root-image/root/.zlogin diff --git a/configs/releng/root-image/root/.automated_script.sh b/configs/releng/root-image/root/.automated_script.sh new file mode 100755 index 0000000..859452f --- /dev/null +++ b/configs/releng/root-image/root/.automated_script.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +script_cmdline () +{ + local param + for param in $(< /proc/cmdline); do + case "${param}" in + script=*) echo "${param##*=}" ; return 0 ;; + esac + done +} + +automated_script () +{ + local script rt + script="$(script_cmdline)" + if [[ -n "${script}" ]]; then + 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 + /tmp/startup_script + fi + fi +} + +if [[ $(tty) == "/dev/tty1" ]]; then + automated_script +fi diff --git a/configs/releng/root-image/root/.zlogin b/configs/releng/root-image/root/.zlogin new file mode 100644 index 0000000..f598e43 --- /dev/null +++ b/configs/releng/root-image/root/.zlogin @@ -0,0 +1 @@ +~/.automated_script.sh Hi,
Two problems: - when the script is run, the network is not ready, making automated_script to fail. Adding the parameter "--retry-connrefused" to wget will fixed it. "network ready" issues is a thing that should be fixed in some way. For now adding such switch seems to be fine ;) - the hook /etc/rc.d/functions.d/automated_script has not been removed. Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
rm -r /usr/lib/initcpio/archiso_* /usr/lib/initcpio/hooks/archiso* /usr/lib/initcpio/install/archiso* /usr/share/doc/archiso /usr/share/archiso /usr/sbin/mkarchiso
Thanks for trying to make this function work. Very useful to me !
Thanks you for testing.
Regards,
Charles
Hi Gerardo,
Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
I don't get that. the file "http://projects.archlinux.org/archiso.git/tree/configs/releng/root-image/etc..." is still there, isn't it ? or is there another patch ?
Charles
These RFC patchs are not merged in master and main repo. Only in my repo, inside experimental branch.
https://github.com/djgera/archiso/compare/master...experimental
When you tested this, how do you do? Only applied this patch over master? -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Le 17/09/2012 14:26, Gerardo Exequiel Pozzi a écrit :
On 09/17/2012 09:22 AM, Gerardo Exequiel Pozzi wrote:
On 09/17/2012 06:42 AM, Charles wrote:
Le 17/09/2012 01:12, Gerardo Exequiel Pozzi a écrit :
On 09/16/2012 06:01 PM, Charles wrote:
Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit :
Signed-off-by: Gerardo Exequiel Pozzi
--- .../releng/root-image/root/.automated_script.sh | 34 ++++++++++++++++++++++ configs/releng/root-image/root/.zlogin | 1 + 2 files changed, 35 insertions(+) create mode 100755 configs/releng/root-image/root/.automated_script.sh create mode 100644 configs/releng/root-image/root/.zlogin diff --git a/configs/releng/root-image/root/.automated_script.sh b/configs/releng/root-image/root/.automated_script.sh new file mode 100755 index 0000000..859452f --- /dev/null +++ b/configs/releng/root-image/root/.automated_script.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +script_cmdline () +{ + local param + for param in $(< /proc/cmdline); do + case "${param}" in + script=*) echo "${param##*=}" ; return 0 ;; + esac + done +} + +automated_script () +{ + local script rt + script="$(script_cmdline)" + if [[ -n "${script}" ]]; then + 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 + /tmp/startup_script + fi + fi +} + +if [[ $(tty) == "/dev/tty1" ]]; then + automated_script +fi diff --git a/configs/releng/root-image/root/.zlogin b/configs/releng/root-image/root/.zlogin new file mode 100644 index 0000000..f598e43 --- /dev/null +++ b/configs/releng/root-image/root/.zlogin @@ -0,0 +1 @@ +~/.automated_script.sh Hi,
Two problems: - when the script is run, the network is not ready, making automated_script to fail. Adding the parameter "--retry-connrefused" to wget will fixed it. "network ready" issues is a thing that should be fixed in some way. For now adding such switch seems to be fine ;) - the hook /etc/rc.d/functions.d/automated_script has not been removed. Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
rm -r /usr/lib/initcpio/archiso_* /usr/lib/initcpio/hooks/archiso* /usr/lib/initcpio/install/archiso* /usr/share/doc/archiso /usr/share/archiso /usr/sbin/mkarchiso
Thanks for trying to make this function work. Very useful to me !
Thanks you for testing.
Regards,
Charles
Hi Gerardo,
Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
I don't get that. the file "http://projects.archlinux.org/archiso.git/tree/configs/releng/root-image/etc..." is still there, isn't it ? or is there another patch ?
Charles
These RFC patchs are not merged in master and main repo. Only in my repo, inside experimental branch.
https://github.com/djgera/archiso/compare/master...experimental
When you tested this, how do you do? Only applied this patch over master?
Yes
On 09/17/2012 09:38 AM, Charles wrote:
Le 17/09/2012 14:26, Gerardo Exequiel Pozzi a écrit :
On 09/17/2012 09:22 AM, Gerardo Exequiel Pozzi wrote:
On 09/17/2012 06:42 AM, Charles wrote:
Le 17/09/2012 01:12, Gerardo Exequiel Pozzi a écrit :
On 09/16/2012 06:01 PM, Charles wrote:
Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit : > Signed-off-by: Gerardo Exequiel Pozzi
> --- > .../releng/root-image/root/.automated_script.sh | 34 > ++++++++++++++++++++++ > configs/releng/root-image/root/.zlogin | 1 + > 2 files changed, 35 insertions(+) > create mode 100755 > configs/releng/root-image/root/.automated_script.sh > create mode 100644 configs/releng/root-image/root/.zlogin > > diff --git a/configs/releng/root-image/root/.automated_script.sh > b/configs/releng/root-image/root/.automated_script.sh > new file mode 100755 > index 0000000..859452f > --- /dev/null > +++ b/configs/releng/root-image/root/.automated_script.sh > @@ -0,0 +1,34 @@ > +#!/bin/bash > + > +script_cmdline () > +{ > + local param > + for param in $(< /proc/cmdline); do > + case "${param}" in > + script=*) echo "${param##*=}" ; return 0 ;; > + esac > + done > +} > + > +automated_script () > +{ > + local script rt > + script="$(script_cmdline)" > + if [[ -n "${script}" ]]; then > + 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 > + /tmp/startup_script > + fi > + fi > +} > + > +if [[ $(tty) == "/dev/tty1" ]]; then > + automated_script > +fi > diff --git a/configs/releng/root-image/root/.zlogin > b/configs/releng/root-image/root/.zlogin > new file mode 100644 > index 0000000..f598e43 > --- /dev/null > +++ b/configs/releng/root-image/root/.zlogin > @@ -0,0 +1 @@ > +~/.automated_script.sh Hi, Two problems: - when the script is run, the network is not ready, making automated_script to fail. Adding the parameter "--retry-connrefused" to wget will fixed it. "network ready" issues is a thing that should be fixed in some way. For now adding such switch seems to be fine ;) - the hook /etc/rc.d/functions.d/automated_script has not been removed. Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
rm -r /usr/lib/initcpio/archiso_* /usr/lib/initcpio/hooks/archiso* /usr/lib/initcpio/install/archiso* /usr/share/doc/archiso /usr/share/archiso /usr/sbin/mkarchiso
Thanks for trying to make this function work. Very useful to me !
Thanks you for testing.
Regards,
Charles
Hi Gerardo,
Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
I don't get that. the file "http://projects.archlinux.org/archiso.git/tree/configs/releng/root-image/etc..." is still there, isn't it ? or is there another patch ?
Charles
These RFC patchs are not merged in master and main repo. Only in my repo, inside experimental branch.
https://github.com/djgera/archiso/compare/master...experimental
When you tested this, how do you do? Only applied this patch over master?
Yes
Oooh thats wrong, you need to apply all patches, or just use my experimetal branch. Otherwise non-native systemd things will be used. I guess this was your problem about no network available... If you have some time, you can build again but using "experimental" branch, and removing --retry-connrefused, at least in my case works, when I made this patch. Thanks. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Le 17/09/2012 14:46, Gerardo Exequiel Pozzi a écrit :
On 09/17/2012 09:38 AM, Charles wrote:
Le 17/09/2012 14:26, Gerardo Exequiel Pozzi a écrit :
On 09/17/2012 09:22 AM, Gerardo Exequiel Pozzi wrote:
On 09/17/2012 06:42 AM, Charles wrote:
Le 17/09/2012 01:12, Gerardo Exequiel Pozzi a écrit :
On 09/16/2012 06:01 PM, Charles wrote: > Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit : >> Signed-off-by: Gerardo Exequiel Pozzi
>> --- >> .../releng/root-image/root/.automated_script.sh | 34 >> ++++++++++++++++++++++ >> configs/releng/root-image/root/.zlogin | 1 + >> 2 files changed, 35 insertions(+) >> create mode 100755 >> configs/releng/root-image/root/.automated_script.sh >> create mode 100644 configs/releng/root-image/root/.zlogin >> >> diff --git >> a/configs/releng/root-image/root/.automated_script.sh >> b/configs/releng/root-image/root/.automated_script.sh >> new file mode 100755 >> index 0000000..859452f >> --- /dev/null >> +++ b/configs/releng/root-image/root/.automated_script.sh >> @@ -0,0 +1,34 @@ >> +#!/bin/bash >> + >> +script_cmdline () >> +{ >> + local param >> + for param in $(< /proc/cmdline); do >> + case "${param}" in >> + script=*) echo "${param##*=}" ; return 0 ;; >> + esac >> + done >> +} >> + >> +automated_script () >> +{ >> + local script rt >> + script="$(script_cmdline)" >> + if [[ -n "${script}" ]]; then >> + 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 >> + /tmp/startup_script >> + fi >> + fi >> +} >> + >> +if [[ $(tty) == "/dev/tty1" ]]; then >> + automated_script >> +fi >> diff --git a/configs/releng/root-image/root/.zlogin >> b/configs/releng/root-image/root/.zlogin >> new file mode 100644 >> index 0000000..f598e43 >> --- /dev/null >> +++ b/configs/releng/root-image/root/.zlogin >> @@ -0,0 +1 @@ >> +~/.automated_script.sh > Hi, > > Two problems: > - when the script is run, the network is not ready, making > automated_script to fail. Adding the parameter > "--retry-connrefused" to wget will fixed it. "network ready" issues is a thing that should be fixed in some way. For now adding such switch seems to be fine ;) > - the hook /etc/rc.d/functions.d/automated_script has not been > removed. Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc) rm -r /usr/lib/initcpio/archiso_* /usr/lib/initcpio/hooks/archiso* /usr/lib/initcpio/install/archiso* /usr/share/doc/archiso /usr/share/archiso /usr/sbin/mkarchiso > > Thanks for trying to make this function work. Very useful to me ! Thanks you for testing. > > Regards, > > Charles > >
Hi Gerardo,
Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
I don't get that. the file "http://projects.archlinux.org/archiso.git/tree/configs/releng/root-image/etc..." is still there, isn't it ? or is there another patch ?
Charles
These RFC patchs are not merged in master and main repo. Only in my repo, inside experimental branch.
https://github.com/djgera/archiso/compare/master...experimental
When you tested this, how do you do? Only applied this patch over master?
Yes
Oooh thats wrong, you need to apply all patches, or just use my experimetal branch. Otherwise non-native systemd things will be used.
I guess this was your problem about no network available... If you have some time, you can build again but using "experimental" branch, and removing --retry-connrefused, at least in my case works, when I made this patch.
Thanks.
Sorry. I build a new image from your experimental branch. It's working. The only weird thing are the ton of messages at reboot, which you already mentioned. Thanks Charles
On 09/19/2012 12:55 PM, Charles wrote:
Le 17/09/2012 14:46, Gerardo Exequiel Pozzi a écrit :
On 09/17/2012 09:38 AM, Charles wrote:
Le 17/09/2012 14:26, Gerardo Exequiel Pozzi a écrit :
On 09/17/2012 09:22 AM, Gerardo Exequiel Pozzi wrote:
On 09/17/2012 06:42 AM, Charles wrote:
Le 17/09/2012 01:12, Gerardo Exequiel Pozzi a écrit : > On 09/16/2012 06:01 PM, Charles wrote: >> Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit : >>> Signed-off-by: Gerardo Exequiel Pozzi
>>> --- >>> .../releng/root-image/root/.automated_script.sh | 34 >>> ++++++++++++++++++++++ >>> configs/releng/root-image/root/.zlogin | 1 + >>> 2 files changed, 35 insertions(+) >>> create mode 100755 >>> configs/releng/root-image/root/.automated_script.sh >>> create mode 100644 configs/releng/root-image/root/.zlogin >>> >>> diff --git >>> a/configs/releng/root-image/root/.automated_script.sh >>> b/configs/releng/root-image/root/.automated_script.sh >>> new file mode 100755 >>> index 0000000..859452f >>> --- /dev/null >>> +++ b/configs/releng/root-image/root/.automated_script.sh >>> @@ -0,0 +1,34 @@ >>> +#!/bin/bash >>> + >>> +script_cmdline () >>> +{ >>> + local param >>> + for param in $(< /proc/cmdline); do >>> + case "${param}" in >>> + script=*) echo "${param##*=}" ; return 0 ;; >>> + esac >>> + done >>> +} >>> + >>> +automated_script () >>> +{ >>> + local script rt >>> + script="$(script_cmdline)" >>> + if [[ -n "${script}" ]]; then >>> + 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 >>> + /tmp/startup_script >>> + fi >>> + fi >>> +} >>> + >>> +if [[ $(tty) == "/dev/tty1" ]]; then >>> + automated_script >>> +fi >>> diff --git a/configs/releng/root-image/root/.zlogin >>> b/configs/releng/root-image/root/.zlogin >>> new file mode 100644 >>> index 0000000..f598e43 >>> --- /dev/null >>> +++ b/configs/releng/root-image/root/.zlogin >>> @@ -0,0 +1 @@ >>> +~/.automated_script.sh >> Hi, >> >> Two problems: >> - when the script is run, the network is not ready, making >> automated_script to fail. Adding the parameter >> "--retry-connrefused" to wget will fixed it. > "network ready" issues is a thing that should be fixed in some > way. For now adding such switch seems to be fine ;) >> - the hook /etc/rc.d/functions.d/automated_script has not been >> removed. > Is removed, ensure that you are working on clean enviroment > (remove files from /usr/share/archiso, etc) > > rm -r /usr/lib/initcpio/archiso_* > /usr/lib/initcpio/hooks/archiso* > /usr/lib/initcpio/install/archiso* /usr/share/doc/archiso > /usr/share/archiso /usr/sbin/mkarchiso >> >> Thanks for trying to make this function work. Very useful to me ! > Thanks you for testing. >> >> Regards, >> >> Charles >> >> > > Hi Gerardo,
> Is removed, ensure that you are working on clean enviroment (remove files from /usr/share/archiso, etc)
I don't get that. the file "http://projects.archlinux.org/archiso.git/tree/configs/releng/root-image/etc..." is still there, isn't it ? or is there another patch ?
Charles
These RFC patchs are not merged in master and main repo. Only in my repo, inside experimental branch.
https://github.com/djgera/archiso/compare/master...experimental
When you tested this, how do you do? Only applied this patch over master?
Yes
Oooh thats wrong, you need to apply all patches, or just use my experimetal branch. Otherwise non-native systemd things will be used.
I guess this was your problem about no network available... If you have some time, you can build again but using "experimental" branch, and removing --retry-connrefused, at least in my case works, when I made this patch.
Thanks.
Sorry. I build a new image from your experimental branch. It's working.
The only weird thing are the ton of messages at reboot, which you already mentioned.
Thanks
Charles
Nice, thanks for confirmation. Anyway I will keep that switch, seems to be a good idea. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Le 19/09/2012 23:39, Gerardo Exequiel Pozzi a écrit :
On 09/19/2012 12:55 PM, Charles wrote:
Le 17/09/2012 14:46, Gerardo Exequiel Pozzi a écrit :
On 09/17/2012 09:38 AM, Charles wrote:
Le 17/09/2012 14:26, Gerardo Exequiel Pozzi a écrit :
On 09/17/2012 09:22 AM, Gerardo Exequiel Pozzi wrote:
On 09/17/2012 06:42 AM, Charles wrote: > Le 17/09/2012 01:12, Gerardo Exequiel Pozzi a écrit : >> On 09/16/2012 06:01 PM, Charles wrote: >>> Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit : >>>> Signed-off-by: Gerardo Exequiel Pozzi
>>>> --- >>>> .../releng/root-image/root/.automated_script.sh | 34 >>>> ++++++++++++++++++++++ >>>> configs/releng/root-image/root/.zlogin | 1 + >>>> 2 files changed, 35 insertions(+) >>>> create mode 100755 >>>> configs/releng/root-image/root/.automated_script.sh >>>> create mode 100644 configs/releng/root-image/root/.zlogin >>>> >>>> diff --git >>>> a/configs/releng/root-image/root/.automated_script.sh >>>> b/configs/releng/root-image/root/.automated_script.sh >>>> new file mode 100755 >>>> index 0000000..859452f >>>> --- /dev/null >>>> +++ b/configs/releng/root-image/root/.automated_script.sh >>>> @@ -0,0 +1,34 @@ >>>> +#!/bin/bash >>>> + >>>> +script_cmdline () >>>> +{ >>>> + local param >>>> + for param in $(< /proc/cmdline); do >>>> + case "${param}" in >>>> + script=*) echo "${param##*=}" ; return 0 ;; >>>> + esac >>>> + done >>>> +} >>>> + >>>> +automated_script () >>>> +{ >>>> + local script rt >>>> + script="$(script_cmdline)" >>>> + if [[ -n "${script}" ]]; then >>>> + 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 >>>> + /tmp/startup_script >>>> + fi >>>> + fi >>>> +} >>>> + >>>> +if [[ $(tty) == "/dev/tty1" ]]; then >>>> + automated_script >>>> +fi >>>> diff --git a/configs/releng/root-image/root/.zlogin >>>> b/configs/releng/root-image/root/.zlogin >>>> new file mode 100644 >>>> index 0000000..f598e43 >>>> --- /dev/null >>>> +++ b/configs/releng/root-image/root/.zlogin >>>> @@ -0,0 +1 @@ >>>> +~/.automated_script.sh >>> Hi, >>> >>> Two problems: >>> - when the script is run, the network is not ready, making >>> automated_script to fail. Adding the parameter >>> "--retry-connrefused" to wget will fixed it. >> "network ready" issues is a thing that should be fixed in some >> way. For now adding such switch seems to be fine ;) >>> - the hook /etc/rc.d/functions.d/automated_script has not been >>> removed. >> Is removed, ensure that you are working on clean enviroment >> (remove files from /usr/share/archiso, etc) >> >> rm -r /usr/lib/initcpio/archiso_* >> /usr/lib/initcpio/hooks/archiso* >> /usr/lib/initcpio/install/archiso* /usr/share/doc/archiso >> /usr/share/archiso /usr/sbin/mkarchiso >>> >>> Thanks for trying to make this function work. Very useful to me ! >> Thanks you for testing. >>> >>> Regards, >>> >>> Charles >>> >>> >> >> > > Hi Gerardo, > > > Is removed, ensure that you are working on clean enviroment > (remove files from /usr/share/archiso, etc) > > I don't get that. the file > "http://projects.archlinux.org/archiso.git/tree/configs/releng/root-image/etc..." > is still there, isn't it ? or is there another patch ? > > Charles > > These RFC patchs are not merged in master and main repo. Only in my repo, inside experimental branch.
https://github.com/djgera/archiso/compare/master...experimental
When you tested this, how do you do? Only applied this patch over master?
Yes
Oooh thats wrong, you need to apply all patches, or just use my experimetal branch. Otherwise non-native systemd things will be used.
I guess this was your problem about no network available... If you have some time, you can build again but using "experimental" branch, and removing --retry-connrefused, at least in my case works, when I made this patch.
Thanks.
Sorry. I build a new image from your experimental branch. It's working.
The only weird thing are the ton of messages at reboot, which you already mentioned.
Thanks
Charles
Nice, thanks for confirmation. Anyway I will keep that switch, seems to be a good idea.
Anyway I will keep that switch, seems to be a good idea.
I think so too. Doesn't harm and make things more robust.
On 09/20/2012 11:08 AM, Charles wrote:
Le 19/09/2012 23:39, Gerardo Exequiel Pozzi a écrit :
On 09/19/2012 12:55 PM, Charles wrote:
Le 17/09/2012 14:46, Gerardo Exequiel Pozzi a écrit :
On 09/17/2012 09:38 AM, Charles wrote:
Le 17/09/2012 14:26, Gerardo Exequiel Pozzi a écrit :
On 09/17/2012 09:22 AM, Gerardo Exequiel Pozzi wrote: > On 09/17/2012 06:42 AM, Charles wrote: >> Le 17/09/2012 01:12, Gerardo Exequiel Pozzi a écrit : >>> On 09/16/2012 06:01 PM, Charles wrote: >>>> Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit : >>>>> Signed-off-by: Gerardo Exequiel Pozzi
>>>>> --- >>>>> .../releng/root-image/root/.automated_script.sh | 34 >>>>> ++++++++++++++++++++++ >>>>> configs/releng/root-image/root/.zlogin | 1 + >>>>> 2 files changed, 35 insertions(+) >>>>> create mode 100755 >>>>> configs/releng/root-image/root/.automated_script.sh >>>>> create mode 100644 configs/releng/root-image/root/.zlogin >>>>> >>>>> diff --git >>>>> a/configs/releng/root-image/root/.automated_script.sh >>>>> b/configs/releng/root-image/root/.automated_script.sh >>>>> new file mode 100755 >>>>> index 0000000..859452f >>>>> --- /dev/null >>>>> +++ b/configs/releng/root-image/root/.automated_script.sh >>>>> @@ -0,0 +1,34 @@ >>>>> +#!/bin/bash >>>>> + >>>>> +script_cmdline () >>>>> +{ >>>>> + local param >>>>> + for param in $(< /proc/cmdline); do >>>>> + case "${param}" in >>>>> + script=*) echo "${param##*=}" ; return 0 ;; >>>>> + esac >>>>> + done >>>>> +} >>>>> + >>>>> +automated_script () >>>>> +{ >>>>> + local script rt >>>>> + script="$(script_cmdline)" >>>>> + if [[ -n "${script}" ]]; then >>>>> + 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 >>>>> + /tmp/startup_script >>>>> + fi >>>>> + fi >>>>> +} >>>>> + >>>>> +if [[ $(tty) == "/dev/tty1" ]]; then >>>>> + automated_script >>>>> +fi >>>>> diff --git a/configs/releng/root-image/root/.zlogin >>>>> b/configs/releng/root-image/root/.zlogin >>>>> new file mode 100644 >>>>> index 0000000..f598e43 >>>>> --- /dev/null >>>>> +++ b/configs/releng/root-image/root/.zlogin >>>>> @@ -0,0 +1 @@ >>>>> +~/.automated_script.sh >>>> Hi, >>>> >>>> Two problems: >>>> - when the script is run, the network is not ready, making >>>> automated_script to fail. Adding the parameter >>>> "--retry-connrefused" to wget will fixed it. >>> "network ready" issues is a thing that should be fixed in some >>> way. For now adding such switch seems to be fine ;) >>>> - the hook /etc/rc.d/functions.d/automated_script has not >>>> been removed. >>> Is removed, ensure that you are working on clean enviroment >>> (remove files from /usr/share/archiso, etc) >>> >>> rm -r /usr/lib/initcpio/archiso_* >>> /usr/lib/initcpio/hooks/archiso* >>> /usr/lib/initcpio/install/archiso* /usr/share/doc/archiso >>> /usr/share/archiso /usr/sbin/mkarchiso >>>> >>>> Thanks for trying to make this function work. Very useful to >>>> me ! >>> Thanks you for testing. >>>> >>>> Regards, >>>> >>>> Charles >>>> >>>> >>> >>> >> >> Hi Gerardo, >> >> > Is removed, ensure that you are working on clean enviroment >> (remove files from /usr/share/archiso, etc) >> >> I don't get that. the file >> "http://projects.archlinux.org/archiso.git/tree/configs/releng/root-image/etc..." >> is still there, isn't it ? or is there another patch ? >> >> Charles >> >> > > These RFC patchs are not merged in master and main repo. Only in > my repo, inside experimental branch. > > https://github.com/djgera/archiso/compare/master...experimental > > > When you tested this, how do you do? Only applied this patch over master? Yes
Oooh thats wrong, you need to apply all patches, or just use my experimetal branch. Otherwise non-native systemd things will be used.
I guess this was your problem about no network available... If you have some time, you can build again but using "experimental" branch, and removing --retry-connrefused, at least in my case works, when I made this patch.
Thanks.
Sorry. I build a new image from your experimental branch. It's working.
The only weird thing are the ton of messages at reboot, which you already mentioned.
Thanks
Charles
Nice, thanks for confirmation. Anyway I will keep that switch, seems to be a good idea.
Anyway I will keep that switch, seems to be a good idea.
I think so too. Doesn't harm and make things more robust.
I reworked a bit the logic: instead of avoid re-executing agetty/autologin service on tty1, now automated_script checks if was already executed. if [[ -n "${script}" && ! -x /tmp/startup_script ]]; then -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (5)
-
Charles
-
Dave Reisner
-
Gerardo Exequiel Pozzi
-
Pierre Schmitz
-
Thomas Bächler