Make-initrd development discussion
 help / color / mirror / Atom feed
* [make-initrd] [PATCH v1 00/41] fork pipeline
@ 2021-09-24 15:52 Leonid Krivoshein
  2021-09-24 16:56 ` Alexey Gladkov
  2021-09-24 19:08 ` Alexey Gladkov
  0 siblings, 2 replies; 16+ messages in thread
From: Leonid Krivoshein @ 2021-09-24 15:52 UTC (permalink / raw)
  To: make-initrd

Привет!


На первой итерации, чтобы не флудить, сделал поменьше коммитов. Всё 
равно вспомнить "что за чем менялось" уже невозможно. На следующих 
итерациях постараюсь сделать это более понятным. Поэтому первые три 
коммита позволяют понять порядок перемещения, переименования и что 
создано нового. Заранее извиняюсь за порядок и оформление коммитов, 
готов исправиться.


Leonid Krivoshein (41):
   fork pipeline: split into 4 features (move files)
   fork pipeline: 11 files and directories renamed
   fork pipeline: 10 new files added
   fork pipeline: getimage cmdline parameter moved
   fork pipeline: waitdev cmdline parameter moved
   fork pipeline: bootchained is a 100% copy of pipelined
   fork pipeline: bootchain-core cmdline parameters added
   fork pipeline: getimage step modified
   fork pipeline: bootchain-waitdev cmdline parameter added
   fork pipeline: initrd boot method changed to bootchain
   fork pipeline: mountfs step modified
   fork pipeline: overlayfs step modified
   fork pipeline: rootfs step modified
   fork pipeline: waitdev: config.mk and rules.mk modified
   fork pipeline: waitdev: uevent filter renamed
   fork pipeline: waitdev: get_dev_wpfx() function added
   fork pipeline: waitdev step modified
   fork pipeline: waitdev: infinite loop fixed, DEVNAME added
   fork pipeline: waitdev: use optional waitdev_timeout
   fork pipeline: bootchain now is dependency for pipeline
   fork pipeline: bootchain sysvinit script now use external hooks
   fork pipeline: README.md for bootchain-core added
   fork pipeline: daemon splitted into first and second halfs
   bootchained: startup message
   fork pipeline: bootchained modified
   fork pipeline: bootchain-sh-functions: whitespaces
   fork pipeline: bootchain-sh-functions modified
   fork pipeline: bootchain-sh-functions: check_parameter modified
   fork pipeline: bootchain-sh-functions: resolve_target modified
   fork pipeline: bootchain-sh-functions: API extended
   fork pipeline: bootchain-loop: pipenum to stepnum renamed
   fork pipeline: bootchain-loop: pipe to chainsteps renamed
   fork pipeline: bootchain-loop: primary changes
   fork pipeline: bootchain-loop: cleanup, testing and debugging
   fork pipeline: bootchain-loop: added switch to foreground
   fork pipeline: bootchain-loop: added 'noop' to separate the steps
   fork pipeline: bootchain-loop: added switch retry/noretry
   added symlinks for compatibility with pipeline
   workaround: use PUT_FILES= instead PUT_UDEV_RULES=
   to use has_feture() require initrd-sh-functions
   2.24.1-alt1

  make-initrd.spec                              |   5 +-
  make-initrd/features/bootchain-core/README.md |   3 +
  make-initrd/features/bootchain-core/config.mk |   5 +
  .../data/bin/bootchain-sh-functions           | 187 ++++++++++++++++++
  .../bootchain-core/data/bin/machine-info      | 123 ++++++++++++
  .../data/etc/initrd/cmdline.d/bootchain-core  |   6 +
  .../data/etc/rc.d/init.d/bootchain}           |  33 ++--
  .../bootchain-core/data/lib/bootchain/debug   |  84 ++++++++
  .../data/lib/bootchain}/mountfs               |   4 +-
  .../data/lib/bootchain/overlayfs              |  27 +++
  .../bootchain-core/data/lib/bootchain/rootfs  |  11 ++
  .../data/lib/initrd/cmdline.d/bootchain       |   6 +
  .../data/lib/initrd/cmdline.d/pipeline        |   2 +-
  .../features/bootchain-core/data/lib/pipeline |   1 +
  .../bootchain-core/data/sbin/bootchain-logvt  |  36 ++++
  .../bootchain-core/data/sbin/bootchain-loop   | 183 +++++++++++++++++
  .../bootchain-core/data/sbin/bootchained      |  55 ++++++
  .../data/sbin/pipeline-sh-functions           |   1 +
  make-initrd/features/bootchain-core/rules.mk  |   3 +
  .../features/bootchain-getimage/README.md     |  20 ++
  .../features/bootchain-getimage/config.mk     |   5 +
  .../etc/initrd/cmdline.d/bootchain-getimage   |   1 +
  .../data/lib/bootchain}/getimage              |   9 +-
  .../features/bootchain-getimage/rules.mk      |   2 +
  .../features/bootchain-waitdev/README.md      |  21 ++
  .../features/bootchain-waitdev/config.mk      |   6 +
  .../etc/initrd/cmdline.d/bootchain-waitdev    |   2 +
  .../udev/rules.d/50-bootchain-waitdev.rules}  |   2 +-
  .../data/lib/bootchain-prepare.d/300-waitdev  |  12 ++
  .../data/lib/bootchain/waitdev                |  46 +++++
  .../data/lib/uevent/filters/bootchain-waitdev |  35 ++++
  .../features/bootchain-waitdev/rules.mk       |   2 +
  make-initrd/features/pipeline/config.mk       |   9 +-
  .../data/etc/initrd/cmdline.d/pipeline        |   5 -
  .../pipeline/data/lib/pipeline/overlayfs      |  26 ---
  .../pipeline/data/lib/pipeline/rootfs         |  10 -
  .../pipeline/data/lib/pipeline/waitdev        |  24 ---
  .../data/lib/uevent/filters/pipeline-waitdev  |  18 --
  .../pipeline/data/sbin/pipeline-sh-functions  |  51 -----
  .../features/pipeline/data/sbin/pipelined     |  87 --------
  make-initrd/features/pipeline/rules.mk        |   6 -
  41 files changed, 914 insertions(+), 260 deletions(-)
  create mode 100644 make-initrd/features/bootchain-core/README.md
  create mode 100644 make-initrd/features/bootchain-core/config.mk
  create mode 100644 
make-initrd/features/bootchain-core/data/bin/bootchain-sh-functions
  create mode 100755 
make-initrd/features/bootchain-core/data/bin/machine-info
  create mode 100644 
make-initrd/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core
  rename make-initrd/features/{pipeline/data/etc/rc.d/init.d/pipeline => 
bootchain-core/data/etc/rc.d/init.d/bootchain} (59%)
  create mode 100755 
make-initrd/features/bootchain-core/data/lib/bootchain/debug
  rename make-initrd/features/{pipeline/data/lib/pipeline => 
bootchain-core/data/lib/bootchain}/mountfs (75%)
  create mode 100755 
make-initrd/features/bootchain-core/data/lib/bootchain/overlayfs
  create mode 100755 
make-initrd/features/bootchain-core/data/lib/bootchain/rootfs
  create mode 100755 
make-initrd/features/bootchain-core/data/lib/initrd/cmdline.d/bootchain
  rename make-initrd/features/{pipeline => 
bootchain-core}/data/lib/initrd/cmdline.d/pipeline (64%)
  create mode 120000 make-initrd/features/bootchain-core/data/lib/pipeline
  create mode 100755 
make-initrd/features/bootchain-core/data/sbin/bootchain-logvt
  create mode 100755 
make-initrd/features/bootchain-core/data/sbin/bootchain-loop
  create mode 100755 
make-initrd/features/bootchain-core/data/sbin/bootchained
  create mode 120000 
make-initrd/features/bootchain-core/data/sbin/pipeline-sh-functions
  create mode 100644 make-initrd/features/bootchain-core/rules.mk
  create mode 100644 make-initrd/features/bootchain-getimage/README.md
  create mode 100644 make-initrd/features/bootchain-getimage/config.mk
  create mode 100644 
make-initrd/features/bootchain-getimage/data/etc/initrd/cmdline.d/bootchain-getimage
  rename make-initrd/features/{pipeline/data/lib/pipeline => 
bootchain-getimage/data/lib/bootchain}/getimage (57%)
  create mode 100644 make-initrd/features/bootchain-getimage/rules.mk
  create mode 100644 make-initrd/features/bootchain-waitdev/README.md
  create mode 100644 make-initrd/features/bootchain-waitdev/config.mk
  create mode 100644 
make-initrd/features/bootchain-waitdev/data/etc/initrd/cmdline.d/bootchain-waitdev
  rename 
make-initrd/features/{pipeline/data/etc/udev/rules.d/50-pipeline-waitdev.rules 
=> bootchain-waitdev/data/etc/udev/rules.d/50-bootchain-waitdev.rules} (77%)
  create mode 100644 
make-initrd/features/bootchain-waitdev/data/lib/bootchain-prepare.d/300-waitdev
  create mode 100755 
make-initrd/features/bootchain-waitdev/data/lib/bootchain/waitdev
  create mode 100755 
make-initrd/features/bootchain-waitdev/data/lib/uevent/filters/bootchain-waitdev
  create mode 100644 make-initrd/features/bootchain-waitdev/rules.mk
  delete mode 100644 
make-initrd/features/pipeline/data/etc/initrd/cmdline.d/pipeline
  delete mode 100755 
make-initrd/features/pipeline/data/lib/pipeline/overlayfs
  delete mode 100755 make-initrd/features/pipeline/data/lib/pipeline/rootfs
  delete mode 100755 make-initrd/features/pipeline/data/lib/pipeline/waitdev
  delete mode 100755 
make-initrd/features/pipeline/data/lib/uevent/filters/pipeline-waitdev
  delete mode 100644 
make-initrd/features/pipeline/data/sbin/pipeline-sh-functions
  delete mode 100755 make-initrd/features/pipeline/data/sbin/pipelined

