Make-initrd development discussion
 help / color / mirror / Atom feed
From: Leonid Krivoshein <klark.devel@gmail.com>
To: make-initrd@lists.altlinux.org
Subject: Re: [make-initrd] Замена /var/run и /var/lock на симлинки, указываюшие на /run и /run/lock на стадии initrd
Date: Mon, 1 Jun 2026 01:17:01 +0300
Message-ID: <d91a5116-b758-4d6f-a9b7-bc8389726e75@gmail.com> (raw)
In-Reply-To: <ahyStc-gMyGmZ85H@example.org>

Всем привет!


On 5/31/26 10:57 PM, Alexey Gladkov wrote:
> On Sun, May 31, 2026 at 04:54:56PM +0300, Anton Midyukov wrote:
>> Доброго времени суток
>>
>> Необходимость замены  /var/run и /var/lock на симлинки, указываюшие на /run и /run/lock
>> уже давно перезрела. Начиная с p9, все новые системы являются мигрировавшими при их установке.
>> Но остаются системы, обновлявшиеся с p8, какие-то самодельные сборки, где эта миграция не выполнялась.
>>
>> Наверное, самый безопасный способ миграции таких систем - сделать это на этапе initrd.
>> В таком случае потребуется монтировать /var, если он на отдельном разделе.
>> А также потребуется монтировать систему на запись.
>> Видимо, это должна быть фича, которая добавляется в initrd автоматически, если /var/run или /var/lock
>> не являются симлинками.
>> Хотелось бы узнать, насколько это хорошая идея.
> 
> Технически это возможно. В момент initramfs можно добавить
> 
> MOUNTPOINTS += /var
> 
> тогда мы попробуем добавить всё необходимое для /var и попытаемся
> смонтировать его для системы. Далее нужно вызвать что-то вместо INIT,
> что сделало бы миграцию.
> 
> Когда-то давно я предлагал сделать фичу для обновлений, но в то время
> такая идея не вызвала интереса. Я предлагал сделать возможность вызова
> скрипта определённого имени из рута системы перед запуском INIT.
> 


А зачем? /sbin/init можно заменить для разовой операции, выполнить 
обновление из заменённого скрипта и вернуть всё обратно. Как-то так:

#!/bin/sh

T=/tmp/update.sh

if [ "$0" != "$T" ]; then
     cp -Lf -- "$0" "$T"
     exec $T "$@"
     exit 1
fi

# Doing update here...
...

# Restoring the original init
mv -f /sbin/init.old /sbin/init

# Call init or reboot
exec /sbin/init "$@"
exit 1


-- 
WBR, Leonid Krivoshein.



  reply	other threads:[~2026-05-31 22:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31 13:54 Anton Midyukov
2026-05-31 19:57 ` Alexey Gladkov
2026-05-31 22:17   ` Leonid Krivoshein [this message]
2026-06-01  6:44     ` Alexey Gladkov
2026-06-01  7:43       ` Anton Midyukov
2026-06-01  8:08         ` Alexey Gladkov
2026-06-01  8:18           ` Anton Midyukov
2026-06-01  9:01             ` Alexey Gladkov
2026-06-01 10:04               ` Anton Midyukov
2026-06-01 10:31                 ` Alexey Gladkov
2026-06-01 10:44                   ` Anton Midyukov
2026-06-01 11:32                     ` Alexey Gladkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d91a5116-b758-4d6f-a9b7-bc8389726e75@gmail.com \
    --to=klark.devel@gmail.com \
    --cc=make-initrd@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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