OverlayFS Porteus

Here is a place for your projects which are not officially supported by the Porteus Team. For example: your own kernel patched with extra features; desktops not included in the standard ISO like Gnome; base modules that are different than the standard ISO, etc...
neko
DEV Team
DEV Team
Posts: 1663
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

OverlayFS Porteus

Post#1 by neko » 25 Aug 2020, 10:59

Trial version of OverlayFS Porteus

1.Restriction of specifications
1.1. The "EXIT" of cheatcode "changes=EXIT" will be ignored.
That is that "changes=EXIT" is same as "changes".
1.2. Activated XZMs during booting can not be deactivated.
1.3. The functions that are concerned with the cheatcode "changes" are not maintained nor cared.

2.Implementation
2.1. replacement (update)
(1) "cleanup" in ISO/boot/syslinux/initrd.xz
delete the steps that are concerned with the cheatcode "changes=EXIT".
(2) "finit" in ISO/boot/syslinux/initrd.xz
add the functions and steps that are concerned with the "OverlayFS mount".
(3) "linuxrc" in ISO/boot/syslinux/initrd.xz
update the steps that are concerned with the "AUFS mount" and the cheatcode "changes".

2.1. additional
introduce the new module "001-overlay.xzm" into ISO/porteus/base.
(1)001-overlay.xzm@opt/porteus-scripts/xorg/aufs-insert
patch to the current aufs-insert.
(2)001-overlay.xzm@opt/porteus-scripts/xorg/aufs-remove
patch to the current aufs-remove.
(1)001-overlay.xzm@opt/porteus-scripts/xorg/ov.act.sh
new shell script that will perform "activate" without AUFS.
(1)001-overlay.xzm@opt/porteus-scripts/xorg/ov.deact.sh
new shell script that will perform "deactivate" without AUFS.

3.Tool
atool.xzm@usr/local/sbin has shell scripts as followed.

conf.xz:......update configs in disassemble ISO file to initrd.xz
conf.zstd:....update configs in disassemble ISO file to initrd.zstd
dINIT:..........disassemble xz compressed initrd.xz
dINIT.zstd:..disassemble zstd compressed initrd.zstd
dISO:............disassemble ISO file
dXZM:..........disassemble XZM file
mkINIT:........make xz compressed initrd.xz
mkINIT.zstd:.....make zstd compressed initrd.zstd
mkISO:...............make ISO file
mkXZM:.............make xz compressed XZM file
mkXZM.zstd:.....make zstd compressed XZM file
sqFScmp:...........anlyze which xz or zstd compressed XZM file was made with


Note:
Introducing OverlayFS into Porteus is under developing yet.
So it might have some bugs.

---------------------------------
ISOs updated with Current OVFS kernel:
Porteus-KDE-v5.0rc2-k5.10rc1-x86_64.iso (571 M)
http://www.mediafire.com/file/8fnv1pxte ... x86_64.iso
md5sum: 658f4a6706c4b2d775c78a7212edad9d Porteus-KDE-v5.0rc2-k5.10rc1-x86_64.iso

Porteus-XFCE-v5.0rc2-k5.10rc1-x86_64.iso (478 M)
http://www.mediafire.com/file/pmnu4i8yr ... x86_64.iso
md5sum: 4b224ce29c473a5d229f9e8cde6fc12b Porteus-XFCE-v5.0rc2-k5.10rc1-x86_64.iso


kernel: 5.10-rc1 without AUFS patch. Kernel 5.10-rc1 has a trouble of sound.
firefox 82.0

---------------------------------
Note: The operation explanation was performed with kernel 5.9-rc5.

This ISO includes a tool module "atool.xzm".

Code: Select all

% su
# ls
Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64.iso
# mloop Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64.iso
# cp /mnt/loop/porteus/modules/atool.xzm .
# uloop
# activate atool.xzm

Code: Select all

% su
# ls
Porteus-KDE-v5.0rc2-x86_64.iso
Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64.iso
# dISO Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64.iso
# ls
Porteus-KDE-v5.0rc2-x86_64.iso
Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64
Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64.iso
"cleanup", "finit", "linuxrc"

Code: Select all

# dINIT.zstd Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64/boot/syslinux/initrd.zstd
# cat initrd/cleanup
# cat initrd/finit
# cat initrd/linuxrc
"aufs-insert", "aufs-remove", "ov.act.sh", "ov.deact.sh"

Code: Select all

# dXZM Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64/porteus/base/001-overlay.xzm
# cat 001-overlay/opt/porteus-scripts/xorg/aufs-insert
# cat 001-overlay/opt/porteus-scripts/xorg/aufs-remove
# cat 001-overlay/opt/porteus-scripts/xorg/ov.act.sh
# cat 001-overlay/opt/porteus-scripts/xorg/ov.deact.sh
convert AUFS ISO to OVERLYFS ISO (including AUFS but not use): OV.Porteus-KDE-v5.0rc2-x86_64.iso

Code: Select all

# mkXZM 001-overlay
# mkINIT initrd
# dISO Porteus-KDE-v5.0rc2-x86_64.iso
# mv initrd.xz Porteus-KDE-v5.0rc2-x86_64/boot/syslinux/
# mv 001-overlay.xzm Porteus-KDE-v5.0rc2-x86_64/porteus/base/
# mv Porteus-KDE-v5.0rc2-x86_64 OV.Porteus-KDE-v5.0rc2-x86_64
# mkISO OV.Porteus-KDE-v5.0rc2-x86_64
kernel update 5.9-rc5: (all modules are xz compressed yet): OV.Porteus-KDE-v5.0rc2-k5.9rc5-x86_64.iso

Code: Select all

# cp Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64/boot/syslinux/vmlinuz OV.Porteus-KDE-v5.0rc2-x86_64/boot/syslinux/
# dXZM Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64/porteus/base/000-kernel.xzm
# mkXZM 000-kernel
# mv 000-kernel.xzm OV.Porteus-KDE-v5.0rc2-x86_64/porteus/base/
# mv OV.Porteus-KDE-v5.0rc2-x86_64 OV.Porteus-KDE-v5.0rc2-k5.9rc5-x86_64
# mkISO OV.Porteus-KDE-v5.0rc2-k5.9rc5-x86_64
kernel update 5.9-rc5: (all modules are zst compressed): Porteus-KDE-v5.0rc2-k5.9rc5-x86_64.iso

Code: Select all

# cp Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64/boot/syslinux/initrd.zstd OV.Porteus-KDE-v5.0rc2-k5.9rc5-x86_64/boot/syslinux/
# rm OV.Porteus-KDE-v5.0rc2-k5.9rc5-x86_64/boot/syslinux/initrd.xz
# conf.zstd OV.Porteus-KDE-v5.0rc2-k5.9rc5-x86_64
# cp Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64/porteus/base/00[012]* OV.Porteus-KDE-v5.0rc2-k5.9rc5-x86_64/porteus/base/
# dXZM OV.Porteus-KDE-v5.0rc2-k5.9rc5-x86_64/porteus/base/003-kde5.xzm
# mkXZM.zstd 003-kde5
# mv 003-kde5.xzm OV.Porteus-KDE-v5.0rc2-k5.9rc5-x86_64/porteus/base/
# mv OV.Porteus-KDE-v5.0rc2-k5.9rc5-x86_64 Porteus-KDE-v5.0rc2-k5.9rc5-x86_64
# mkISO Porteus-KDE-v5.0rc2-k5.9rc5-x86_64

Thanks.

-----------------------------------------
[updated on 2020.08.31] kernel of Porteus-XFCE-v5.0rc2-k5.9rc3-x86_64.iso was updated to 5.9-rc3.
[updated on 2020.09.07] kernel of Porteus-XFCE-v5.0rc2-k5.9rc4-x86_64.iso was updated to 5.9-rc4.
[updated on 2020.09.15] kernel of Porteus-XXXX-v5.0rc2-k5.9rc5-x86_64.iso was updated to kernel 5.9-rc5.
[updated on 2020.09.21] kernel of Porteus-XXXX-v5.0rc2-k5.9rc6-x86_64.iso was updated to 5.9-rc6.
[updated on 2020.09.28] kernel of Porteus-XXXX-v5.0rc2-k5.9rc7-x86_64.iso was updated to 5.9-rc7.
[updated on 2020.10.05] kernel of Porteus-XXXX-v5.0rc2-k5.9rc8-x86_64.iso was updated to 5.9-rc8.
[updated on 2020.10.13] kernel of Porteus-XXXX-v5.0rc2-k5.9.OV-x86_64.iso was updated to 5.9.
[updated on 2020.10.18] kernel of Porteus-XXXX-v5.0rc2-k5.9.1-x86_64.iso was updated to 5.9.1.
[updated on 2020.10.26] kernel of Porteus-XXXX-v5.0rc2-k5.10rc1-x86_64.iso was updated to 5.10-rc1.

User avatar
babam
Samurai
Samurai
Posts: 133
Joined: 16 Nov 2016, 10:30
Distribution: Porteus Xfce 3.2.2
Location: Rainy city

OverlayFS Porteus

Post#2 by babam » 26 Aug 2020, 14:52

Hi neko,
Does it also support Aufs?
If yes, which is better to activate new modules with Aufs or Overlayfs.
Sorry, my English is bad.

neko
DEV Team
DEV Team
Posts: 1663
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

OverlayFS Porteus

Post#3 by neko » 27 Aug 2020, 05:44

@babam
"Does it also support Aufs?"
---->
No, this implementation is only for OverlayFS.

If a kernel can be built with AUFS, it is much better to use the AUFS kernel.


Thanks.
-------------------------
[integrate initrd]
1. initrd.xz of original Porteus 5.0rc2
is only for AUFS.

2. initrd.zstd of Porteus-XFCE-v5.0rc2-k5.9rcN-x86_64.iso (64Bit Kernel 5.9-rcN without AUFS)
is only for OVFS.

3. initrd.xz of CROSS.Porteus-MATE-v4.0-k5.8.13-i586.iso (followed exaple ISO)
is integrated with
one for AUFS Porteus,
one for OVFS Porteus,
one for AUFS APorteus,
and
one for OVFS APorteus.

------------------------------
[Integrated initrd can make "32Bit Porteus" running under "64Bit AUFS kernel"]
CROSS.Porteus-MATE-v4.0-k5.4.72-i586.iso (409 M)
http://www.mediafire.com/file/a9rgk04ao ... 2-i586.iso
md5sum: c1311b07478ddabec5e35dfefdf09105 CROSS.Porteus-MATE-v4.0-k5.4.72-i586.iso

This ISO is Porteus-MATE-v4.0-i586 running on 64Bit Kernel 5.4.72 with AUFS.
Firefox version 81.0.1 is included.


Thanks.


-----------------------------------
[updated on 2020.08.28] CROSS.Porteus-XFCE-v4.0-k5.8.5-i586.iso is updated from k5.8.4.
[updated on 2020.09.03] CROSS.Porteus-XFCE-v4.0-k5.8.6-i586.iso is updated from k5.8.5.
[updated on 2020.09.05] CROSS.Porteus-XFCE-v4.0-k5.8.7-i586.iso is updated from k5.8.6.
[updated on 2020.09.07] Porteus-XFCE-v5.0rc2-k5.9rc4-x86_64.iso is updated from k5.9-rc3.
[updated on 2020.09.10] CROSS.Porteus-XFCE-v4.0-k5.8.8-i586.iso is updated from k5.8.7.
[updated on 2020.09.13] CROSS.Porteus-XFCE-v4.0-k5.8.9-i586.iso is updated from k5.8.8.
[updated on 2020.09.15] Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64.iso is updated from k5.9-rc4.
[updated on 2020.09.18] CROSS.Porteus-XFCE-v4.0-k5.8.10-i586.iso is updated from k5.8.9.
[updated on 2020.09.24] CROSS.Porteus-XFCE-v4.0-k5.8.11-i586.iso is updated from k5.8.10.
[updated on 2020.09.27] CROSS.Porteus-XFCE-v4.0-k5.8.12-i586.iso is updated from k5.8.11.
[updated on 2020.10.02] new add CROSS.Porteus-MATE-v4.0-k5.8.13-i586.iso, delete CROSS.Porteus-XFCE-v4.0-k5.8.12-i586.iso
[updated on 2020.10.08] CROSS.Porteus-MATE-v4.0-k5.8.14-i586.iso is updated to kernel 5.8.14.
[updated on 2020.10.18] CROSS.Porteus-MATE-v4.0-k5.4.72-i586.iso is updated to kernel 5.4.72.

burdi01
Samurai
Samurai
Posts: 129
Joined: 18 Aug 2013, 12:09
Distribution: Slackware, Xubuntu
Location: The Netherlands

OverlayFS Porteus

Post#4 by burdi01 » 03 Sep 2020, 08:51

@neko:
If a kernel can be built with AUFS, it is much better to use the AUFS kernel.
Would you be so kind as to elaborate? I am using overlayfs for several years now and imho it is at least on par with aufs.
:D

neko
DEV Team
DEV Team
Posts: 1663
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

OverlayFS Porteus

Post#5 by neko » 03 Sep 2020, 10:13

@burdi01
The most advantage of AUFS is an activate/deactivate function.
I implement that funcion under OverlayFS with "ln -sf" command.
I could not implement that funcion under OverlayFS with "mount" commnad.

Please refer to the top article.
OverlayFS Porteus (Post by neko #78485)
001-overlay/opt/porteus-scripts/xorg/aufs-insert
001-overlay/opt/porteus-scripts/xorg/aufs-remove
001-overlay/opt/porteus-scripts/xorg/ov.act.sh
001-overlay/opt/porteus-scripts/xorg/ov.deact.sh

You are using overlayfs for several years.
Would you tell me how to implement the activate/deactivate function ?

Thanks.

User avatar
babam
Samurai
Samurai
Posts: 133
Joined: 16 Nov 2016, 10:30
Distribution: Porteus Xfce 3.2.2
Location: Rainy city

OverlayFS Porteus

Post#6 by babam » 04 Sep 2020, 04:08

neko wrote:
03 Sep 2020, 10:13
The most advantage of AUFS is an activate/deactivate function.
I implement that funcion under OverlayFS with "ln -sf" command.
I could not implement that funcion under OverlayFS with "mount" commnad.
Can you please explain how to activate/deactivate a module using the command "ln - sf" under OverlayFS.

Thanks.
Sorry, my English is bad.

neko
DEV Team
DEV Team
Posts: 1663
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

OverlayFS Porteus

Post#7 by neko » 04 Sep 2020, 07:24

@babam
If you have a time to read shell scripts, please refer to the top article.
OverlayFS Porteus (Post by neko #78485)
001-overlay/opt/porteus-scripts/xorg/aufs-insert
001-overlay/opt/porteus-scripts/xorg/aufs-remove
001-overlay/opt/porteus-scripts/xorg/ov.act.sh
001-overlay/opt/porteus-scripts/xorg/ov.deact.sh

Thanks.

----------------------------------------------------------------
1.prepare tools

Code: Select all

% su
# ls
Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64.iso
# mloop Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64.iso
# cp /mnt/loop/porteus/modules/atool.xzm .
# activate atool.xzm
2.how to switch to OVFS or AUFS

Code: Select all

# dXZM /mnt/loop/porteus/base/001-core.xzm
# dXZM /mnt/loop/porteus/base/001-overlay.xzm
# uloop
#
#
# diff 001-core/opt/porteus-scripts/xorg/aufs-insert 001-overlay/opt/porteus-scripts/xorg/
23,26c23,26
< if [ "`grep '^aufs / ' /proc/mounts`" = "" ]; then
<     echo "Not in the live mode, can't continue. Try xzm2dir $1 /"
<     exit 2
< fi
---
> #if [ "`grep '^aufs / ' /proc/mounts`" = "" ]; then
> #    echo "Not in the live mode, can't continue. Try xzm2dir $1 /"
> #    exit 2
> #fi
28c28
< if [ ! -f "$targetmod" ]; then
---
> if [ ! -f $targetmod ]; then
33,37c33
< LOADEDMODULES=$(cat /proc/mounts | cut -d" " -f2)
< LOADEDMODULES=${LOADEDMODULES//040/}
< LOADEDMODULES=${LOADEDMODULES//\\/ } 
< 
< if [[ "$LOADEDMODULES" =~ "$MOD" ]]; then
---
> if cat /proc/mounts | cut -d" " -f2 | grep -q "$MOD"; then
63c59,63
< mount -no remount,add:1:"$MOD"=rr aufs /
---
> if [ "`grep '^aufs / ' /proc/mounts`" = "" ]; then
> 	/opt/porteus-scripts/xorg/ov.act.sh $BASE
> else
> 	mount -no remount,add:1:"$MOD"=rr aufs /
> fi
(1)delete "only AUFS case"
23,26c23,26
< if [ "`grep '^aufs / ' /proc/mounts`" = "" ]; then
< echo "Not in the live mode, can't continue. Try xzm2dir $1 /"
< exit 2
< fi
---
> #if [ "`grep '^aufs / ' /proc/mounts`" = "" ]; then
> # echo "Not in the live mode, can't continue. Try xzm2dir $1 /"
> # exit 2
> #fi
(2)OVFS case, call /opt/porteus-scripts/xorg/ov.act.sh.
33,37c33
< LOADEDMODULES=$(cat /proc/mounts | cut -d" " -f2)
< LOADEDMODULES=${LOADEDMODULES//040/}
< LOADEDMODULES=${LOADEDMODULES//\\/ }
<
< if [[ "$LOADEDMODULES" =~ "$MOD" ]]; then
---
> if cat /proc/mounts | cut -d" " -f2 | grep -q "$MOD"; then
63c59,63
< mount -no remount,add:1:"$MOD"=rr aufs /
---
> if [ "`grep '^aufs / ' /proc/mounts`" = "" ]; then
> /opt/porteus-scripts/xorg/ov.act.sh $BASE
> else
> mount -no remount,add:1:"$MOD"=rr aufs /
> fi

Code: Select all

# diff 001-core/opt/porteus-scripts/xorg/aufs-remove 001-overlay/opt/porteus-scripts/xorg/
38c38
< [ -e "$MOD"/usr/share/applications ] && desktop=`find "$MOD"/usr/share/applications -name "*.desktop" 2>/dev/null`
---
> [ -e "$MOD"/usr/share/applications ] && desktop=`find $MOD/usr/share/applications -name "*.desktop" 2>/dev/null`
49c49,53
< mount -t aufs -o remount,del:"$MOD" aufs / 2>/dev/null
---
> if [ "`grep '^aufs / ' /proc/mounts`" = "" ]; then
> 	/opt/porteus-scripts/xorg/ov.deact.sh $targetmod
> else
> 	mount -t aufs -o remount,del:"$MOD" aufs / 2>/dev/null
> fi
62c66
< [ `losetup -a | grep "$1" | cut -d: -f1` ] && losetup -d `losetup -a | grep "$1" | cut -d: -f1`
---
> [ `losetup -a | grep $1 | cut -d: -f1` ] && losetup -d `losetup -a | grep $1 | cut -d: -f1`
(1)OVFS case, call /opt/porteus-scripts/xorg/ov.deact.sh.
49c49,53
< mount -t aufs -o remount,del:"$MOD" aufs / 2>/dev/null
---
> if [ "`grep '^aufs / ' /proc/mounts`" = "" ]; then
> /opt/porteus-scripts/xorg/ov.deact.sh $targetmod
> else
> mount -t aufs -o remount,del:"$MOD" aufs / 2>/dev/null
> fi
3.how to implement activate function under OVFS by using "ln -sf" command

Code: Select all

# cat 001-overlay/opt/porteus-scripts/xorg/ov.act.sh
#!/bin/sh

LOOPMNT=/mnt/live/memory/images
#LOOPMNT=/mnt

STACK=/mnt/live/tmp/stack
#STACK=/mnt/sda3/init/stack

expand()
{
local SAVE=$LANG
export LANG=C

find $LOOPMNT/$1/ | sed -e "s@$LOOPMNT/$1/@@" | sed -e "/^$/d"

export LANG=$SAVE
}

#=== START ===#
PKG=$1

if [ ! -d $STACK ]
then
	mkdir -p $STACK
fi

if [ -f $STACK/$PKG ]
then
	echo "already activate $PKG"
	exit 1
fi

#=== STEP 1 対象ピックアップ ===#
SKIP=""
LEN=0
for i in `expand $PKG`
do
	DEST="/${i%/*}"
	OBJ=${i##*/}

	if [ -n "$SKIP" ]
	then
		if [ "${i:0:$LEN}" = $SKIP ]
		then
		# 新規ディレクトリ内実態 #
			continue
		fi
		SKIP=""
	fi

	if [ -f $DEST/.act.new.$OBJ ]
	then
	# 同一実態へ別ACT重なり #
	# 前のACTの当重なり実態を無効化 #
		rm /$i
		rm $DEST/.act.new.$OBJ
		if [ -e $DEST/.act.org.$OBJ ]
		then
			mv $DEST/.act.org.$OBJ /$i
		fi
	fi 

	if [ -d $LOOPMNT/$PKG/$i ]
	then
	# ディレクトリをシンボリックリンクする #
	#--- directory ---#
		if [ -d /$i ]
		then
		# 元の実態はディレクトリ #
			continue
		fi
		# 新規ディレクトリ処理 #
		echo $i >> $STACK/$PKG
		SKIP=$i
		LEN=${#SKIP}
		continue
	fi
	echo $i >> $STACK/$PKG
done
	
#=== STEP 2 シンボリックリンク設定 ===#
if [ ! -f $STACK/$PKG ]
then
	exit 0
fi
for i in `cat $STACK/$PKG`
do
	DEST="/${i%/*}"
	OBJ=${i##*/}

	if [ -e /$i ]
	then
	# シンボリックリンク対象先に既に実態有り #
		mv /$i $DEST/.act.org.$OBJ
	fi

	# シンボリックリンク設定 #
	touch $DEST/.act.new.$OBJ
	ln -sf $LOOPMNT/$PKG/$i $DEST/.

done
	
exit 0	
4.how to implement deactivate function under OVFS by using "rm" & "mv" commands

Code: Select all

# cat 001-overlay/opt/porteus-scripts/xorg/ov.deact.sh
#!/bin/sh

LOOPMNT=/mnt/live/memory/images
#LOOPMNT=/mnt

STACK=/mnt/live/tmp/stack
#STACK=/mnt/sda3/init/stack


PKG=$1
#PKG=loop

if [ ! -f $STACK/$PKG ]
then
	echo "activated $PKG at boot"
	exit 1
fi
for i in `cat $STACK/$PKG`
do
	DEST="/${i%/*}"
	OBJ=${i##*/}
	if [ -f $DEST/.act.new.$OBJ ]
	then
	# シンボリックリンク設定処理有り #
		if [ -h /$i ]
		then
		# 設定したシンボリックリンク有り #
			rm -fr /$i
			rm $DEST/.act.new.$OBJ
			if [ -e $DEST/.act.org.$OBJ ]
			then
			# 元実態が有りセーブされている #
				mv $DEST/.act.org.$OBJ /$i
			fi
			# 正常ケース #
			continue
		fi

		if [ ! -e /$i ]
		then
		# 不正ケース 1 #
		# 何も無い #
			rm $DEST/.act.new.$OBJ
			if [ -e $DEST/.act.org.$OBJ ]
			then
			# 元実態が有りセーブされている #
				mv $DEST/.act.org.$OBJ /$i
			fi
			continue
		fi
		
		# 不正ケース 2 #
		# 設定したシンボリックリンク以外の物が有り #
		if [ -e $DEST/.act.org.$OBJ ]
		then
		# 元実態が有りセーブされている #
			rm -fr /$i
			mv $DEST/.act.org.$OBJ /$i
		fi
		rm $DEST/.act.new.$OBJ
		continue
	fi

	# 不正ケース 3 #
	# シンボリックリンク設定処理無し #
	if [ -e $DEST/.act.org.$OBJ ]
	then
	# 元実態が有りセーブされている #
		rm -fr /$i
		mv $DEST/.act.org.$OBJ /$i
	fi
done

rm $STACK/$PKG
	
exit 0	
Note:
Please read original
001-core/opt/porteus-scripts/xorg/aufs-insert and 001-core/opt/porteus-scripts/xorg/aufs-remove
first.

burdi01
Samurai
Samurai
Posts: 129
Joined: 18 Aug 2013, 12:09
Distribution: Slackware, Xubuntu
Location: The Netherlands

OverlayFS Porteus

Post#8 by burdi01 » 04 Sep 2020, 08:43

@neko: The following is an excerpt from my email to the PartedMagic BDFL:
Patrick:

Indeed the problem with overlayfs as compared to aufs is that it is not possible to add bundles (.sqfm) to a running overlay file system. Ideally therefore one should include all bundles when the overlay file system is created.

I subdivide the bundles in three categories: always, sometimes and ad-hoc:
-- always: the bundles in /pmagic/pmodules/ are always included by init;
-- sometimes: the bundles in /pmagic/optionals/ are included by init when they are referenced in the "oload" kernel boot parameter *);
-- ad-hoc: /usr/bin/pmagic_load_sqfm "untars" its arguments just as is done with packages (.t?z) **).

*) On memory restrained boxes one might not always want to load "biggies" like libreoffice, gimp or vlc. Note that init's features are rather limited, hence the /pmagic/optionals/ requirement.

**) One might want to try a "wild" bundle downloaded from somewhere -- e.g. a Porteus bundle (.xzm). Or test the bundle one is developing.

The above is implemented in:
-- initrd/init - see above;
-- /etc/rc.d/rcS - comment out the sqfmlist() invocations;
-- /usr/bin/pmagic_load - see above;
-- /usr/bin/pmagic_save_session - create the 099-saved-session.sqfm file.
Deactivation is not implemented - I do not see a reason for it, just reboot if applicable.
:D

neko
DEV Team
DEV Team
Posts: 1663
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

OverlayFS Porteus

Post#9 by neko » 04 Sep 2020, 11:22

@burdi01
First, please understand that I mention about Porteus(/APorteus).

1.OverlayFS Porteus (Post by neko #78517)
If a kernel can be built with AUFS, it is much better to use the AUFS kernel.
--->
If a kernel can be built with AUFS, it is much better to use the AUFS kernel for Porteus's usage.

2.OverlayFS Porteus (Post by neko #78607)
You are using overlayfs for several years.
Would you tell me how to implement the activate/deactivate function ?
---> (my misunderstood)
You are using overlayfs in Porteus system for several years.
Would you tell me how to implement the activate/deactivate function in Porteus ?

------------------------------
Your kind answer is helpfull for introducing overlayFS into Porteus.
It is that a changing usage specification might make overlayFS useful as same as AUFS.


Thanks.

burdi01
Samurai
Samurai
Posts: 129
Joined: 18 Aug 2013, 12:09
Distribution: Slackware, Xubuntu
Location: The Netherlands

OverlayFS Porteus

Post#10 by burdi01 » 04 Sep 2020, 13:54

Aah, I see the misunderstanding now:
I understood your remark "If a kernel can be built with AUFS, it is much better to use the AUFS kernel" as a non-distribution-specific remark, so when I said "I am using overlayfs for for several years now" I meant that as a non-distribution-specific remark too ...

PartedMagic (PM for short) is a Slackware-based live CD just as Porteus is - though for a different use case. IMHO including the "sometimes" bundles at overlayfs creation time makes activating/loading the "ad-hoc" bundles a rare event. But YMMV ...
:D

User avatar
babam
Samurai
Samurai
Posts: 133
Joined: 16 Nov 2016, 10:30
Distribution: Porteus Xfce 3.2.2
Location: Rainy city

OverlayFS Porteus

Post#11 by babam » 04 Sep 2020, 15:31

neko,
I am afraid to activate/deactivate the modules under Overlayfs when in persistence mode.

I'm afraid it will overwrite (ln -sf) and delete (rm -fr) files/directories that are contained in the persistent file (save.dat) or persistent device (e.g. /dev/sdb2).

Thanks.
Sorry, my English is bad.

neko
DEV Team
DEV Team
Posts: 1663
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

OverlayFS Porteus

Post#12 by neko » 04 Sep 2020, 15:52

@babam
Please try Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64.iso with persistence mode.
It will make your afraid clear.

Thanks.

User avatar
babam
Samurai
Samurai
Posts: 133
Joined: 16 Nov 2016, 10:30
Distribution: Porteus Xfce 3.2.2
Location: Rainy city

OverlayFS Porteus

Post#13 by babam » 04 Sep 2020, 16:16

neko,
If I have '/bin/foo' (located inside a persistent device) then I activate a module which also contains '/bin/foo' will that overwrite (ln -sf) '/bin/foo'?

Update:
That will rename '/bin/foo' to '/bin/.act.org.foo'

Don't forget to deactivate that module before shutdown/reboot to restore '/bin/.act.org.foo' to '/bin/foo'

Thanks.
Sorry, my English is bad.

neko
DEV Team
DEV Team
Posts: 1663
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

OverlayFS Porteus

Post#14 by neko » 06 Sep 2020, 01:23

@babam
Would you tell me the result of "Please try Porteus-XFCE-v5.0rc2-k5.9rc5-x86_64.iso with persistence mode.".

Thanks.

User avatar
babam
Samurai
Samurai
Posts: 133
Joined: 16 Nov 2016, 10:30
Distribution: Porteus Xfce 3.2.2
Location: Rainy city

OverlayFS Porteus

Post#15 by babam » 06 Sep 2020, 03:15

neko,
Activating modules in persistence mode is works fine.

But we have to deactivate the modules before shutdown/reboot to restore them to their original state (removing symlinks and .act.new.* and restore .act.org.* to original name).

Thanks.
Sorry, my English is bad.

Post Reply