-- 
2.21.0




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-24 15:52 [make-initrd] [PATCH v1 00/41] fork pipeline Leonid Krivoshein
@ 2021-09-24 16:56 ` Alexey Gladkov
  2021-09-24 18:42   ` Leonid Krivoshein
  2021-09-24 19:08 ` Alexey Gladkov
  1 sibling, 1 reply; 16+ messages in thread
From: Alexey Gladkov @ 2021-09-24 16:56 UTC (permalink / raw)
  To: make-initrd

On Fri, Sep 24, 2021 at 06:52:40PM +0300, Leonid Krivoshein wrote:
> Привет!
> 
> 
> На первой итерации, чтобы не флудить, сделал поменьше коммитов. Всё равно
> вспомнить "что за чем менялось" уже невозможно. На следующих итерациях
> постараюсь сделать это более понятным. Поэтому первые три коммита позволяют
> понять порядок перемещения, переименования и что создано нового. Заранее
> извиняюсь за порядок и оформление коммитов, готов исправиться.
> 
> 
> Leonid Krivoshein (41):
>   fork pipeline: split into 4 features (move files)
>   fork pipeline: 11 files and directories renamed
>   fork pipeline: 10 new files added
>   fork pipeline: getimage cmdline parameter moved
>   fork pipeline: waitdev cmdline parameter moved
>   fork pipeline: bootchained is a 100% copy of pipelined
>   fork pipeline: bootchain-core cmdline parameters added
>   fork pipeline: getimage step modified
>   fork pipeline: bootchain-waitdev cmdline parameter added
>   fork pipeline: initrd boot method changed to bootchain
>   fork pipeline: mountfs step modified
>   fork pipeline: overlayfs step modified
>   fork pipeline: rootfs step modified
>   fork pipeline: waitdev: config.mk and rules.mk modified
>   fork pipeline: waitdev: uevent filter renamed
>   fork pipeline: waitdev: get_dev_wpfx() function added
>   fork pipeline: waitdev step modified
>   fork pipeline: waitdev: infinite loop fixed, DEVNAME added
>   fork pipeline: waitdev: use optional waitdev_timeout
>   fork pipeline: bootchain now is dependency for pipeline
>   fork pipeline: bootchain sysvinit script now use external hooks
>   fork pipeline: README.md for bootchain-core added
>   fork pipeline: daemon splitted into first and second halfs
>   bootchained: startup message
>   fork pipeline: bootchained modified
>   fork pipeline: bootchain-sh-functions: whitespaces
>   fork pipeline: bootchain-sh-functions modified
>   fork pipeline: bootchain-sh-functions: check_parameter modified
>   fork pipeline: bootchain-sh-functions: resolve_target modified
>   fork pipeline: bootchain-sh-functions: API extended
>   fork pipeline: bootchain-loop: pipenum to stepnum renamed
>   fork pipeline: bootchain-loop: pipe to chainsteps renamed
>   fork pipeline: bootchain-loop: primary changes
>   fork pipeline: bootchain-loop: cleanup, testing and debugging
>   fork pipeline: bootchain-loop: added switch to foreground
>   fork pipeline: bootchain-loop: added 'noop' to separate the steps
>   fork pipeline: bootchain-loop: added switch retry/noretry
>   added symlinks for compatibility with pipeline
>   workaround: use PUT_FILES= instead PUT_UDEV_RULES=
>   to use has_feture() require initrd-sh-functions
>   2.24.1-alt1
> 
>  make-initrd.spec                              |   5 +-
>  make-initrd/features/bootchain-core/README.md |   3 +

Ты сделал патчи на пакет вместо апстримного кода. Спасибо gear я не
разрабатываю make-initrd в альтовом репозитории.

На первых итерациях это не имеет значения, но потом я прошу переделать.

Если что, апстрим тут:

https://github.com/osboot/make-initrd

>  make-initrd/features/bootchain-core/config.mk |   5 +
>  .../data/bin/bootchain-sh-functions           | 187 ++++++++++++++++++
>  .../bootchain-core/data/bin/machine-info      | 123 ++++++++++++
>  .../data/etc/initrd/cmdline.d/bootchain-core  |   6 +
>  .../data/etc/rc.d/init.d/bootchain}           |  33 ++--
>  .../bootchain-core/data/lib/bootchain/debug   |  84 ++++++++
>  .../data/lib/bootchain}/mountfs               |   4 +-
>  .../data/lib/bootchain/overlayfs              |  27 +++
>  .../bootchain-core/data/lib/bootchain/rootfs  |  11 ++
>  .../data/lib/initrd/cmdline.d/bootchain       |   6 +
>  .../data/lib/initrd/cmdline.d/pipeline        |   2 +-
>  .../features/bootchain-core/data/lib/pipeline |   1 +
>  .../bootchain-core/data/sbin/bootchain-logvt  |  36 ++++
>  .../bootchain-core/data/sbin/bootchain-loop   | 183 +++++++++++++++++
>  .../bootchain-core/data/sbin/bootchained      |  55 ++++++
>  .../data/sbin/pipeline-sh-functions           |   1 +
>  make-initrd/features/bootchain-core/rules.mk  |   3 +
>  .../features/bootchain-getimage/README.md     |  20 ++
>  .../features/bootchain-getimage/config.mk     |   5 +
>  .../etc/initrd/cmdline.d/bootchain-getimage   |   1 +
>  .../data/lib/bootchain}/getimage              |   9 +-
>  .../features/bootchain-getimage/rules.mk      |   2 +
>  .../features/bootchain-waitdev/README.md      |  21 ++
>  .../features/bootchain-waitdev/config.mk      |   6 +
>  .../etc/initrd/cmdline.d/bootchain-waitdev    |   2 +
>  .../udev/rules.d/50-bootchain-waitdev.rules}  |   2 +-
>  .../data/lib/bootchain-prepare.d/300-waitdev  |  12 ++
>  .../data/lib/bootchain/waitdev                |  46 +++++
>  .../data/lib/uevent/filters/bootchain-waitdev |  35 ++++
>  .../features/bootchain-waitdev/rules.mk       |   2 +
>  make-initrd/features/pipeline/config.mk       |   9 +-
>  .../data/etc/initrd/cmdline.d/pipeline        |   5 -
>  .../pipeline/data/lib/pipeline/overlayfs      |  26 ---
>  .../pipeline/data/lib/pipeline/rootfs         |  10 -
>  .../pipeline/data/lib/pipeline/waitdev        |  24 ---
>  .../data/lib/uevent/filters/pipeline-waitdev  |  18 --
>  .../pipeline/data/sbin/pipeline-sh-functions  |  51 -----
>  .../features/pipeline/data/sbin/pipelined     |  87 --------
>  make-initrd/features/pipeline/rules.mk        |   6 -
>  41 files changed, 914 insertions(+), 260 deletions(-)
>  create mode 100644 make-initrd/features/bootchain-core/README.md
>  create mode 100644 make-initrd/features/bootchain-core/config.mk
>  create mode 100644
> make-initrd/features/bootchain-core/data/bin/bootchain-sh-functions
>  create mode 100755
> make-initrd/features/bootchain-core/data/bin/machine-info
>  create mode 100644
> make-initrd/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core
>  rename make-initrd/features/{pipeline/data/etc/rc.d/init.d/pipeline =>
> bootchain-core/data/etc/rc.d/init.d/bootchain} (59%)
>  create mode 100755
> make-initrd/features/bootchain-core/data/lib/bootchain/debug
>  rename make-initrd/features/{pipeline/data/lib/pipeline =>
> bootchain-core/data/lib/bootchain}/mountfs (75%)
>  create mode 100755
> make-initrd/features/bootchain-core/data/lib/bootchain/overlayfs
>  create mode 100755
> make-initrd/features/bootchain-core/data/lib/bootchain/rootfs
>  create mode 100755
> make-initrd/features/bootchain-core/data/lib/initrd/cmdline.d/bootchain
>  rename make-initrd/features/{pipeline =>
> bootchain-core}/data/lib/initrd/cmdline.d/pipeline (64%)
>  create mode 120000 make-initrd/features/bootchain-core/data/lib/pipeline
>  create mode 100755
> make-initrd/features/bootchain-core/data/sbin/bootchain-logvt
>  create mode 100755
> make-initrd/features/bootchain-core/data/sbin/bootchain-loop
>  create mode 100755
> make-initrd/features/bootchain-core/data/sbin/bootchained
>  create mode 120000
> make-initrd/features/bootchain-core/data/sbin/pipeline-sh-functions
>  create mode 100644 make-initrd/features/bootchain-core/rules.mk
>  create mode 100644 make-initrd/features/bootchain-getimage/README.md
>  create mode 100644 make-initrd/features/bootchain-getimage/config.mk
>  create mode 100644 make-initrd/features/bootchain-getimage/data/etc/initrd/cmdline.d/bootchain-getimage
>  rename make-initrd/features/{pipeline/data/lib/pipeline =>
> bootchain-getimage/data/lib/bootchain}/getimage (57%)
>  create mode 100644 make-initrd/features/bootchain-getimage/rules.mk
>  create mode 100644 make-initrd/features/bootchain-waitdev/README.md
>  create mode 100644 make-initrd/features/bootchain-waitdev/config.mk
>  create mode 100644 make-initrd/features/bootchain-waitdev/data/etc/initrd/cmdline.d/bootchain-waitdev
>  rename make-initrd/features/{pipeline/data/etc/udev/rules.d/50-pipeline-waitdev.rules
> => bootchain-waitdev/data/etc/udev/rules.d/50-bootchain-waitdev.rules} (77%)
>  create mode 100644 make-initrd/features/bootchain-waitdev/data/lib/bootchain-prepare.d/300-waitdev
>  create mode 100755
> make-initrd/features/bootchain-waitdev/data/lib/bootchain/waitdev
>  create mode 100755 make-initrd/features/bootchain-waitdev/data/lib/uevent/filters/bootchain-waitdev
>  create mode 100644 make-initrd/features/bootchain-waitdev/rules.mk
>  delete mode 100644
> make-initrd/features/pipeline/data/etc/initrd/cmdline.d/pipeline
>  delete mode 100755
> make-initrd/features/pipeline/data/lib/pipeline/overlayfs
>  delete mode 100755 make-initrd/features/pipeline/data/lib/pipeline/rootfs
>  delete mode 100755 make-initrd/features/pipeline/data/lib/pipeline/waitdev
>  delete mode 100755
> make-initrd/features/pipeline/data/lib/uevent/filters/pipeline-waitdev
>  delete mode 100644
> make-initrd/features/pipeline/data/sbin/pipeline-sh-functions
>  delete mode 100755 make-initrd/features/pipeline/data/sbin/pipelined
> 
> -- 
> 2.21.0
> 
> 
> _______________________________________________
> Make-initrd mailing list
> Make-initrd@lists.altlinux.org
> https://lists.altlinux.org/mailman/listinfo/make-initrd

-- 
Rgrds, legion



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-24 16:56 ` Alexey Gladkov
@ 2021-09-24 18:42   ` Leonid Krivoshein
  2021-09-24 19:06     ` Alexey Gladkov
  0 siblings, 1 reply; 16+ messages in thread
From: Leonid Krivoshein @ 2021-09-24 18:42 UTC (permalink / raw)
  To: make-initrd


24.09.2021 19:56, Alexey Gladkov пишет:
> [...]
> Ты сделал патчи на пакет вместо апстримного кода. Спасибо gear я не
> разрабатываю make-initrd в альтовом репозитории.
>
> На первых итерациях это не имеет значения, но потом я прошу переделать.

Понял, со второй итерации буду брать за основу дерево с github:

> Если что, апстрим тут:
>
> https://github.com/osboot/make-initrd

Но как мне с этим проверять, что оно не развалилось и не разъехалось? 
Ведь вторую часть я собираю через gear. Есть какой-то простой путь 
сборки из нескольких источников? Я просто не очень хорошо этим владею. 
Или будем исправлять уже пост-фактум, если поломается?


-- 
Best regards,
Leonid Krivoshein.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-24 18:42   ` Leonid Krivoshein
@ 2021-09-24 19:06     ` Alexey Gladkov
  2021-09-26 18:56       ` Leonid Krivoshein
  0 siblings, 1 reply; 16+ messages in thread
From: Alexey Gladkov @ 2021-09-24 19:06 UTC (permalink / raw)
  To: make-initrd

On Fri, Sep 24, 2021 at 09:42:38PM +0300, Leonid Krivoshein wrote:
> 
> 24.09.2021 19:56, Alexey Gladkov пишет:
> > [...]
> > Ты сделал патчи на пакет вместо апстримного кода. Спасибо gear я не
> > разрабатываю make-initrd в альтовом репозитории.
> > 
> > На первых итерациях это не имеет значения, но потом я прошу переделать.
> 
> Понял, со второй итерации буду брать за основу дерево с github:
> 
> > Если что, апстрим тут:
> > 
> > https://github.com/osboot/make-initrd
> 
> Но как мне с этим проверять, что оно не развалилось и не разъехалось? Ведь
> вторую часть я собираю через gear. Есть какой-то простой путь сборки из
> нескольких источников? Я просто не очень хорошо этим владею. Или будем
> исправлять уже пост-фактум, если поломается?

Тогда тебе наверное будет проще сначала сделать на gear и потом применить
их к github.

Я обычно разрабатываю и тестирую in-tree (для этого есть специальная
опция configure), но в моём случае не нужно собирать пакеты.

-- 
Rgrds, legion



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-24 15:52 [make-initrd] [PATCH v1 00/41] fork pipeline Leonid Krivoshein
  2021-09-24 16:56 ` Alexey Gladkov
@ 2021-09-24 19:08 ` Alexey Gladkov
  2021-09-24 21:59   ` Leonid Krivoshein
  1 sibling, 1 reply; 16+ messages in thread
From: Alexey Gladkov @ 2021-09-24 19:08 UTC (permalink / raw)
  To: make-initrd

On Fri, Sep 24, 2021 at 06:52:40PM +0300, Leonid Krivoshein wrote:
> Привет!
> 
> 
> На первой итерации, чтобы не флудить, сделал поменьше коммитов. Всё равно
> вспомнить "что за чем менялось" уже невозможно. На следующих итерациях
> постараюсь сделать это более понятным. Поэтому первые три коммита позволяют
> понять порядок перемещения, переименования и что создано нового. Заранее
> извиняюсь за порядок и оформление коммитов, готов исправиться.

Я начал читать, но так как кода очень много не успею за один день всё
осилить. Я буду ещё комментировать.

> 
> Leonid Krivoshein (41):
>   fork pipeline: split into 4 features (move files)
>   fork pipeline: 11 files and directories renamed
>   fork pipeline: 10 new files added
>   fork pipeline: getimage cmdline parameter moved
>   fork pipeline: waitdev cmdline parameter moved
>   fork pipeline: bootchained is a 100% copy of pipelined
>   fork pipeline: bootchain-core cmdline parameters added
>   fork pipeline: getimage step modified
>   fork pipeline: bootchain-waitdev cmdline parameter added
>   fork pipeline: initrd boot method changed to bootchain
>   fork pipeline: mountfs step modified
>   fork pipeline: overlayfs step modified
>   fork pipeline: rootfs step modified
>   fork pipeline: waitdev: config.mk and rules.mk modified
>   fork pipeline: waitdev: uevent filter renamed
>   fork pipeline: waitdev: get_dev_wpfx() function added
>   fork pipeline: waitdev step modified
>   fork pipeline: waitdev: infinite loop fixed, DEVNAME added
>   fork pipeline: waitdev: use optional waitdev_timeout
>   fork pipeline: bootchain now is dependency for pipeline
>   fork pipeline: bootchain sysvinit script now use external hooks
>   fork pipeline: README.md for bootchain-core added
>   fork pipeline: daemon splitted into first and second halfs
>   bootchained: startup message
>   fork pipeline: bootchained modified
>   fork pipeline: bootchain-sh-functions: whitespaces
>   fork pipeline: bootchain-sh-functions modified
>   fork pipeline: bootchain-sh-functions: check_parameter modified
>   fork pipeline: bootchain-sh-functions: resolve_target modified
>   fork pipeline: bootchain-sh-functions: API extended
>   fork pipeline: bootchain-loop: pipenum to stepnum renamed
>   fork pipeline: bootchain-loop: pipe to chainsteps renamed
>   fork pipeline: bootchain-loop: primary changes
>   fork pipeline: bootchain-loop: cleanup, testing and debugging
>   fork pipeline: bootchain-loop: added switch to foreground
>   fork pipeline: bootchain-loop: added 'noop' to separate the steps
>   fork pipeline: bootchain-loop: added switch retry/noretry
>   added symlinks for compatibility with pipeline
>   workaround: use PUT_FILES= instead PUT_UDEV_RULES=
>   to use has_feture() require initrd-sh-functions
>   2.24.1-alt1
> 
>  make-initrd.spec                              |   5 +-
>  make-initrd/features/bootchain-core/README.md |   3 +
>  make-initrd/features/bootchain-core/config.mk |   5 +
>  .../data/bin/bootchain-sh-functions           | 187 ++++++++++++++++++
>  .../bootchain-core/data/bin/machine-info      | 123 ++++++++++++
>  .../data/etc/initrd/cmdline.d/bootchain-core  |   6 +
>  .../data/etc/rc.d/init.d/bootchain}           |  33 ++--
>  .../bootchain-core/data/lib/bootchain/debug   |  84 ++++++++
>  .../data/lib/bootchain}/mountfs               |   4 +-
>  .../data/lib/bootchain/overlayfs              |  27 +++
>  .../bootchain-core/data/lib/bootchain/rootfs  |  11 ++
>  .../data/lib/initrd/cmdline.d/bootchain       |   6 +
>  .../data/lib/initrd/cmdline.d/pipeline        |   2 +-
>  .../features/bootchain-core/data/lib/pipeline |   1 +
>  .../bootchain-core/data/sbin/bootchain-logvt  |  36 ++++
>  .../bootchain-core/data/sbin/bootchain-loop   | 183 +++++++++++++++++
>  .../bootchain-core/data/sbin/bootchained      |  55 ++++++
>  .../data/sbin/pipeline-sh-functions           |   1 +
>  make-initrd/features/bootchain-core/rules.mk  |   3 +
>  .../features/bootchain-getimage/README.md     |  20 ++
>  .../features/bootchain-getimage/config.mk     |   5 +
>  .../etc/initrd/cmdline.d/bootchain-getimage   |   1 +
>  .../data/lib/bootchain}/getimage              |   9 +-
>  .../features/bootchain-getimage/rules.mk      |   2 +
>  .../features/bootchain-waitdev/README.md      |  21 ++
>  .../features/bootchain-waitdev/config.mk      |   6 +
>  .../etc/initrd/cmdline.d/bootchain-waitdev    |   2 +
>  .../udev/rules.d/50-bootchain-waitdev.rules}  |   2 +-
>  .../data/lib/bootchain-prepare.d/300-waitdev  |  12 ++
>  .../data/lib/bootchain/waitdev                |  46 +++++
>  .../data/lib/uevent/filters/bootchain-waitdev |  35 ++++
>  .../features/bootchain-waitdev/rules.mk       |   2 +
>  make-initrd/features/pipeline/config.mk       |   9 +-
>  .../data/etc/initrd/cmdline.d/pipeline        |   5 -
>  .../pipeline/data/lib/pipeline/overlayfs      |  26 ---
>  .../pipeline/data/lib/pipeline/rootfs         |  10 -
>  .../pipeline/data/lib/pipeline/waitdev        |  24 ---
>  .../data/lib/uevent/filters/pipeline-waitdev  |  18 --
>  .../pipeline/data/sbin/pipeline-sh-functions  |  51 -----
>  .../features/pipeline/data/sbin/pipelined     |  87 --------
>  make-initrd/features/pipeline/rules.mk        |   6 -
>  41 files changed, 914 insertions(+), 260 deletions(-)
>  create mode 100644 make-initrd/features/bootchain-core/README.md
>  create mode 100644 make-initrd/features/bootchain-core/config.mk
>  create mode 100644
> make-initrd/features/bootchain-core/data/bin/bootchain-sh-functions
>  create mode 100755
> make-initrd/features/bootchain-core/data/bin/machine-info
>  create mode 100644
> make-initrd/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core
>  rename make-initrd/features/{pipeline/data/etc/rc.d/init.d/pipeline =>
> bootchain-core/data/etc/rc.d/init.d/bootchain} (59%)
>  create mode 100755
> make-initrd/features/bootchain-core/data/lib/bootchain/debug
>  rename make-initrd/features/{pipeline/data/lib/pipeline =>
> bootchain-core/data/lib/bootchain}/mountfs (75%)
>  create mode 100755
> make-initrd/features/bootchain-core/data/lib/bootchain/overlayfs
>  create mode 100755
> make-initrd/features/bootchain-core/data/lib/bootchain/rootfs
>  create mode 100755
> make-initrd/features/bootchain-core/data/lib/initrd/cmdline.d/bootchain
>  rename make-initrd/features/{pipeline =>
> bootchain-core}/data/lib/initrd/cmdline.d/pipeline (64%)
>  create mode 120000 make-initrd/features/bootchain-core/data/lib/pipeline
>  create mode 100755
> make-initrd/features/bootchain-core/data/sbin/bootchain-logvt
>  create mode 100755
> make-initrd/features/bootchain-core/data/sbin/bootchain-loop
>  create mode 100755
> make-initrd/features/bootchain-core/data/sbin/bootchained
>  create mode 120000
> make-initrd/features/bootchain-core/data/sbin/pipeline-sh-functions
>  create mode 100644 make-initrd/features/bootchain-core/rules.mk
>  create mode 100644 make-initrd/features/bootchain-getimage/README.md
>  create mode 100644 make-initrd/features/bootchain-getimage/config.mk
>  create mode 100644 make-initrd/features/bootchain-getimage/data/etc/initrd/cmdline.d/bootchain-getimage
>  rename make-initrd/features/{pipeline/data/lib/pipeline =>
> bootchain-getimage/data/lib/bootchain}/getimage (57%)
>  create mode 100644 make-initrd/features/bootchain-getimage/rules.mk
>  create mode 100644 make-initrd/features/bootchain-waitdev/README.md
>  create mode 100644 make-initrd/features/bootchain-waitdev/config.mk
>  create mode 100644 make-initrd/features/bootchain-waitdev/data/etc/initrd/cmdline.d/bootchain-waitdev
>  rename make-initrd/features/{pipeline/data/etc/udev/rules.d/50-pipeline-waitdev.rules
> => bootchain-waitdev/data/etc/udev/rules.d/50-bootchain-waitdev.rules} (77%)
>  create mode 100644 make-initrd/features/bootchain-waitdev/data/lib/bootchain-prepare.d/300-waitdev
>  create mode 100755
> make-initrd/features/bootchain-waitdev/data/lib/bootchain/waitdev
>  create mode 100755 make-initrd/features/bootchain-waitdev/data/lib/uevent/filters/bootchain-waitdev
>  create mode 100644 make-initrd/features/bootchain-waitdev/rules.mk
>  delete mode 100644
> make-initrd/features/pipeline/data/etc/initrd/cmdline.d/pipeline
>  delete mode 100755
> make-initrd/features/pipeline/data/lib/pipeline/overlayfs
>  delete mode 100755 make-initrd/features/pipeline/data/lib/pipeline/rootfs
>  delete mode 100755 make-initrd/features/pipeline/data/lib/pipeline/waitdev
>  delete mode 100755
> make-initrd/features/pipeline/data/lib/uevent/filters/pipeline-waitdev
>  delete mode 100644
> make-initrd/features/pipeline/data/sbin/pipeline-sh-functions
>  delete mode 100755 make-initrd/features/pipeline/data/sbin/pipelined
> 
> -- 
> 2.21.0
> 
> 
> _______________________________________________
> Make-initrd mailing list
> Make-initrd@lists.altlinux.org
> https://lists.altlinux.org/mailman/listinfo/make-initrd

-- 
Rgrds, legion



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-24 19:08 ` Alexey Gladkov
@ 2021-09-24 21:59   ` Leonid Krivoshein
  2021-09-26 14:29     ` Alexey Gladkov
  0 siblings, 1 reply; 16+ messages in thread
From: Leonid Krivoshein @ 2021-09-24 21:59 UTC (permalink / raw)
  To: make-initrd

[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]


24.09.2021 22:08, Alexey Gladkov пишет:
>> На первой итерации, чтобы не флудить, сделал поменьше коммитов. Всё равно
>> вспомнить "что за чем менялось" уже невозможно. На следующих итерациях
>> постараюсь сделать это более понятным. Поэтому первые три коммита позволяют
>> понять порядок перемещения, переименования и что создано нового. Заранее
>> извиняюсь за порядок и оформление коммитов, готов исправиться.
> Я начал читать, но так как кода очень много не успею за один день всё
> осилить. Я буду ещё комментировать.

Да это понятно, смотри, по возможности. А я тут подумал, что bootchain 
не просто же так форкался и переделывался, это не только демон и API -- 
основная часть его "клиентов" дойдёт до апстрима следом, но сейчас этого 
нет в удобном тебе виде. Может помочь черновик документации, что я 
выслал. Также прилагаю лог самой проблемной загрузки по FTP, сделанный в 
результате сегодняшней проверки отправленного в апстрим. Могу выслать 
такой же с локальной загрузкой, если надо. Где-то это может понять 
логику работы кода и подход к отладочным сообщениям. Ну и на вопросы 
буду рад ответить!


-- 
Best regards,
Leonid Krivoshein.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ftp.log --]
[-- Type: text/x-log; name="ftp.log", Size: 26554 bytes --]

[2021-09-24 17:23:33] bootchained: Starting server [INITRAMFS 2.24.0]...
[2021-09-24 17:23:33] bootchained: Booting with /proc/cmdline:
============================================================
BOOT_IMAGE=/boot/vmlinuz changedisk fastboot live root=bootchain bootchain=fg,altboot automatic=method:ftp,server:mirror.yandex.ru,directory:/altlinux-nightly/current/regular-rescue-latest-x86_64.iso bc_debug stagename=rescue nosplash
============================================================

[2021-09-24 17:23:33] bootchained: RUN: mkdir -p -- /dev/bootchain /.initrd/bootchain/passed
[2021-09-24 17:23:33] bootchained: RUN: mount -t tmpfs tmpfs /dev/bootchain
[2021-09-24 17:23:33] bootchain-loop: LET: callnum="0"
[2021-09-24 17:23:33] bootchain-loop: [0] Switching to foreground
[2021-09-24 17:23:33] bootchain-loop: LET: callnum_fg="1"
[2021-09-24 17:23:33] bootchain-loop: TTY2 will be activated after 2 seconds
[2021-09-24 17:23:34] bootchain-loop: LET: callnum="0"
[2021-09-24 17:23:34] bootchain-loop: RUN: mkdir -p -- /dev/bootchain/src/step0 /dev/bootchain/dst/step0
[2021-09-24 17:23:34] bootchain-loop: [0] Handler: /lib/bootchain/altboot
[2021-09-24 17:23:34] bootchain-loop: RUN: /lib/bootchain/debug
[2021-09-24 17:23:34] debug: debug for altboot [0] started
[2021-09-24 17:23:34] debug: PREV DIR: 
[2021-09-24 17:23:34] debug: Data DIR: /dev/bootchain/src/step0
[2021-09-24 17:23:34] debug: DEST DIR: /dev/bootchain/dst/step0
############################################################
[2021-09-24 17:23:34] debug: debug for altboot [0] finished
[2021-09-24 17:23:34] bootchain-loop: RUN: /lib/bootchain/altboot
[2021-09-24 17:23:34] altboot: [0] altboot started (automatic='method:ftp,server:mirror.yandex.ru,directory:/altlinux-nightly/current/regular-rescue-latest-x86_64.iso', stagename='rescue')
[2021-09-24 17:23:34] altboot: [0] WELCOME TEXT: 'Welcome to ALT!'
[2021-09-24 17:23:34] altboot: [0] DISTRIBUTION: 'ALT Workstation 10'
[2021-09-24 17:23:34] altboot: [0] ENTER: altboot_config
[2021-09-24 17:23:34] altboot: [0] RUN: ls -1 -- /lib/altboot/automatic.d/
[2021-09-24 17:23:34] altboot: [0] ENTER: use_hooks
[2021-09-24 17:23:34] altboot: [0] HOOKS: 'automatic.d'
[2021-09-24 17:23:34] altboot: [0] USING: 'automatic.d/directory'
[2021-09-24 17:23:34] altboot: [0] LEAVE: use_hooks
[2021-09-24 17:23:34] altboot: [0] ENTER: use_hooks
[2021-09-24 17:23:34] altboot: [0] HOOKS: 'add-methods.d'
[2021-09-24 17:23:34] altboot: [0] USING: 'add-methods.d/100-nfs'
[2021-09-24 17:23:34] altboot: [0] boot method registered: 'nfs'
[2021-09-24 17:23:34] altboot: [0] USING: 'add-methods.d/150-ftp'
[2021-09-24 17:23:34] altboot: [0] boot method registered: 'ftp'
[2021-09-24 17:23:34] altboot: [0] USING: 'add-methods.d/250-http'
[2021-09-24 17:23:34] altboot: [0] boot method registered: 'http'
[2021-09-24 17:23:34] altboot: [0] USING: 'add-methods.d/450-cifs'
[2021-09-24 17:23:34] altboot: [0] boot method registered: 'cifs'
[2021-09-24 17:23:34] altboot: [0] USING: 'add-methods.d/750-cdrom'
[2021-09-24 17:23:34] altboot: [0] boot method registered: 'cdrom'
[2021-09-24 17:23:34] altboot: [0] USING: 'add-methods.d/850-disk'
[2021-09-24 17:23:34] altboot: [0] boot method registered: 'disk'
[2021-09-24 17:23:34] altboot: [0] LEAVE: use_hooks
[2021-09-24 17:23:34] altboot: [0] RUN: ls -1 -- /lib/altboot/global-args.d/
[2021-09-24 17:23:34] altboot: [0] ENTER: use_hooks
[2021-09-24 17:23:34] altboot: [0] HOOKS: 'translate.d'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/050-overlays'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/070-lowmem'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/100-cifs'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/100-download'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/100-localdev'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/100-nfs'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/350-squashfs'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/520-liverw'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/550-liveboot'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/650-liverw'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/750-liveboot'
[2021-09-24 17:23:34] altboot: [0] USING: 'translate.d/950-liveboot'
[2021-09-24 17:23:34] altboot: [0] LEAVE: use_hooks
[2021-09-24 17:23:34] altboot: [0] BOOTCHAIN REPLACED: 'noretry,waitnet,download,iso9660,squashfs,liveboot,rootfs'
[2021-09-24 17:23:34] altboot: [0] LEAVE: altboot_config
[2021-09-24 17:23:34] altboot: [0] ENTER: use_hooks
[2021-09-24 17:23:34] altboot: [0] HOOKS: 'forget-args.d'
[2021-09-24 17:23:34] altboot: [0] USING: 'forget-args.d/100-altboot'
[2021-09-24 17:23:34] altboot: [0] LEAVE: use_hooks
[2021-09-24 17:23:35] altboot: [0] altboot steps configuration (/.initrd/bootchain/altboot.conf):
============================================================
ALTBOOT_OLDROOT=1
ALTBOOT_STEPS="waitnet download iso9660 squashfs liveboot"
ALTBOOT_DOWNLOAD0="method=ftp;to=TMPFS;server=mirror.yandex.ru;directory=/altlinux-nightly/current/regular-rescue-latest-x86_64.iso"
ALTBOOT_DOWNLOAD=1
ALTBOOT_LIVEBOOT0="stagename=rescue;method=ftp;flags=live_ro,rescue"
ALTBOOT_LIVEBOOT=1
ALTBOOT_SQUASHFS0="/rescue"
ALTBOOT_SQUASHFS=1
unset AUTOMATIC
unset STAGENAME
unset PROFILE
unset HASH
unset RESCUE
unset LIVE
unset LOWMEM
unset LIVE_RW
============================================================

[2021-09-24 17:23:35] altboot: [0] ENTER: bypass_results
[2021-09-24 17:23:35] altboot: [0] LEAVE: bypass_results
[2021-09-24 17:23:35] altboot: [0] altboot finished
[2021-09-24 17:23:35] bootchain-loop: chain will be reloaded by /.initrd/bootchain/bootchain.next:
============================================================
chainsteps="noretry,waitnet,download,iso9660,squashfs,liveboot,rootfs"
============================================================

[2021-09-24 17:23:35] bootchain-loop: RUN: rm -f -- /.initrd/bootchain/bootchain.next
[2021-09-24 17:23:35] bootchain-loop: remaining steps: noretry,waitnet,download,iso9660,squashfs,liveboot,rootfs
[2021-09-24 17:23:35] bootchain-loop: daemon will be stopped immediately after any step failure
[2021-09-24 17:23:35] bootchain-loop: remaining steps: waitnet,download,iso9660,squashfs,liveboot,rootfs
[2021-09-24 17:23:35] bootchain-loop: LET: callnum="0"
[2021-09-24 17:23:35] bootchain-loop: RUN: mkdir -p -- /dev/bootchain/src/step1 /dev/bootchain/dst/step1
[2021-09-24 17:23:35] bootchain-loop: [0] Handler: /lib/bootchain/waitnet
[2021-09-24 17:23:35] bootchain-loop: RUN: /lib/bootchain/debug
[2021-09-24 17:23:35] debug: debug for waitnet [0] started
[2021-09-24 17:23:35] debug: PREV DIR: /dev/bootchain/dst/step0
[2021-09-24 17:23:35] debug: Data DIR: /dev/bootchain/src/step1
[2021-09-24 17:23:35] debug: DEST DIR: /dev/bootchain/dst/step1
##############################
Previous step results (/dev/bootchain/dst/step0):
##############################
[2021-09-24 17:23:35] debug: debug for waitnet [0] finished
[2021-09-24 17:23:35] bootchain-loop: RUN: /lib/bootchain/waitnet
[2021-09-24 17:23:35] waitnet: [0] waitnet started
[2021-09-24 17:23:35] waitnet: network settings not defined in /proc/cmdline
[2021-09-24 17:23:35] waitnet: network device eth0 ready to connection
[2021-09-24 17:23:35] waitnet: [0] ENTER: bypass_results
[2021-09-24 17:23:35] waitnet: [0] RUN: rmdir -- /dev/bootchain/dst/step1
[2021-09-24 17:23:35] waitnet: [0] RUN: mv -f -- /dev/bootchain/dst/step0 /dev/bootchain/dst/step1
[2021-09-24 17:23:35] waitnet: [0] LEAVE: bypass_results
[2021-09-24 17:23:35] waitnet: [0] waitnet finished
[2021-09-24 17:23:35] bootchain-loop: RUN: touch /.initrd/bootchain/passed/waitnet
[2021-09-24 17:23:35] bootchain-loop: LET: callnum_waitnet="1"
[2021-09-24 17:23:35] bootchain-loop: remaining steps: download,iso9660,squashfs,liveboot,rootfs
[2021-09-24 17:23:35] bootchain-loop: LET: callnum="0"
[2021-09-24 17:23:35] bootchain-loop: RUN: mkdir -p -- /dev/bootchain/src/step2 /dev/bootchain/dst/step2
[2021-09-24 17:23:35] bootchain-loop: [0] Handler: /lib/bootchain/download
[2021-09-24 17:23:35] bootchain-loop: RUN: /lib/bootchain/debug
[2021-09-24 17:23:35] debug: debug for download [0] started
[2021-09-24 17:23:35] debug: PREV DIR: /dev/bootchain/dst/step1
[2021-09-24 17:23:35] debug: Data DIR: /dev/bootchain/src/step2
[2021-09-24 17:23:35] debug: DEST DIR: /dev/bootchain/dst/step2
##############################
Previous step results (/dev/bootchain/dst/step1):
##############################
[2021-09-24 17:23:35] debug: debug for download [0] finished
[2021-09-24 17:23:35] bootchain-loop: RUN: /lib/bootchain/download
[2021-09-24 17:23:35] download: [0] ENTER: get_bootarg
[2021-09-24 17:23:35] download: [0] LET: to="TMPFS"
[2021-09-24 17:23:35] download: [0] LEAVE: get_bootarg
[2021-09-24 17:23:35] download: [0] ENTER: get_bootarg
[2021-09-24 17:23:35] download: [0] LET: method="ftp"
[2021-09-24 17:23:35] download: [0] LEAVE: get_bootarg
[2021-09-24 17:23:35] download: [0] ENTER: get_bootarg
[2021-09-24 17:23:35] download: [0] LET: url=""
[2021-09-24 17:23:35] download: [0] LEAVE: get_bootarg
[2021-09-24 17:23:35] download: [0] ENTER: get_bootarg
[2021-09-24 17:23:35] download: [0] LET: server="mirror.yandex.ru"
[2021-09-24 17:23:35] download: [0] LEAVE: get_bootarg
[2021-09-24 17:23:35] download: [0] ENTER: get_bootarg
[2021-09-24 17:23:35] download: [0] LET: directory="/altlinux-nightly/current/regular-rescue-latest-x86_64.iso"
[2021-09-24 17:23:35] download: [0] LEAVE: get_bootarg
[2021-09-24 17:23:35] download: [0] ENTER: get_bootarg
[2021-09-24 17:23:35] download: [0] LET: fuid=""
[2021-09-24 17:23:35] download: [0] LEAVE: get_bootarg
[2021-09-24 17:23:35] download: [0] ENTER: get_bootarg
[2021-09-24 17:23:35] download: [0] LET: user=""
[2021-09-24 17:23:35] download: [0] LEAVE: get_bootarg
[2021-09-24 17:23:35] download: [0] ENTER: get_bootarg
[2021-09-24 17:23:35] download: [0] LET: pass=""
[2021-09-24 17:23:35] download: [0] LEAVE: get_bootarg
[2021-09-24 17:23:35] download: [0] ENTER: get_bootarg
[2021-09-24 17:23:35] download: [0] LET: imgsize=""
[2021-09-24 17:23:35] download: [0] LEAVE: get_bootarg
[2021-09-24 17:23:35] download: [0] ENTER: get_bootarg
[2021-09-24 17:23:35] download: [0] LET: timeout=""
[2021-09-24 17:23:35] download: [0] LEAVE: get_bootarg
[2021-09-24 17:23:35] download: [0] download started (method=ftp;to=TMPFS;server=mirror.yandex.ru;directory=/altlinux-nightly/current/regular-rescue-latest-x86_64.iso)
[2021-09-24 17:23:35] download: [0] ENTER: get_file_size
[2021-09-24 17:23:35] download: retrieving image file size: 'ftp://mirror.yandex.ru/altlinux-nightly/current/regular-rescue-latest-x86_64.iso'
[2021-09-24 17:23:35] download: [0] RUN: mktemp -qt
[2021-09-24 17:23:35] download: [0] RUN: rm -f -- /tmp/tmp.wcubgZ
[2021-09-24 17:23:35] download: [0] RUN: curl -sI --no-buffer --connect-timeout 5 --max-time 7 --max-redirs 0 --write-out %{http_code} --ftp-pasv --output /tmp/tmp.wcubgZ --url ftp://mirror.yandex.ru/altlinux-nightly/current/regular-rescue-latest-x86_64.iso
============================================================
Last-Modified: Wed, 22 Sep 2021 05:37:55 GMT
Content-Length: 658132992
Accept-ranges: bytes
============================================================

[2021-09-24 17:23:36] download: [0] curl status: 0, protoclol status: 350
[2021-09-24 17:23:36] download: [0] RUN: rm -f -- /tmp/tmp.wcubgZ
[2021-09-24 17:23:36] download: [0] LEAVE: get_file_size
[2021-09-24 17:23:36] download: [0] ENTER: check_avail_space
[2021-09-24 17:23:36] download: available: 1816022 KiB, required: 642709 KiB
[2021-09-24 17:23:36] download: [0] LEAVE: check_avail_space
[2021-09-24 17:23:36] download: [0] ENTER: download_image
[2021-09-24 17:23:36] download: downloading image: 'ftp://mirror.yandex.ru/altlinux-nightly/current/regular-rescue-latest-x86_64.iso'
[2021-09-24 17:23:56] download: [0] LEAVE: download_image
[2021-09-24 17:23:56] download: [0] RUN: chmod -- 0600 /run/boot-image.iso
[2021-09-24 17:23:56] download: [0] ENTER: lomount
[2021-09-24 17:23:56] download: [0] RUN: losetup -Lrf --show -- /run/boot-image.iso
[2021-09-24 17:23:56] download: [0] losetup('/run/boot-image.iso') result: '/dev/loop0'
[2021-09-24 17:23:56] download: [0] LET: devname="/dev/loop0"
[2021-09-24 17:23:56] download: [0] LEAVE: lomount
[2021-09-24 17:23:56] download: [0] DEVNAME: /dev/loop0
[2021-09-24 17:23:56] download: [0] FILESIZE: 658132992
[2021-09-24 17:23:56] download: [0] RUN: cp -a -- /dev/loop0 /dev/bootchain/dst/step2/dev
[2021-09-24 17:23:56] download: [0] ENTER: stage2_getenv
[2021-09-24 17:23:56] download: [0] KEY: 'METHOD'
[2021-09-24 17:23:56] download: [0] LEAVE: stage2_getenv
[2021-09-24 17:23:56] download: [0] ENTER: stage2_setenv
[2021-09-24 17:23:56] download: [0] ARGS: METHOD="nfs"
[2021-09-24 17:23:56] download: [0] LEAVE: stage2_setenv
[2021-09-24 17:23:56] download: [0] ENTER: stage2_setenv
[2021-09-24 17:23:56] download: [0] ARGS: URL="ftp://mirror.yandex.ru/altlinux-nightly/current/regular-rescue-latest-x86_64.iso"
[2021-09-24 17:23:56] download: [0] LEAVE: stage2_setenv
[2021-09-24 17:23:56] download: [0] download finished
[2021-09-24 17:23:56] bootchain-loop: RUN: touch /.initrd/bootchain/passed/download
[2021-09-24 17:23:56] bootchain-loop: LET: callnum_download="1"
[2021-09-24 17:23:56] bootchain-loop: remaining steps: iso9660,squashfs,liveboot,rootfs
[2021-09-24 17:23:56] bootchain-loop: LET: callnum="0"
[2021-09-24 17:23:56] bootchain-loop: RUN: mkdir -p -- /dev/bootchain/src/step3 /dev/bootchain/dst/step3
[2021-09-24 17:23:56] bootchain-loop: [0] Handler: /lib/bootchain/iso9660
[2021-09-24 17:23:56] bootchain-loop: RUN: /lib/bootchain/debug
[2021-09-24 17:23:56] debug: debug for iso9660 [0] started
[2021-09-24 17:23:56] debug: PREV DIR: /dev/bootchain/dst/step2
[2021-09-24 17:23:56] debug: Data DIR: /dev/bootchain/src/step3
[2021-09-24 17:23:56] debug: DEST DIR: /dev/bootchain/dst/step3
##############################
Previous step results (/dev/bootchain/dst/step2):
dev (7:0 -> /dev/loop0)
DEVNAME (7:0 -> /dev/loop0)
FILESIZE (658132992)
##############################
[2021-09-24 17:23:56] debug: debug for iso9660 [0] finished
[2021-09-24 17:23:56] bootchain-loop: RUN: /lib/bootchain/iso9660
[2021-09-24 17:23:56] iso9660: [0] iso9660 started
[2021-09-24 17:23:56] iso9660: [0] RUN: mkdir -p -- /image
[2021-09-24 17:23:56] iso9660: [0] RUN: mount -t iso9660 -o ro -- /dev/loop0 /image
[2021-09-24 17:23:56] iso9660: [0] ENTER: bypass_results
[2021-09-24 17:23:56] iso9660: [0] RUN: rmdir -- /dev/bootchain/dst/step3
[2021-09-24 17:23:56] iso9660: [0] RUN: ln -snf -- /image /dev/bootchain/dst/step3
[2021-09-24 17:23:56] iso9660: [0] LEAVE: bypass_results
[2021-09-24 17:23:56] iso9660: [0] iso9660 finished
[2021-09-24 17:23:56] bootchain-loop: RUN: touch /.initrd/bootchain/passed/iso9660
[2021-09-24 17:23:56] bootchain-loop: LET: callnum_iso9660="1"
[2021-09-24 17:23:56] bootchain-loop: remaining steps: squashfs,liveboot,rootfs
[2021-09-24 17:23:56] bootchain-loop: LET: callnum="0"
[2021-09-24 17:23:56] bootchain-loop: RUN: mkdir -p -- /dev/bootchain/src/step4 /dev/bootchain/dst/step4
[2021-09-24 17:23:56] bootchain-loop: [0] Handler: /lib/bootchain/squashfs
[2021-09-24 17:23:56] bootchain-loop: RUN: /lib/bootchain/debug
[2021-09-24 17:23:56] debug: debug for squashfs [0] started
[2021-09-24 17:23:56] debug: PREV DIR: /image
[2021-09-24 17:23:56] debug: Data DIR: /dev/bootchain/src/step4
[2021-09-24 17:23:56] debug: DEST DIR: /dev/bootchain/dst/step4
##############################
Previous step results (/image):
2021-09-22-05-29-20-00
EFI/
boot/
docs/
license.all.html
license.ru.html
mediacheck
rescue
##############################
[2021-09-24 17:23:56] debug: debug for squashfs [0] finished
[2021-09-24 17:23:56] bootchain-loop: RUN: /lib/bootchain/squashfs
[2021-09-24 17:23:56] squashfs: [0] ENTER: get_bootarg
[2021-09-24 17:23:56] squashfs: [0] LET: SQUASHFS="/rescue"
[2021-09-24 17:23:56] squashfs: [0] LEAVE: get_bootarg
[2021-09-24 17:23:56] squashfs: [0] squashfs started (/rescue)
[2021-09-24 17:23:56] squashfs: [0] ENTER: lomount
[2021-09-24 17:23:56] squashfs: [0] RUN: losetup -Lrf --show -- /image/rescue
[2021-09-24 17:23:56] squashfs: [0] losetup('/image/rescue') result: '/dev/loop1'
[2021-09-24 17:23:56] squashfs: [0] LET: devname="/dev/loop1"
[2021-09-24 17:23:56] squashfs: [0] LEAVE: lomount
[2021-09-24 17:23:56] squashfs: [0] RUN: mount -t squashfs -r -- /dev/loop1 /root
[2021-09-24 17:23:56] squashfs: [0] ENTER: bypass_results
[2021-09-24 17:23:56] squashfs: [0] RUN: rmdir -- /dev/bootchain/dst/step4
[2021-09-24 17:23:56] squashfs: [0] RUN: ln -snf -- /root /dev/bootchain/dst/step4
[2021-09-24 17:23:56] squashfs: [0] LEAVE: bypass_results
[2021-09-24 17:23:56] squashfs: [0] squashfs finished
[2021-09-24 17:23:56] bootchain-loop: RUN: touch /.initrd/bootchain/passed/squashfs
[2021-09-24 17:23:56] bootchain-loop: LET: callnum_squashfs="1"
[2021-09-24 17:23:56] bootchain-loop: remaining steps: liveboot,rootfs
[2021-09-24 17:23:56] bootchain-loop: LET: callnum="0"
[2021-09-24 17:23:56] bootchain-loop: RUN: mkdir -p -- /dev/bootchain/src/step5 /dev/bootchain/dst/step5
[2021-09-24 17:23:56] bootchain-loop: [0] Handler: /lib/bootchain/liveboot
[2021-09-24 17:23:56] bootchain-loop: RUN: /lib/bootchain/debug
[2021-09-24 17:23:56] debug: debug for liveboot [0] started
[2021-09-24 17:23:56] debug: PREV DIR: /root
[2021-09-24 17:23:56] debug: Data DIR: /dev/bootchain/src/step5
[2021-09-24 17:23:56] debug: DEST DIR: /dev/bootchain/dst/step5
##############################
Previous step results (/root):
bin/
boot/
dev/
etc/
home/
image/
lib/
lib64/
libx32/
media/
mnt/
opt/
proc/
root/
run/
sbin/
selinux/
srv/
sys/
tmp/
##############################
[2021-09-24 17:23:56] debug: debug for liveboot [0] finished
[2021-09-24 17:23:56] bootchain-loop: RUN: /lib/bootchain/liveboot
[2021-09-24 17:23:56] liveboot: [0] ENTER: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] LET: stagename="rescue"
[2021-09-24 17:23:56] liveboot: [0] LEAVE: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] ENTER: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] LET: method="ftp"
[2021-09-24 17:23:56] liveboot: [0] LEAVE: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] ENTER: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] LET: directory=""
[2021-09-24 17:23:56] liveboot: [0] LEAVE: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] ENTER: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] LET: overlayroot=""
[2021-09-24 17:23:56] liveboot: [0] LEAVE: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] ENTER: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] LET: profile=""
[2021-09-24 17:23:56] liveboot: [0] LEAVE: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] ENTER: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] LET: overlays=""
[2021-09-24 17:23:56] liveboot: [0] LEAVE: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] ENTER: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] LET: flags="live_ro,rescue"
[2021-09-24 17:23:56] liveboot: [0] LEAVE: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] ENTER: get_bootarg
[2021-09-24 17:23:56] liveboot: [0] LET: timeout=""
[2021-09-24 17:23:56] liveboot: [0] LEAVE: get_bootarg
[2021-09-24 17:23:57] liveboot: [0] liveboot started (stagename=rescue;method=ftp;flags=live_ro,rescue)
[2021-09-24 17:23:57] liveboot: [0] ENTER: use_hooks
[2021-09-24 17:23:57] liveboot: [0] HOOKS: 'liveboot-init.d'
[2021-09-24 17:23:57] liveboot: [0] USING: 'liveboot-init.d/010-waitnet'
[2021-09-24 17:23:57] liveboot: [0] USING: 'liveboot-init.d/100-overlayroot'
[2021-09-24 17:23:57] liveboot: [0] USING: 'liveboot-init.d/400-liverw'
[2021-09-24 17:23:57] liveboot: [0] USING: 'liveboot-init.d/700-cifs'
[2021-09-24 17:23:57] liveboot: [0] USING: 'liveboot-init.d/700-nfs'
[2021-09-24 17:23:57] liveboot: [0] LEAVE: use_hooks
[2021-09-24 17:23:57] liveboot: running rescue
[2021-09-24 17:23:57] liveboot: [0] ENTER: use_hooks
[2021-09-24 17:23:57] liveboot: [0] HOOKS: 'liveboot-pre.d'
[2021-09-24 17:23:57] liveboot: [0] USING: 'liveboot-pre.d/400-liverw'
[2021-09-24 17:23:57] liveboot: [0] LEAVE: use_hooks
[2021-09-24 17:23:57] liveboot: [0] ENTER: do_overlay
[2021-09-24 17:23:57] liveboot: remounting / with overlayfs
[2021-09-24 17:23:57] liveboot: [0] RUN: mkdir -p -- /root.rw /root.ro
[2021-09-24 17:23:57] liveboot: [0] RUN: mount -t tmpfs -o mode=755 -- none /root.rw
[2021-09-24 17:23:57] liveboot: [0] RUN: mkdir -p -- /root.rw/rw /root.rw/wk
[2021-09-24 17:23:57] liveboot: [0] RUN: mount --move -- /root /root.ro
[2021-09-24 17:23:57] liveboot: [0] ENTER: use_hooks
[2021-09-24 17:23:57] liveboot: [0] HOOKS: 'livecd-slice.d'
[2021-09-24 17:23:57] liveboot: [0] USING: 'livecd-slice.d/300-localdev'
[2021-09-24 17:23:57] liveboot: [0] USING: 'livecd-slice.d/700-cifs'
[2021-09-24 17:23:57] liveboot: [0] USING: 'livecd-slice.d/700-nfs'
[2021-09-24 17:23:57] liveboot: [0] LEAVE: use_hooks
[2021-09-24 17:23:57] liveboot: [0] RUN: mount -t overlay -o lowerdir=/root.ro,upperdir=/root.rw/rw,workdir=/root.rw/wk -- overlay /root
[2021-09-24 17:23:57] liveboot: [0] RUN: mkdir -p -- /root/.ro /root/.rw
[2021-09-24 17:23:57] liveboot: [0] RUN: mount --move -- /root.ro /root/.ro
[2021-09-24 17:23:57] liveboot: [0] RUN: mount --move -- /root.rw /root/.rw
[2021-09-24 17:23:57] liveboot: [0] RUN: rmdir -- /root.rw /root.ro
[2021-09-24 17:23:57] liveboot: rootfs overlayed with overlayfs
[2021-09-24 17:23:57] liveboot: [0] RUN: mkdir -p -- /root/image
[2021-09-24 17:23:57] liveboot: [0] RUN: mount --move -- /image /root/image
[2021-09-24 17:23:57] liveboot: [0] ENTER: use_hooks
[2021-09-24 17:23:57] liveboot: [0] HOOKS: 'liveboot-post.d'
[2021-09-24 17:23:57] liveboot: [0] USING: 'liveboot-post.d/900-waitnet'
[2021-09-24 17:23:57] liveboot: [0] ENTER: export_netconf
[2021-09-24 17:23:57] liveboot: [0] ENTER: stage2_getenv
[2021-09-24 17:23:57] liveboot: [0] KEY: 'DEVICE'
[2021-09-24 17:23:57] liveboot: [0] stage2_getenv('DEVICE') result: ''
[2021-09-24 17:23:57] liveboot: [0] LEAVE: stage2_getenv
[2021-09-24 17:23:57] liveboot: [0] RUN: ip -4 addr show dev eth0
[2021-09-24 17:23:57] liveboot: [0] ENTER: get_first_dns
[2021-09-24 17:23:57] liveboot: [0] LEAVE: get_first_dns
[2021-09-24 17:23:57] liveboot: [0] RUN: hostname -s
[2021-09-24 17:23:57] liveboot: [0] ENTER: get_default_gateway
[2021-09-24 17:23:57] liveboot: [0] RUN: ip -4 route
[2021-09-24 17:23:57] liveboot: [0] LEAVE: get_default_gateway
[2021-09-24 17:23:57] liveboot: [0] ENTER: stage2_setenv
[2021-09-24 17:23:57] liveboot: [0] ARGS: DNS_SERVER="10.0.2.3"
[2021-09-24 17:23:57] liveboot: [0] LEAVE: stage2_setenv
[2021-09-24 17:23:57] liveboot: [0] ENTER: stage2_setenv
[2021-09-24 17:23:57] liveboot: [0] ARGS: GATEWAY="10.0.2.2"
[2021-09-24 17:23:57] liveboot: [0] LEAVE: stage2_setenv
[2021-09-24 17:23:57] liveboot: [0] ENTER: stage2_setenv
[2021-09-24 17:23:57] liveboot: [0] ARGS: DEVICE="eth0"
[2021-09-24 17:23:57] liveboot: [0] LEAVE: stage2_setenv
[2021-09-24 17:23:57] liveboot: [0] ENTER: stage2_setenv
[2021-09-24 17:23:57] liveboot: [0] ARGS: BOOTPROTO="dhcp"
[2021-09-24 17:23:57] liveboot: [0] LEAVE: stage2_setenv
[2021-09-24 17:23:57] liveboot: [0] LEAVE: export_netconf
[2021-09-24 17:23:57] liveboot: [0] USING: 'liveboot-post.d/950-altboot'
[2021-09-24 17:23:57] liveboot: [0] ENTER: altboot_cleanup
[2021-09-24 17:23:57] liveboot: [0] LEAVE: altboot_cleanup
[2021-09-24 17:23:57] liveboot: Spawning init...
[2021-09-24 17:23:57] liveboot: [0] LEAVE: use_hooks
[2021-09-24 17:23:57] liveboot: [0] RUN: cp -Lf -- /etc/resolv.conf /root/etc/
[2021-09-24 17:23:57] liveboot: [0] ENTER: bypass_results
[2021-09-24 17:23:57] liveboot: [0] RUN: rmdir -- /dev/bootchain/dst/step5
[2021-09-24 17:23:57] liveboot: [0] RUN: ln -snf -- /root /dev/bootchain/dst/step5
[2021-09-24 17:23:57] liveboot: [0] LEAVE: bypass_results
[2021-09-24 17:23:57] liveboot: [0] LEAVE: do_overlay
[2021-09-24 17:23:57] liveboot: [0] liveboot finished
[2021-09-24 17:23:57] bootchain-loop: RUN: touch /.initrd/bootchain/passed/liveboot
[2021-09-24 17:23:57] bootchain-loop: LET: callnum_liveboot="1"
[2021-09-24 17:23:57] bootchain-loop: remaining steps: rootfs
[2021-09-24 17:23:57] bootchain-loop: LET: callnum="0"
[2021-09-24 17:23:57] bootchain-loop: RUN: mkdir -p -- /dev/bootchain/src/step6 /dev/bootchain/dst/step6
[2021-09-24 17:23:57] bootchain-loop: [0] Handler: /lib/bootchain/rootfs
[2021-09-24 17:23:57] bootchain-loop: RUN: /lib/bootchain/debug
[2021-09-24 17:23:57] debug: debug for rootfs [0] started
[2021-09-24 17:23:57] debug: PREV DIR: /root
[2021-09-24 17:23:57] debug: Data DIR: /dev/bootchain/src/step6
[2021-09-24 17:23:57] debug: DEST DIR: /dev/bootchain/dst/step6
##############################
Previous step results (/root):
bin/
boot/
dev/
etc/
home/
image/
lib/
lib64/
libx32/
media/
mnt/
opt/
proc/
root/
run/
sbin/
selinux/
srv/
sys/
tmp/

Mount points and devices:
/dev/loop0 on /root/image type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8)
/dev/loop1 on /root/.ro type squashfs (ro,relatime)
none on /root/.rw type tmpfs (rw,relatime,mode=755)
##############################
[2021-09-24 17:23:57] debug: debug for rootfs [0] finished
[2021-09-24 17:23:57] bootchain-loop: RUN: /lib/bootchain/rootfs
[2021-09-24 17:23:57] rootfs: [0] ENTER: break_bc_loop
[2021-09-24 17:23:57] rootfs: [0] LEAVE: break_bc_loop
[2021-09-24 17:23:57] bootchain-loop: RUN: touch /.initrd/bootchain/passed/rootfs
[2021-09-24 17:23:57] bootchain-loop: remaining steps after breaking loop: rootfs
[2021-09-24 17:23:57] bootchain-loop: finishing in bootchain mode
[2021-09-24 17:23:57] bootchain-loop: [0] Handler: /lib/bootchain/debug
[2021-09-24 17:23:57] bootchain-loop: RUN: /lib/bootchain/debug
[2021-09-24 17:23:57] debug: debug for STAGE2 [0] started
[2021-09-24 17:23:57] debug: PREV DIR: /dev/bootchain/dst/step6
[2021-09-24 17:23:57] debug: Data DIR: /root
[2021-09-24 17:23:57] debug: DEST DIR: 
##############################
Previous step results (/dev/bootchain/dst/step6):

Mount points and devices:
/dev/loop0 on /root/image type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8)
/dev/loop1 on /root/.ro type squashfs (ro,relatime)
none on /root/.rw type tmpfs (rw,relatime,mode=755)
##############################
[2021-09-24 17:23:57] debug: debug for STAGE2 [0] finished
[2021-09-24 17:23:57] bootchain-loop: last step finished with exit code 0
[2021-09-24 17:23:57] bootchain-loop: RUN: cp -Lf -- /var/log/bootchained.log /root/var/log/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-24 21:59   ` Leonid Krivoshein
@ 2021-09-26 14:29     ` Alexey Gladkov
  2021-09-26 20:09       ` Leonid Krivoshein
  0 siblings, 1 reply; 16+ messages in thread
From: Alexey Gladkov @ 2021-09-26 14:29 UTC (permalink / raw)
  To: make-initrd

On Sat, Sep 25, 2021 at 12:59:27AM +0300, Leonid Krivoshein wrote:
> 
> 24.09.2021 22:08, Alexey Gladkov пишет:
> > > На первой итерации, чтобы не флудить, сделал поменьше коммитов. Всё равно
> > > вспомнить "что за чем менялось" уже невозможно. На следующих итерациях
> > > постараюсь сделать это более понятным. Поэтому первые три коммита позволяют
> > > понять порядок перемещения, переименования и что создано нового. Заранее
> > > извиняюсь за порядок и оформление коммитов, готов исправиться.
> > Я начал читать, но так как кода очень много не успею за один день всё
> > осилить. Я буду ещё комментировать.
> 
> Да это понятно, смотри, по возможности. А я тут подумал, что bootchain не
> просто же так форкался и переделывался, это не только демон и API --
> основная часть его "клиентов" дойдёт до апстрима следом, но сейчас этого нет
> в удобном тебе виде. Может помочь черновик документации, что я выслал. Также
> прилагаю лог самой проблемной загрузки по FTP, сделанный в результате
> сегодняшней проверки отправленного в апстрим. Могу выслать такой же с
> локальной загрузкой, если надо. Где-то это может понять логику работы кода и
> подход к отладочным сообщениям. Ну и на вопросы буду рад ответить!

Я дальше смотреть пока не буду. Пожалуйста переделай патчи. Твои патчи не
разбиты логически, в них нет описания зачем делаются те или иные
изменения, в README я не увидел описаний.

Форк + rename можно сделать за один коммит. После этого уже идут
содержательные коммиты, которые приносят твой новый функционал или меняют
поведение.

Сейчас же есть пачка "fork pipeline: * modified", которые либо делают
переименование, либо за одно что-то правят.

-- 
Rgrds, legion



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-24 19:06     ` Alexey Gladkov
@ 2021-09-26 18:56       ` Leonid Krivoshein
  2021-09-27  9:15         ` Alexey Gladkov
  0 siblings, 1 reply; 16+ messages in thread
From: Leonid Krivoshein @ 2021-09-26 18:56 UTC (permalink / raw)
  To: make-initrd


24.09.2021 22:06, Alexey Gladkov пишет:
> On Fri, Sep 24, 2021 at 09:42:38PM +0300, Leonid Krivoshein wrote:
>> 24.09.2021 19:56, Alexey Gladkov пишет:
>>> [...]
>>> Ты сделал патчи на пакет вместо апстримного кода. Спасибо gear я не
>>> разрабатываю make-initrd в альтовом репозитории.
>>>
>>> На первых итерациях это не имеет значения, но потом я прошу переделать.
>> Понял, со второй итерации буду брать за основу дерево с github:
>>
>>> Если что, апстрим тут:
>>>
>>> https://github.com/osboot/make-initrd
>> Но как мне с этим проверять, что оно не развалилось и не разъехалось? Ведь
>> вторую часть я собираю через gear. Есть какой-то простой путь сборки из
>> нескольких источников? Я просто не очень хорошо этим владею. Или будем
>> исправлять уже пост-фактум, если поломается?
> Тогда тебе наверное будет проще сначала сделать на gear и потом применить
> их к github.

Разумеется. Но, как я понимаю, этот код чем-то уже отличается. Например, 
add-udev-rules. А в чём смысл повторно применять к github, если 
проверить я всё равно не смогу? Есть вариант, что может не примениться?


> Я обычно разрабатываю и тестирую in-tree (для этого есть специальная
> опция configure), но в моём случае не нужно собирать пакеты.
>

-- 
Best regards,
Leonid Krivoshein.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-26 14:29     ` Alexey Gladkov
@ 2021-09-26 20:09       ` Leonid Krivoshein
  2021-09-27  9:23         ` Alexey Gladkov
  0 siblings, 1 reply; 16+ messages in thread
From: Leonid Krivoshein @ 2021-09-26 20:09 UTC (permalink / raw)
  To: make-initrd


26.09.2021 17:29, Alexey Gladkov пишет:
> On Sat, Sep 25, 2021 at 12:59:27AM +0300, Leonid Krivoshein wrote:
>> 24.09.2021 22:08, Alexey Gladkov пишет:
>>>> На первой итерации, чтобы не флудить, сделал поменьше коммитов. Всё равно
>>>> вспомнить "что за чем менялось" уже невозможно. На следующих итерациях
>>>> постараюсь сделать это более понятным. Поэтому первые три коммита позволяют
>>>> понять порядок перемещения, переименования и что создано нового. Заранее
>>>> извиняюсь за порядок и оформление коммитов, готов исправиться.
>>> Я начал читать, но так как кода очень много не успею за один день всё
>>> осилить. Я буду ещё комментировать.
>> Да это понятно, смотри, по возможности. А я тут подумал, что bootchain не
>> просто же так форкался и переделывался, это не только демон и API --
>> основная часть его "клиентов" дойдёт до апстрима следом, но сейчас этого нет
>> в удобном тебе виде. Может помочь черновик документации, что я выслал. Также
>> прилагаю лог самой проблемной загрузки по FTP, сделанный в результате
>> сегодняшней проверки отправленного в апстрим. Могу выслать такой же с
>> локальной загрузкой, если надо. Где-то это может понять логику работы кода и
>> подход к отладочным сообщениям. Ну и на вопросы буду рад ответить!
> Я дальше смотреть пока не буду. Пожалуйста переделай патчи.

Конечно, переделаю.


> Твои патчи не
> разбиты логически, в них нет описания зачем делаются те или иные
> изменения, в README я не увидел описаний.

На первом этапе я хотел показать изменения pipeline, в целом, но сделать 
более читабельной историю и не флудить большим числом изменений. Мне и 
самому надо было понять, так как делались эти изменения очень давно и 
история нигде не сохранилась.

Необходимость писать правильные commit message я конечно понимаю. Сейчас 
их написание притормозит процесс. И ещё более сильно притормозит, если 
придётся писать README к каждой фиче на английском языке -- черновик 
документации на русском более 40 страниц.

Кстати, при разделении pipeline на 4 фичи должно получиться 4 README, 
включая исходный вариант, который я не трогал. Я вот не понял суть 
замечаний к тем двум README, что попали в bootchain-getimage и 
bootchain-waitdev. А про README из bootchain-core уже написал ранее.


> Форк + rename можно сделать за один коммит. После этого уже идут
> содержательные коммиты, которые приносят твой новый функционал или меняют
> поведение.
>
> Сейчас же есть пачка "fork pipeline: * modified", которые либо делают
> переименование, либо за одно что-то правят.

-- 
Best regards,
Leonid Krivoshein.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-26 18:56       ` Leonid Krivoshein
@ 2021-09-27  9:15         ` Alexey Gladkov
  2021-09-27 13:17           ` Leonid Krivoshein
  0 siblings, 1 reply; 16+ messages in thread
From: Alexey Gladkov @ 2021-09-27  9:15 UTC (permalink / raw)
  To: make-initrd

On Sun, Sep 26, 2021 at 09:56:07PM +0300, Leonid Krivoshein wrote:
> 
> 24.09.2021 22:06, Alexey Gladkov пишет:
> > On Fri, Sep 24, 2021 at 09:42:38PM +0300, Leonid Krivoshein wrote:
> > > 24.09.2021 19:56, Alexey Gladkov пишет:
> > > > [...]
> > > > Ты сделал патчи на пакет вместо апстримного кода. Спасибо gear я не
> > > > разрабатываю make-initrd в альтовом репозитории.
> > > > 
> > > > На первых итерациях это не имеет значения, но потом я прошу переделать.
> > > Понял, со второй итерации буду брать за основу дерево с github:
> > > 
> > > > Если что, апстрим тут:
> > > > 
> > > > https://github.com/osboot/make-initrd
> > > Но как мне с этим проверять, что оно не развалилось и не разъехалось? Ведь
> > > вторую часть я собираю через gear. Есть какой-то простой путь сборки из
> > > нескольких источников? Я просто не очень хорошо этим владею. Или будем
> > > исправлять уже пост-фактум, если поломается?
> > Тогда тебе наверное будет проще сначала сделать на gear и потом применить
> > их к github.
> 
> Разумеется. Но, как я понимаю, этот код чем-то уже отличается. Например,
> add-udev-rules. А в чём смысл повторно применять к github, если проверить я
> всё равно не смогу? Есть вариант, что может не примениться?

Они и так не применятся к мастеру.

-- 
Rgrds, legion



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-26 20:09       ` Leonid Krivoshein
@ 2021-09-27  9:23         ` Alexey Gladkov
  0 siblings, 0 replies; 16+ messages in thread
From: Alexey Gladkov @ 2021-09-27  9:23 UTC (permalink / raw)
  To: make-initrd

On Sun, Sep 26, 2021 at 11:09:39PM +0300, Leonid Krivoshein wrote:
> > Твои патчи не
> > разбиты логически, в них нет описания зачем делаются те или иные
> > изменения, в README я не увидел описаний.
> 
> На первом этапе я хотел показать изменения pipeline, в целом, но сделать
> более читабельной историю и не флудить большим числом изменений. Мне и
> самому надо было понять, так как делались эти изменения очень давно и
> история нигде не сохранилась.
> 
> Необходимость писать правильные commit message я конечно понимаю. Сейчас их
> написание притормозит процесс.

Хоть это и тормозит процесс, но потом позволяет разобраться в изменениях.
Всё что ты сделал должно быть готово, к тому чтобы любой мог понять что и
зачем было сделано. Через год даже ты уже не поможешь с этим.

> И ещё более сильно притормозит, если придётся
> писать README к каждой фиче на английском языке -- черновик документации на
> русском более 40 страниц.

Ого.

> Кстати, при разделении pipeline на 4 фичи должно получиться 4 README,
> включая исходный вариант, который я не трогал. Я вот не понял суть замечаний
> к тем двум README, что попали в bootchain-getimage и bootchain-waitdev. А
> про README из bootchain-core уже написал ранее.

Я в другом письме ответил.

> > Форк + rename можно сделать за один коммит. После этого уже идут
> > содержательные коммиты, которые приносят твой новый функционал или меняют
> > поведение.
> > 
> > Сейчас же есть пачка "fork pipeline: * modified", которые либо делают
> > переименование, либо за одно что-то правят.
> 
> -- 
> Best regards,
> Leonid Krivoshein.
> 
> _______________________________________________
> Make-initrd mailing list
> Make-initrd@lists.altlinux.org
> https://lists.altlinux.org/mailman/listinfo/make-initrd

-- 
Rgrds, legion



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-27  9:15         ` Alexey Gladkov
@ 2021-09-27 13:17           ` Leonid Krivoshein
  2021-09-27 13:55             ` Alexey Gladkov
  0 siblings, 1 reply; 16+ messages in thread
From: Leonid Krivoshein @ 2021-09-27 13:17 UTC (permalink / raw)
  To: make-initrd


27.09.2021 12:15, Alexey Gladkov пишет:
> On Sun, Sep 26, 2021 at 09:56:07PM +0300, Leonid Krivoshein wrote:
>> 24.09.2021 22:06, Alexey Gladkov пишет:
>>> On Fri, Sep 24, 2021 at 09:42:38PM +0300, Leonid Krivoshein wrote:
>>>> [...]
>>>>> Если что, апстрим тут:
>>>>>
>>>>> https://github.com/osboot/make-initrd
>>>> Но как мне с этим проверять, что оно не развалилось и не разъехалось? Ведь
>>>> вторую часть я собираю через gear. Есть какой-то простой путь сборки из
>>>> нескольких источников? Я просто не очень хорошо этим владею. Или будем
>>>> исправлять уже пост-фактум, если поломается?
>>> Тогда тебе наверное будет проще сначала сделать на gear и потом применить
>>> их к github.
>> Разумеется. Но, как я понимаю, этот код чем-то уже отличается. Например,
>> add-udev-rules. А в чём смысл повторно применять к github, если проверить я
>> всё равно не смогу? Есть вариант, что может не примениться?
> Они и так не применятся к мастеру.

По всему остальному понял, сделаю. А тут, как я понял, раз не 
применятся, то достаточно проверить на gear и присылать без последнего 
коммита спека уже подписанными. Это я уже знаю, как сделать. Чтобы не 
тратить зря твоё время, Антон предложил пропустить сначала через него, 
поскольку опыт с ним сам говоришь, положительный.


-- 
Best regards,
Leonid Krivoshein.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-27 13:17           ` Leonid Krivoshein
@ 2021-09-27 13:55             ` Alexey Gladkov
  2021-10-13 17:06               ` Leonid Krivoshein
  0 siblings, 1 reply; 16+ messages in thread
From: Alexey Gladkov @ 2021-09-27 13:55 UTC (permalink / raw)
  To: make-initrd

On Mon, Sep 27, 2021 at 04:17:38PM +0300, Leonid Krivoshein wrote:
> 
> 27.09.2021 12:15, Alexey Gladkov пишет:
> > On Sun, Sep 26, 2021 at 09:56:07PM +0300, Leonid Krivoshein wrote:
> > > 24.09.2021 22:06, Alexey Gladkov пишет:
> > > > On Fri, Sep 24, 2021 at 09:42:38PM +0300, Leonid Krivoshein wrote:
> > > > > [...]
> > > > > > Если что, апстрим тут:
> > > > > > 
> > > > > > https://github.com/osboot/make-initrd
> > > > > Но как мне с этим проверять, что оно не развалилось и не разъехалось? Ведь
> > > > > вторую часть я собираю через gear. Есть какой-то простой путь сборки из
> > > > > нескольких источников? Я просто не очень хорошо этим владею. Или будем
> > > > > исправлять уже пост-фактум, если поломается?
> > > > Тогда тебе наверное будет проще сначала сделать на gear и потом применить
> > > > их к github.
> > > Разумеется. Но, как я понимаю, этот код чем-то уже отличается. Например,
> > > add-udev-rules. А в чём смысл повторно применять к github, если проверить я
> > > всё равно не смогу? Есть вариант, что может не примениться?
> > Они и так не применятся к мастеру.
> 
> По всему остальному понял, сделаю. А тут, как я понял, раз не применятся, то
> достаточно проверить на gear и присылать без последнего коммита спека уже
> подписанными.

Давай сначала сделаем всё на gear.

В master нет подкаталога make-initrd/. Я добавил его, чтобы gear-import
проще было делать.

> Это я уже знаю, как сделать. Чтобы не тратить зря твоё время,
> Антон предложил пропустить сначала через него, поскольку опыт с ним сам
> говоришь, положительный.

Если он не против, то я за )))

-- 
Rgrds, legion



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-09-27 13:55             ` Alexey Gladkov
@ 2021-10-13 17:06               ` Leonid Krivoshein
  2021-10-13 18:38                 ` Alexey Gladkov
  0 siblings, 1 reply; 16+ messages in thread
From: Leonid Krivoshein @ 2021-10-13 17:06 UTC (permalink / raw)
  To: make-initrd

[-- Attachment #1: Type: text/plain, Size: 1162 bytes --]

Алексей, привет!


27.09.2021 16:55, Alexey Gladkov пишет:
> On Mon, Sep 27, 2021 at 04:17:38PM +0300, Leonid Krivoshein wrote:
>> [...] Чтобы не тратить зря твоё время,
>> Антон предложил пропустить сначала через него, поскольку опыт с ним сам
>> говоришь, положительный.
> Если он не против, то я за )))

Извини за задержку. Долго болел, решали вопросы с логическим разделением 
на коммиты и занимались README с переводами. Перевод на английский 
сделал Максим Князев, его можно взять за основу, чтобы тебе меньше 
работы было, но я не уверен в корректности перевода и пока не знаю, как 
учесть его участие. Прилагаю финальные варианты README, а коммиты зашлю 
следующими письмами.



-- 
Best regards,
Leonid Krivoshein.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: README.ru.utf8.md --]
[-- Type: text/markdown; name="README.ru.utf8.md", Size: 24595 bytes --]

# Фича: bootchain-core

`bootchain-core` - форк и дальнейшее развитие оригинальной фичи `pipeline`.
Производная фича, равно как и `pipeline`, последовательно запускает шаги-скрипты
один за другим. Подробности про `pipeline` см. в ../features/pipeline/README.md.

В процессе форка фича `pipeline` была разделена на три части:

- `bootchain-core` - основной функционал фичи `pipeline`, общий код и демон.
- `bootchain-getimage` - метод загрузки ISO-образов по сети утилитой wget.
- `bootchain-waitdev` - метод загрузки с указанных локальных носителей.

Дальнейшая работа над `bootchain` привела к созданию ещё нескольких модулей.
Их перенос в апстрим ожидается в ближайшее время. Такое разделение на модули
позволяет оптимизировать наполнение образа initramfs только необходимым.

## Основные компоненты bootchain-core

- `/bin/bootchain-sh-functions` - общий код, развитие `pipeline-sh-functions`.
- `/sbin/bootchained` - демон, развитие `pipelined`, перезапускаемый процесс.
- `/sbin/bootchain-logvt` - скрипт управления вспомогательным терминалом.
- `/etc/rc.d/init.d/bootchain` - стартовый скрипт sysvinit.

## Причины создания форка и переименования pipeline

- Набор модулей `bootchain` разрабатывался с целью создать в stage1 замену
  программы `propagator`, полностью интегрированную в run-time `make-initrd`.
  В исходном варианте фича `pipeline` не удовлетворяла названной потребности.
  На раннем этапе разработки ещё не было известно, какой функционал окажется
  в конечном итоге у `bootchain`, насколько далеко он уйдёт от форка и сможет
  ли быть с ним полностью совместимым.
- Некоторое время разработка `bootchain` велась независимо от основного проекта
  `make-initrd`. Чтобы собирать и тестировать загрузочные диски с `make-initrd`
  и `bootchain`, чтобы `bootchain` не зависел от версий `make-initrd`, чтобы не
  пересекаться со встроенной в `make-initrd` фичей `pipeline` и чтобы не мешать
  автору `make-initrd`, фичу `pipeline` пришлось скопировать под другим именем,
  дав ей заодно более подходящее название.
- Не всегда результат пройденного шага используется следующим. Шаги-скрипты
  могут использовать результаты не только предыдущего, но и любого ранее
  пройденного шага. Так что это не конвейер в чистом виде, а скорее цепочка
  шагов загрузки, последовательность выполняемых действий.

## Отличия от оригинального pipeline

- Модульность: методы загрузки изначально отделены от общего кода и демона.
- Обеспечена возможность переводить демон на передний план в любое время.
  При этом происходит перезапуск процесса `bootchained` на конкретном
  терминале, хотя изначально демон запускается в фоновом режиме.
