[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 <vmlinuz386@yahoo.com.ar> --- .../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 -- 1.7.12
On 09/12/2012 04:10 AM, Gerardo Exequiel Pozzi wrote:
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- .../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
Also makes a custom autologin unit. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- 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 @@ -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 } -- 1.7.12
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
Also makes a custom autologin unit.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- 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 <vmlinuz386@yahoo.com.ar> --- 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 <thomas@archlinux.org> 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.
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 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.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- 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) -- 1.7.12
Am 12.09.2012 09:10, schrieb Gerardo Exequiel Pozzi:
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- 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
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 <vmlinuz386@yahoo.com.ar> --- 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
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- configs/releng/root-image/etc/archiso/functions | 20 --------- configs/releng/root-image/etc/inittab | 48 ---------------------- configs/releng/root-image/etc/rc.conf | 23 ----------- .../etc/rc.d/functions.d/automated_script | 23 ----------- .../etc/rc.d/functions.d/setup_special_console | 25 ----------- configs/releng/root-image/etc/rc.d/pacman-init | 34 --------------- 6 files changed, 173 deletions(-) delete mode 100644 configs/releng/root-image/etc/archiso/functions delete mode 100644 configs/releng/root-image/etc/inittab delete mode 100644 configs/releng/root-image/etc/rc.conf delete mode 100644 configs/releng/root-image/etc/rc.d/functions.d/automated_script delete mode 100644 configs/releng/root-image/etc/rc.d/functions.d/setup_special_console delete mode 100755 configs/releng/root-image/etc/rc.d/pacman-init diff --git a/configs/releng/root-image/etc/archiso/functions b/configs/releng/root-image/etc/archiso/functions deleted file mode 100644 index 9fffdcb..0000000 --- a/configs/releng/root-image/etc/archiso/functions +++ /dev/null @@ -1,20 +0,0 @@ -# vim: set ft=sh: - -# kernel_cmdline <param> <default> -# 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. Also prints value passed as <default> -# -kernel_cmdline () -{ - for param in $(/bin/cat /proc/cmdline); do - case "${param}" in - $1=*) echo "${param##*=}"; return 0 ;; - $1) return 0 ;; - *) continue ;; - esac - done - [ -n "${2}" ] && echo "${2}" - return 1 -} diff --git a/configs/releng/root-image/etc/inittab b/configs/releng/root-image/etc/inittab deleted file mode 100644 index e3fe2c8..0000000 --- a/configs/releng/root-image/etc/inittab +++ /dev/null @@ -1,48 +0,0 @@ -# -# /etc/inittab -# - -# Runlevels: -# 0 Halt -# 1(S) Single-user -# 2 Not used -# 3 Multi-user -# 4 Not used -# 5 X11 -# 6 Reboot - -## Only one of the following two lines can be uncommented! -# Boot to console -id:3:initdefault: -# Boot to X11 -#id:5:initdefault: - -rc::sysinit:/etc/rc.sysinit -rs:S1:wait:/etc/rc.single -rm:2345:wait:/etc/rc.multi -rh:06:wait:/etc/rc.shutdown -su:S:wait:/sbin/sulogin -p - -# -8 options fixes umlauts problem on login -c1:2345:respawn:/sbin/agetty -8 -s -a root 38400 tty1 linux -c2:2345:respawn:/sbin/agetty -8 -s 38400 tty2 linux -c3:2345:respawn:/sbin/agetty -8 -s 38400 tty3 linux -c4:2345:respawn:/sbin/agetty -8 -s 38400 tty4 linux -c5:2345:respawn:/sbin/agetty -8 -s 38400 tty5 linux -c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux - -# Serial Virtual Console for KVM and others VMs -#s0:2345:respawn:/sbin/agetty -8 -s 9600 ttyS0 linux - -# Hypervisor Virtual Console for Xen and KVM -#h0:2345:respawn:/sbin/agetty -8 -s 38400 hvc0 linux - -ca::ctrlaltdel:/sbin/shutdown -t3 -r now - -# Example lines for starting a login manager -x:5:respawn:/usr/bin/xdm -nodaemon -#x:5:respawn:/usr/sbin/gdm -nodaemon -#x:5:respawn:/usr/bin/kdm -nodaemon -#x:5:respawn:/usr/bin/slim >/dev/null 2>&1 - -# End of file diff --git a/configs/releng/root-image/etc/rc.conf b/configs/releng/root-image/etc/rc.conf deleted file mode 100644 index a2e6ebf..0000000 --- a/configs/releng/root-image/etc/rc.conf +++ /dev/null @@ -1,23 +0,0 @@ -. /etc/archiso/functions -# -# /etc/rc.conf - configuration file for initscripts -# -# Most of rc.conf has been replaced by various other configuration -# files. See archlinux(7) for details. -# -# For more details on rc.conf see rc.conf(5). -# - -DAEMONS=(syslog-ng network haveged pacman-init) - -# Storage -# -# USEDMRAID="no" -# USELVM="no" - -# Network -# -# interface= -# address= -# netmask= -# gateway= diff --git a/configs/releng/root-image/etc/rc.d/functions.d/automated_script b/configs/releng/root-image/etc/rc.d/functions.d/automated_script deleted file mode 100644 index f3e9018..0000000 --- a/configs/releng/root-image/etc/rc.d/functions.d/automated_script +++ /dev/null @@ -1,23 +0,0 @@ -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/.zprofile - stat_done - else - stat_fail - fi - fi -} - -add_hook multi_end automated_script diff --git a/configs/releng/root-image/etc/rc.d/functions.d/setup_special_console b/configs/releng/root-image/etc/rc.d/functions.d/setup_special_console deleted file mode 100644 index 7badfe3..0000000 --- a/configs/releng/root-image/etc/rc.d/functions.d/setup_special_console +++ /dev/null @@ -1,25 +0,0 @@ -# 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/configs/releng/root-image/etc/rc.d/pacman-init b/configs/releng/root-image/etc/rc.d/pacman-init deleted file mode 100755 index bbbd719..0000000 --- a/configs/releng/root-image/etc/rc.d/pacman-init +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -. /etc/rc.conf -. /etc/rc.d/functions - -case "$1" in - start) - stat_busy "Initializing pacman keyring" - if { pacman-key --init && pacman-key --populate archlinux; } &>/dev/null; then - add_daemon pacman-init - stat_done - else - stat_fail - exit 1 - fi - ;; - - stop) - stat_busy "Removing pacman keyring" - rm -rf /etc/pacman.d/gnupg - rm_daemon pacman-init - stat_done - ;; - - restart) - $0 stop - $0 start - ;; - - *) - echo "usage: $0 {start|stop|restart}" -esac - -exit 0 -- 1.7.12
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- .../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 -- 1.7.12
Le 12/09/2012 09:10, Gerardo Exequiel Pozzi a écrit :
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- .../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 <vmlinuz386@yahoo.com.ar> --- .../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 <vmlinuz386@yahoo.com.ar> --- .../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 <vmlinuz386@yahoo.com.ar> --- .../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 <vmlinuz386@yahoo.com.ar> --- .../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 <vmlinuz386@yahoo.com.ar> --- .../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 <vmlinuz386@yahoo.com.ar> > --- > .../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 <vmlinuz386@yahoo.com.ar> >> --- >> .../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 <vmlinuz386@yahoo.com.ar> >>> --- >>> .../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 <vmlinuz386@yahoo.com.ar> >>>> --- >>>> .../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 <vmlinuz386@yahoo.com.ar> >>>>> --- >>>>> .../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