Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow unionfs to be set as KCL option #3061

Closed
mavrothal opened this issue Apr 28, 2022 · 3 comments
Closed

allow unionfs to be set as KCL option #3061

mavrothal opened this issue Apr 28, 2022 · 3 comments

Comments

@mavrothal
Copy link
Contributor

Although #2963 is 8 weeks old and 4 weeks without further activity, I guess will be pulled at some point.
And since I find rebuilding the pup sfs too much work to change the layer filesystem, I have this little patch to make it a kernel command line option.
The patch is against the vanillaupup-22.04.32 init so it may not apply cleanly against the woof-CE tree for now.
But you get the idea!

--- a/init	2022-04-23 17:06:20.000000000 +0800
+++ b/init	2022-04-28 18:05:24.000000000 +0800
@@ -431,10 +431,16 @@
  if ! [ "$ONE_LAYER" ] ; then
    return 4 #sfs mount failed
  fi
- if [ -f $SFS_MP/etc/rc.d/PUPSTATE ]; then
-  . $SFS_MP/etc/rc.d/PUPSTATE
-  [ -n "$PUNIONFS" ] && UNIONFS="$PUNIONFS"
+ # make unionfs a kernel command line option
+ if [ ! "$punionfs" ]; then 
+  if [ -f $SFS_MP/etc/rc.d/PUPSTATE ]; then
+   . $SFS_MP/etc/rc.d/PUPSTATE
+   [ -n "$PUNIONFS" ] && UNIONFS="$PUNIONFS"
+  fi
+ else
+  UNIONFS="$punionfs"
  fi
+ 
  if [ "$UNIONFS" = 'overlay' ]; then
   remount_overlay -e "s~lowerdir=([^,]+)~lowerdir=${SFS_MP}:\1~" -e "s~lowerdir=,~lowerdir=${SFS_MP},~"
   [ $? -eq 0 ] || return 5
@@ -1115,6 +1121,10 @@
 mount
 echo --------------------
 
+# Inform the user for the layer system we use in case of multiple savefiles
+echo -en "$(printf "The layer file system is \\033[1;35m${UNIONFS}\\033[0;39m")" > /dev/console
+echo -e ' ' > /dev/console
+
 PUPSAVE=""
 if [ "${SAVE_MP}" != "" -a "$PRAMONLY" != "yes" ];then #have mounted save? partition
  #check if save partition is linux
@dimkr
Copy link
Contributor

dimkr commented Apr 29, 2022

Changing PUNIONFS is super dangerous, because whiteouts work differently between aufs and overlay!

(And initrd already prints the file system in use, see https://github.com/puppylinux-woof-CE/woof-CE/pull/2963/files#diff-10f6bca9f7b05a23796c659a01bca009790e1bab43c0bd24ab8506840ac6c0c3R45)

@mavrothal
Copy link
Contributor Author

That's why the unionfs is printing nice and purple so I know which savefolder/file to use and do not mess up the whiteouts 😉

@mavrothal
Copy link
Contributor Author

...but beyond "childproofing" concerns, I have no problem using the same savefile/folder for the aufs and the overlayfs, as the file structure is quite distinct and file, folder and whiteout locations do not mixup without radical user intervention.

The "problem" starts when I try to use the same pupsave/ usr/ and var/../apt/ folders ( 😮 ) so packages installed under one layerfs system will be available in the other too to avoid duplication.
(In the puppy tradition looks like a "good fun", though I would agree inappropriate).
But symlinking, leads to kernel panic in one or the other layerfs. Any ideas for that"inappropriate" set up?

dimkr added a commit to dimkr/woof-CE that referenced this issue Jul 5, 2022
@dimkr dimkr closed this as completed Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants