Skip to content

Commit

Permalink
fastusr feature
Browse files Browse the repository at this point in the history
  • Loading branch information
limetech committed Jan 23, 2025
1 parent b3e355b commit 71a85f0
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions etc/rc.d/rc.S
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,10 @@ bzcheck(){
}

bzmount(){
local BZFILE=$1
local MNTDIR=$2
bzcheck $BZFILE
/bin/mkdir -p /$MNTDIR
/sbin/mount -v -r -t squashfs /boot/$BZFILE /$MNTDIR || abort "cannot mount $BZFILE"
local BZDIR=$1
local BZFILE=$2
local MNTDIR=$3
/sbin/mount -v -r -t squashfs /$BZDIR/$BZFILE /$MNTDIR || abort "cannot mount /$BZDIR/$BZFILE"
# setup an overlayfs
/bin/mkdir -p /var/local/overlay/$MNTDIR
/bin/mkdir -p /var/local/overlay-work/$MNTDIR
Expand All @@ -145,9 +144,15 @@ if [[ $UNRAIDROOT == "" ]]; then
bzcheck "bzimage"
bzcheck "bzroot"
bzcheck "bzroot-gui"

bzmount "bzmodules" "lib"
bzmount "bzfirmware" "usr"
bzcheck "bzmodules"
bzcheck "bzfirmware"
if [[ -f /boot/config/fastusr ]]; then
/bin/cp /boot/bzfirmware /usr
bzmount "usr" "bzfirmware" "usr"
else
bzmount "boot" "bzfirmware" "usr"
fi
bzmount "boot" "bzmodules" "lib"

# now that /usr is mounted make /etc/rc.d a symlink
/bin/rm -rf /etc/rc.d
Expand Down

0 comments on commit 71a85f0

Please sign in to comment.