- Некоторые шаги (действия) встроены непосредственно в код главного цикла
  демона `bootchained`, внешние скрипты для их выполнения не вызываются.
  Такие псевдо-шаги позволяют управлять, в основном, внутренним состоянием
  демона и не должны учитываться в загрузочной цепочке, как будто они скрыты.
- Опционально демон может работать совместно с фичей `bootchain-interactive`,
  может перейти на передний план и продолжить работать на конкретном терминале,
  по умолчанию tty2. Совместно фичи `bootchain-core` и `bootchain-interactive`
  закладывают основу для построения простых текстовых инсталляторов в stage1.
- Демон `bootchianed` позволяет перегружать цепочку новым набором шагов,
  благодаря чему можно менять логику работы "на лету", поддерживать циклы и
  условные переходы, в текстовых диалогах это возможность возвращаться назад.
- Ведёт учёт хотя бы один раз пройденных шагов и позволяет предотвращать их
  повторный запуск.
- `bootchain-sh-functions` расширяет API оригинального `pipeline-sh-functions`,
  см. детали в соответствующем разделе.
- Через resolve_target() поддерживает не только прямую, но и обратную адресацию,
  относительно текущего шага. Например, запись вида `step-3/dir1/dev` обработает
  результат `dir1/dev`, сделанный на третьем шаге от текущего. Совместно с
  перегрузкой цепочки шагов прямая адресация безопасна только при сохранении
  номеров пройденных шагов в файлы, тогда как обратная относительная адресация
  безопасна в любом случае и зачастую может оказаться удобней.
- Позволяет работать с более короткими и привычными путями к специальным файлам
  устройств благодаря использованию `DEVNAME` наряду с `dev`.
- Предоставляет возможность связывать <ВХОД> шага с <ВЫХОДОМ> предыдущего шага
  через символические ссылки на точки монтирования внутри initramfs, вне дерева
  результатов шагов, что обеспечивает, при необходимости, механизм монтирования
  внахлёст, свойственный программе `propagator`.
- Наряду с РОДНЫМ режимом работы, демон `bootchianed` может работать в режиме
  СОВМЕСТИМОСТИ с `pipeline`. В РОДНОМ режиме работы демон навязывает другой
  подход к обработке кода состояния завершённого шага и способу преждевременного
  завершения загрузочной цепочки, см. детали в соответствующем разделе.
- Демон может быть сконфигурирован при сборке initramfs через включаемый файл
  конфигурации `/etc/sysconfig/bootchain`, а не только через параметры загрузки,
  см. детали в соответствующем разделе.
- Демон `bootchianed` предлагает наглядную и расширенную отладку. По умолчанию
  журнал ведётся в `/var/log/bootchained.log` и доступен на tty3, а при включении
  расширенной отладки или функции самотестирования также копируется в stage2.
  Служебный шаг-скрипт `debug` в режиме расширенной отладки запускается перед
  запуском любого другого шага-скрипта и позволяет наглядно отследить получаемые
  значения на каждом <ВХОДЕ>.

Несмотря на отличия, `bootchained` обратно совместим с ранее написанными шагами
для демона `pipelined` и не требует изменений для конфигураций с `root=pipeline`.

## Особенности работы демона pipelined

Если скрипт шага завершится кодом состояния 2, оригинальный демон `pipelined`
воспримет это как необходимость прервать цепочку и прекратить работу, полагая,
что система готова к переходу в stage2. Если скрипт шага не обработает данный
код от внешней команды, а stage2 окажется ещё не готов к работе, возникнет
ситуация с преждевременным завершением демона.

Если шаг-скрипт завершится ненулевым кодом состояния, отличным от 2, демон
`pipelined` воспримет это как сбой и будет повторять зафейлившийся шаг с паузой
в одну секунду в бесконечном цикле (до истечения общего таймаута rootdelay=180).
Но зачастую повторять шаги бесполезно, поскольку ситуация неисправима, повтор
приводит лишь к ненужному ожиданию и разрастанию записей в журнале. Однако
демон `pipelined` не знает, как обрабатывать такие ситуации.

## Новый подход в демоне bootchained

Шагам-скриптам предлагается перед завершением с кодом состояния 0 вызвать
break_bc_loop(), чтобы сообщить демону о готовности stage2 и необходимости
завершить работу демона сразу после текущего шага. В случае сбоя в скрипте шага
демон может его повторять, но не более четырёх раз с паузой в две секунды. Чтобы
сбой в скрипте шага приводил к немедленному завершению работы демона, необходимо
использовать внутренний шаг `noretry`.

## Режимы работы демона

### РОДНОЙ режим работы

РОДНОЙ режим активируется параметром `root=bootchain`. В этом режиме демон будет
воспринимать код состояния 2 от скрипта шага так же, как и любой другой ненулевой
код и далее действовать согласно внутреннему состоянию: если повторы разрешены,
скрипт шага будет вызван повторно с паузой в 2 секунды, но не более четырёх раз.
Если же повторы запрещены, демон сам немедленно завершится.

### Режим СОВМЕСТИМОСТИ с pipeline

Режим СОВМЕСТИМОСТИ активируется параметром `root=pipeline`. В этом режиме демон
ведёт себя так же, как и оригинальный `pipelined`, разве что ограничивает число
повторных запусков зафейлившегося шага. Он воспринимает код состояния 2 не как
сбой, а как команду завершить главный цикл демона.

## Конфигурация

Конфигурация определяется в файле `/etc/sysconfig/bootchain` при сборке образа
initramfs, необязательна и может содержать следующие параметры:

- `BC_LOG_VT` - номер виртуального терминала, на который в фоновом режиме должен
  выводиться отладочный журнал. По умолчанию значение равно 3, соответственно
  журнал выводится на tty3. Пустое значение позволяет отключить вывод журнала
  на какой-либо терминал.
- `BC_FGVT_ACTIVATE` - задержка в секуднах перед активацией интерактивного
  терминала, по умолчанию tty2 активируется через 2 секунды в режиме отладки
  или через 8 секунд в обычном режиме. Пустое значение предписывает активировать
  интерактивный терминал немедленно. Данная опция конфигурации работает только
  вместе с включенной в initramfs фичей `bootchain-interactive`.
- `BC_LOGFILE` - полный путь к файлу журнала либо имя специального устройства,
  на который будут выводиться отладочные сообщения. В РОДНОМ режиме значение по
  умолчанию равно `/var/log/bootchained.log`, в режиме СОВМЕСТИМОСТИ с `pipeline`
  значение по умолчанию равно `/var/log/pipelined.log`.
- `mntdir` - где создавать подкаталоги шагов загрузочной цепочки. В РОДНОМ
  режиме значение по умолчанию равно `/dev/bootchain`, в режиме СОВМЕСТИМОСТИ
  с `pipeline` значение по умолчанию равно `/dev/pipeline`.

Другие модули `bootchain-*` также могут использовать этот файл конфигурации для
собственных потребностей.

## Встроенные псевдо-шаги

Все ниже перечисленные шаги являются расширением `pipeline`. Они встроены в код
главного цикла демона `bootchained`, не нуждаются в дополнительных параметрах и
не должны учитываться при адресации, как будто они скрыты.

- `fg` - обеспечивает перевод демона в интерактивный режим при сборке initramfs
  с фичей `bootchain-interactive`. Самому `bootchain-core` интерактивность не
  требуется, но в ней могут нуждаться некоторые другие шаги, такие как `altboot`.
- `noop` - не выполняет никаких действий и предназначен для отрыва результатов на
  <ВЫХОДЕ> предыдущего шага от <ВХОДА> следующего шага, что может быть полезно,
  например, когда мы не хотим, чтобы результаты шага `waitdev` были использованы
  в следующем шаге `localdev`, который в первую очередь смотрит именно на них.
- `noretry` - запрещает следующим шагам завершаться с ненулевым кодом возврата,
  что приведёт к немедленному завершению работы демона в случае сбоя в скрипте
  любого следующего шага. По умолчанию шагам разрешено фейлиться, демон будет
  пытаться перезапускать их повторно четыре раза с паузой в две секунды.
- `retry` - разрешает всем последующим шагам завершаться с ненулевым кодом
  возврата, что приведёт к их пятикратному запуску, в общей сложности. Такой
  режим работы демона действует по умолчанию.

## Внешние элементы загрузочной цепочки (шаги-скрипты)

- `mountfs` - монтирует файл или устройство из результата предыдущего либо
  другого указанного шага.
- `overlayfs` - объединяет один или несколько элементов загрузочной цепочки
  с помощью overlayfs.
- `rootfs` - заставляет демон использовать результат предыдущего элемента как
  найденный корень stage2.

## Параметры загрузки

- `bootchain=name1[,name2][,name3]` - определяет начальное состояние загрузочной
  цепочки, т.е. шаги, которые должен пройти демон один за другим. Это могут быть
  как встроенные псевдо-шаги, так и реальные скрипты выполняемых действий. Имена
  этих шагов перечисляются через запятую.
- `pipeline=name1[,name2][,name3]` - синоним для `bootchain=...`.
- `mountfs=target` - определяет монтируемый файл или устройство.
- `overlayfs=list` - определяет список элементов для объединения.
- `bc_debug` - булевый параметр, включающий расширенную отладку и заставляющий
  в случае успешного завершения демона скопировать журнал загрузки в stage2.
- `bc_test=name` - определяет название текущего тест-кейса в процессе полностью
  автоматизированного самотестирования, заставляющий в случае успешного
  завершения демона скопировать журнал загрузки в stage2 и рядом с ним
  создать файл BC-TEST.passed с указанным названием тест-кейса.

## Расширенное API bootchain-sh-functions

- check_parameter() - проверяет, чтобы обязательный параметр был не пуст,
  иначе завершает работу через fatal().
- get_parameter() - вывод значения параметра текущего шага по индексу $callnum.
- resolve_target() - вывод пути к файлу, каталогу или устройству, в зависимости
  от параметра.
- resolve_devname() - вывод пути к специальному файлу устройства по указанному
  каталогу. Обычно каталог шага содержит файл DEVNAME или dev, если устройство
  было результатом шага, тогда функция вернёт читаемый `/dev/узел`.
- debug() - вывод текстового сообщения при расширенной отладке.
- enter() - трассировка при расширенной отладке: вход в указанную функцию.
- leave() - трассировка при расширенной отладке: выход из указанной функции.
- run() - запуск внешней команды. При расширенной отладке выполняемая команда
  попадёт в журнал.
- fdump() - вывод содержимого указанного файла при расширенной отладке.
- assign() - присвоение переменной указанного значения, попадающее в журнал
  при расширенной отладке. Левостороннее выражение также является вычисляемым.
- next_bootchain() - команда демону на смену последовательности следующих шагов.
- is_step_passed() - возвращает 0, если текущий шаг был пройден хотя бы один раз.
- launch_step_once() - если текущий шаг уже был пройден, завершает работу через
  вызов fatal().
- break_bc_loop() - сообщает демону о том, что текущий шаг последний и после
  его успешного завершения можно переходить в stage2. Скрипт этого шага, тем
  не менее, должен отработать до конца и завершиться с нулевым кодом состояния,
  чтобы демон обработал полученный сигнал.
- bc_reboot() - выполняет журналируемый перезапуск компьютера.
- bypass_results() - просит демон связать <ВЫХОД> предыдущего шага со <ВХОДОМ>
  следующего шага. Также используется для сообщения демону о результате
  (смонтированном каталоге) внутри текущего корня initramfs, вне дерева $mntdir.
- initrd_version() - вывод текущей версии make-initrd. Предлагается перенести
  в make-initrd/data/bin/initrd-sh-functions вслед за has_module().

## Примеры

Cmdline: root=bootchain bootchain=waitdev,mountfs,mountfs,overlayfs,rootfs waitdev=CDROM:LABEL=ALT_regular-rescue/x86_64 mountfs=DEVNANE mountfs=rescue

Следуя этим параметрам, демон дожидается локального устройства с файловой
системой ISO-9660 и меткой тома "ALT_regular-rescue/x86_64", монтирует этот
носитель, монтирует с него файл "rescue" как squashfs корневой системы, делает
его доступным для записи с помощью overlayfs и пытается загрузиться с него.

Cmdline: root=pipeline pipeline=getimage,mountfs,overlayfs,rootfs getimage=http://ftp.altlinux.org/pub/people/mike/iso/misc/vi-20140918-i586.iso mountfs=rescue

Следуя этим параметрам, демон загружает образ "vi-20140918-i586.iso", монтирует
его через устройство loop, монтирует с него файл "rescue" как squashfs корневой
системы, делает его доступным для записи с помощью overlayfs и пытается
загрузиться с него.

[-- Attachment #3: README.md --]
[-- Type: text/markdown, Size: 15340 bytes --]

# Feature: bootchain-core

`bootchain-core` - it's a fork and further development the original
feature of `pipeline`. This feature allow us to consistently setup
steps-scripts one by one. For details about `pipeline` you can see
in ../features/pipeline/README.md.

In fork process `pipeline` was divided by three parts:

- `bootchain-core` - the main functional of feature `pipeline`, common
  API and daemon.
- `bootchain-getimage` - method to networking boot from ISO-image with
  the wget utility.
- `bootchain-waitdev` - method to boot from specified local media.

The future work with `bootchain` allowed us to create a few modules.
They are expected to be upstream soon. This divide on modules allow
us to optimize fill in `initramfs` only which we are need.

## Main components of bootchain-core

- `/bin/bootchain-sh-functions` - common API and evolution
  of `pipeline-sh-functions`.
- `/sbin/bootchained` - daemon, evolution of `pipelined`.
- `/sbin/bootchain-logvt` - script which allow to control sub terminal.
- `/etc/rc.d/init.d/bootchain` - sysvinit start script.

## Reasons of making fork and rename pipeline

- A set of `bootchain` modules was developed in order to create a
  replacement in stage1 programs `propagator`, fully integrated into
  the run-time `make-initrd`. In the original version, the `pipeline`
  feature did not satisfy this need. At an early stage of development,
  it was not yet known what functionality `bootchain` would eventually
  have, how far it would go from the fork and be able to whether to be
  fully compatible with it.
- For some time, the development of `bootchain` was carried out independently
  of the main project `make-initrd`. To build and test bootable disks with
  `make-initrd` and `bootchain` so that `bootchain` does not depend on
  `make-initrd` versions, so that not intersect with the `pipeline` features
  built into the `make-initrd` and so as not to interfere the author of
  `make-initrd`, the `pipeline` feature had to be copied under a different
  name, giving it a more appropriate name at the same time.
- The result of the completed step is not always used next. Steps-scripts
  they can use the results not only of the previous one, but also of any
  earlier one the completed step. So it's not a pipeline in its purest
  form, but rather a chain loading steps, the sequence of actions performed.

## Defference from the original pipeline

- Modularity: loading methods are initially separated from the common
  code and daemon.
- The main loop of the `bootchain-loop` daemon is separated from the
  `bootchained` daemon code, which provides the ability to bring the daemon
  to the foreground at any time. In fact, this restarts the `bootchain-loop`
  process on a specific terminal, although initially the daemon runs this
  process in the background.
- Some steps (actions) are built directly into the code of the main loop
  of the `bootchain-loop` daemon, external scripts are not called to execute
  them. Such pseudo-steps allow you to control, basically, the internal state
  of the daemon and should not be taken into account in the boot chain, as if
  they are hidden.
- Optionally, the daemon can work in conjunction with the `bootchain-interactive`
  feature, can move to the foreground and continue working on a specific terminal,
  by default, tty2. Jointly features `bootchain-core` and `bootchain-interactive`
  they lay the foundation for building simple text installers in stage1.
- The `bootchianed` daemon allows you to overload the chain with a new set of
  steps, thanks to this, you can change the logic of work "on the fly", support
  loops and conditional jumps, in text dialogs it is an opportunity to go back.
- Keeps records of the steps taken at least once and allows you to prevent their
  re-launch.
- `bootchain-sh-functions` extends the API of the original `pipeline-sh-functions`,
  see the details in the corresponding section.
- Via resolve_target() supports not only forward, but also reverse addressing,
  relative to the current step. For example, a record like `step-3/dir1/dev`
  will process the result of `dir1/dev`, made in the third step from the current
  one. Together with the overload of the chain of steps, direct addressing is safe
  only when storing the numbers of the completed steps in files, whereas reverse
  relative addressing it is safe in any case and can often be more convenient.
- Allows you to work with shorter and more familiar paths to special files
  devices thanks to the use of `DEVNAME` along with `dev`.
- Provides the ability to associate the <IN> of a step with the <OUT>
  of the previous step through symbolic links to mount points inside initramfs,
  outside the tree the results of the steps, which provides, if necessary, the
  overlap mounting mechanism inherent in the program `propagator`.
- Along with the NATIVE mode of operation, the `bootchianed` daemon can work
  in COMPATIBILITY WITH `pipeline`. In the NATIVE mode of operation, the daemon
  imposes another an approach to processing the status code of the completed
  step and the method of premature completion of the boot chain, see the details
  in the corresponding section.
- The daemon can be configured when building initramfs via the included file
  configurations of `/etc/sysconfig/bootchain`, and not only through boot
  parameters, see the details in the corresponding section.
- The `bootchianed` daemon offers visual and advanced debugging. By default,
  the log is kept in `/var/log/bootchained.log` and is available on tty3,
  and when enabled advanced debugging or self-testing functions are also copied
  to stage2. Service step-the `debug` script in advanced debugging mode is run
  before by launching any other step-script and allows you to visually track
  the received values at each <IN>.

Despite the differences, `bootchained` is backward compatible with previously
written steps for the `pipelined` daemon and does not require changes for
configurations with `root=pipeline`.

## Features of the pipelined work

If the step-script will be finished with code of status 2, the original daemon
`pipelined` will understand it like a must to stop chains and finish work.
(meaning that system is ready to go stage2). If the step-script does not
process this code from an external command, and stage2 is not ready to work
yet, a situation with premature termination of the daemon will arise.

If the step-script will be finished with non-null code of status (different
from 2), daemon `pipelined` will understand it like a fail and will repeat this
failure-step with pause in one second in infinity cycle (until common timeout
rootdelay=180). But, sometimes repeat steps are unnecessary because the
situation is incorrigible and repeating will just waste of time and make a
system log is filling up. But the daemon `pipelined` don't know how to work
with this situations.

## New approach in bootchained daemon

For steps-scripts are suggested before finish work with code of status 0 call
break_bc_loop() for tell to the daemon about ready stage2 and needed finish
work this daemon after the current step.In case of a failure in the step-by-step
scenario, the daemon can repeat it, but no more than four times with a pause of
two seconds. In order for a failure in the step-by-step scenario to lead to an
immediate shutdown of the daemon, it is necessary to use the internal step
`noretry`.

## Daemon operation mode

### NATIVE mode of operation

NATIVE mode is activated by the `root=bootchain` parameter. In this mode, the
daemon will perceive the status code 2 from the step script in the same way as
any other non-zero code and then act according to the internal state: if
repetitions are allowed, the step script will be called again with a pause
of 2 seconds, but no more than four times. If repetitions are prohibited,
the daemon itself will immediately terminate.

### Pipeline COMPATIBILITY mode

Compatibility mode is activated by the `root=pipeline` parameter. In this mode,
the daemon behaves the same as the original `pipelined`, except that it limits
the number of re-runs of the failed step. He perceives the status code 2 not as
a failure, but as a command to end the main daemon cycle.

## Configuration

The configuration is defined in the file `/etc/sysconfig/bootchain` when
building the image initramfs, optional and may contain the following parameters:

- `BC_LOG_VT` is the number of the virtual terminal to which the debug log
  should be output in the background. By default, the value is 3, respectively,
  the log is output to tty3. An empty value allows you to disable log output
  to any terminal.
- `BC_FGVT_ACTIVATE` - delay in seconds before activating the interactive
  terminal, by default tty2 is activated after 2 seconds in debug mode
  or after 8 seconds in normal mode. An empty value instructs to activate
  the interactive terminal immediately. This configuration option only works
  together with the `bootchain-interactive` features included in initramfs.
- `BC_LOGFILE` - the full path to the log file or the name of a special device,
  to which debugging messages will be output. In NATIVE mode, the default value
  is the default value is `/var/log/bootchained.log`, in compatibility mode with
  `pipeline` the default value is `/var/log/pipelined.log`.
- `mntdir` - where to create subdirectories of the boot chain steps. In NATIVE
  mode the default value is `/dev/bootchain`, in COMPATIBILITY mode with
  `pipeline`, the default value is `/dev/pipeline`.

Other `bootchain-*` modules can also use this configuration file for their
own needs.

## In-app pseudo-steps

All the steps listed below are an extension of the `pipeline`. They are
embedded in the code of the main loop of the `boot chain-loop` daemon, do
not need additional parameters and should not be taken into account when
addressing, as if they are hidden.

- `fg` - provides the transfer of the daemon to interactive mode when building
  initramfs with `bootchain-interactive` features. The `bootchain-core` itself
  is not interactivity required, but some other steps may need it, such as
  `altboot`.
- `noop` - does not perform any actions and is designed to pull off the results
  on the <OUT> of the previous step from the <IN> of the next step, which can
  be useful, for example, when we don`t want the results of the `waitdev` step
  to be used in the next step, `localdev`, which primarily looks at them.
- `noretry` - prohibits the following steps from ending with a non-zero return
  code, what will lead to the immediate shutdown of the daemon in case of a
  script failure any next step. By default, the steps are allowed to fail,
  the daemon will try to restart them again four times with a pause of two
  seconds.
- `retry` - allows all subsequent steps to be completed with a non-zero return
  code, which will lead to their starting five times, in total. This mode of
  operation of the daemon operates by default.

## External elements of the bootchain (steps-scripts)

- `mountfs` - mounts a file or device from the result of the previous or other
  specified step.
- `overlayfs` - combines one or more elements of the boot chain using overlayfs.
- `rootfs` - forces the daemon to use the result of the previous element as the
  found root of stage 2.

## Boot parameters

- `bootchain=name1[,name2][,name3]` - defines the initial state of the boot
  chains, i.e. the steps that the daemon must go through one by one. These can
  be both built-in pseudo-steps and real scripts of the actions performed. The
  names these steps are listed separated by commas.
- `pipeline=name1[,name2][,name3]` - alias for `bootchain=...`.
- `mountfs=target` - specifies the file or device to be mounted.
- `overlayfs=list` - defines the list of elements to combine.
- `bc_debug` - a boolean parameter that enables advanced debugging and forces
  if the daemon completes successfully, copy the download log to stage2.
- `bc_test=name` - defines the name of the current test case in the process of
  fully automated self-testing, forcing in case of successful after completing
  the daemon, copy the download log to stage2 and next to it create a
  `BC-TEST.passed` file with the specified name of the test case.

## bootchain-sh-functions extended API

- check_parameter() - checks that the required parameter is not empty, otherwise
  it exits via fatal().
- get_parameter() - outputs the value of the parameter of the current step by
  the index $callnum.
- resolve_target() - output the path to a file, directory or device, depending
  on from the parameter.
- resolve_devname() - output the path to a special device file at the specified
  directory. Usually the step directory contains a DEVNAME or dev file if the
  device was the result of a step, then the function will return a readable
  `/dev/node`.
- debug() - text message output during extended debugging.
- enter() - tracing during extended debugging: entering the specified function.
- leave() - tracing during extended debugging: exit from the specified function.
- run() - run an external command. With extended debugging, the executed command
  will be logged.
- fdump() - output of the contents of the specified file during extended
  debugging.
- assign() - assignment of the specified value to a variable that gets into
  the log with advanced debugging. The left-hand expression is also computable.
- next_bootchain() - command to the daemon to change the sequence of the
  following steps.
- is_step_passed() - returns 0 if the current step has been passed at
  least once.
- launch_step_once() - if the current step has already been completed,
  it completes the work through the fatal() call.
- break_bc_loop() - informs the daemon that the current step is the last and
  after after its successful completion, you can switch to stage2. The script
  of this step, however, must work to the end and end with a zero status code
  in order for the daemon to process the received signal.
- bc_reboot() - performs a logged restart of the computer.
- bypass_results() - asks the daemon to associate the <OUT> of the previous
  step with the <IN> the next step. It is also used to inform the daemon about
  the result (mounted directory) inside the current initramfs root, outside the
  $mntdir tree.
- initrd_version() - output of the current version of make-initrd. It is proposed
  to move to make-initrd/data/bin/initrd-sh-functions after has_module().

## Examples

Cmdline: root=bootchain bootchain=waitdev,mountfs,mountfs,overlayfs,rootfs waitdev=CDROM:LABEL=ALT_regular-rescue/x86_64 mountfs=DEVNANE mountfs=rescue

Following these parameters, the daemon waits for a local device with the
ISO-9660 file system and the volume label "ALT_regular-rescue/x86_64", mounts
this media, mounts the "rescue" file from it as squashfs of the root system,
makes it writable using overlayfs and tries to boot from it.

Cmdline: root=pipeline pipeline=getimage,mountfs,overlayfs,rootfs getimage=http://ftp.altlinux.org/pub/people/mike/iso/misc/vi-20140918-i586.iso mountfs=rescue

Following these parameters, the daemon loads the image "vi-20140918-i586.iso",
mounts it via the loop device, mounts the "rescue" file from it as squashfs of
the root system, makes it writable using overlayfs and tries to boot from it.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-10-13 17:06               ` Leonid Krivoshein
@ 2021-10-13 18:38                 ` Alexey Gladkov
  2021-10-13 18:48                   ` Leonid Krivoshein
  0 siblings, 1 reply; 16+ messages in thread
From: Alexey Gladkov @ 2021-10-13 18:38 UTC (permalink / raw)
  To: make-initrd

On Wed, Oct 13, 2021 at 08:06:02PM +0300, Leonid Krivoshein wrote:
> Алексей, привет!
> 
> 
> 27.09.2021 16:55, Alexey Gladkov пишет:
> > On Mon, Sep 27, 2021 at 04:17:38PM +0300, Leonid Krivoshein wrote:
> > > [...] Чтобы не тратить зря твоё время,
> > > Антон предложил пропустить сначала через него, поскольку опыт с ним сам
> > > говоришь, положительный.
> > Если он не против, то я за )))
> 
> Извини за задержку. Долго болел, решали вопросы с логическим разделением на
> коммиты и занимались README с переводами. Перевод на английский сделал
> Максим Князев, его можно взять за основу, чтобы тебе меньше работы было, но
> я не уверен в корректности перевода и пока не знаю, как учесть его участие.
> Прилагаю финальные варианты README, а коммиты зашлю следующими письмами.

Co-developed-by: Second Co-Author <second@coauthor.example.org>
Signed-off-by: Second Co-Author <second@coauthor.example.org>

?

-- 
Rgrds, legion



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [make-initrd] [PATCH v1 00/41] fork pipeline
  2021-10-13 18:38                 ` Alexey Gladkov
@ 2021-10-13 18:48                   ` Leonid Krivoshein
  0 siblings, 0 replies; 16+ messages in thread
From: Leonid Krivoshein @ 2021-10-13 18:48 UTC (permalink / raw)
  To: make-initrd,
	Максим
	Князев



13.10.2021 21:38, Alexey Gladkov пишет:
> On Wed, Oct 13, 2021 at 08:06:02PM +0300, Leonid Krivoshein wrote:
>> Алексей, привет!
>>
>>
>> 27.09.2021 16:55, Alexey Gladkov пишет:
>>> On Mon, Sep 27, 2021 at 04:17:38PM +0300, Leonid Krivoshein wrote:
>>>> [...] Чтобы не тратить зря твоё время,
>>>> Антон предложил пропустить сначала через него, поскольку опыт с ним сам
>>>> говоришь, положительный.
>>> Если он не против, то я за )))
>> Извини за задержку. Долго болел, решали вопросы с логическим разделением на
>> коммиты и занимались README с переводами. Перевод на английский сделал
>> Максим Князев, его можно взять за основу, чтобы тебе меньше работы было, но
>> я не уверен в корректности перевода и пока не знаю, как учесть его участие.
>> Прилагаю финальные варианты README, а коммиты зашлю следующими письмами.
> Co-developed-by: Second Co-Author <second@coauthor.example.org>
> Signed-off-by: Second Co-Author <second@coauthor.example.org>
>
> ?

Понял, сделаю! Максим в cc:


-- 
Best regards,
Leonid Krivoshein.



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-10-13 18:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 15:52 [make-initrd] [PATCH v1 00/41] fork pipeline Leonid Krivoshein
2021-09-24 16:56 ` Alexey Gladkov
2021-09-24 18:42   ` Leonid Krivoshein
2021-09-24 19:06     ` Alexey Gladkov
2021-09-26 18:56       ` Leonid Krivoshein
2021-09-27  9:15         ` Alexey Gladkov
2021-09-27 13:17           ` Leonid Krivoshein
2021-09-27 13:55             ` Alexey Gladkov
2021-10-13 17:06               ` Leonid Krivoshein
2021-10-13 18:38                 ` Alexey Gladkov
2021-10-13 18:48                   ` Leonid Krivoshein
2021-09-24 19:08 ` Alexey Gladkov
2021-09-24 21:59   ` Leonid Krivoshein
2021-09-26 14:29     ` Alexey Gladkov
2021-09-26 20:09       ` Leonid Krivoshein
2021-09-27  9:23         ` Alexey Gladkov

Make-initrd development discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/make-initrd/0 make-initrd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 make-initrd make-initrd/ http://lore.altlinux.org/make-initrd \
		make-initrd@lists.altlinux.org make-initrd@lists.altlinux.ru make-initrd@lists.altlinux.com
	public-inbox-index make-initrd

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.make-initrd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git