@@ -125,8 +125,7 @@ function outlong () {
125125}
126126
127127function logapterror() {
128- logtoboth " ? apt returned an error; review /etc/sdm/apt.log"
129- exit 1
128+ logtobothex " ? apt returned an error; review /etc/sdm/apt.log"
130129}
131130
132131function doapt() {
@@ -406,6 +405,11 @@ function doconfigitem() {
406405 # SUDO_USER=${myuser:-pi} raspi-config do_boot_behaviour $value nonint
407406 [ " $msgfun " == " bootlog" ] && do_raspiconfig do_boot_behaviour $value || setdelayedbbh " $value "
408407 ;;
408+ vnc_resolution)
409+ configitemlog " Set VNC resolution to '$value '" $msgfn
410+ # SUDO_USER=${myuser:-pi} raspi-config do_vnc_resolution $value nonint
411+ do_raspiconfig do_vnc_resolution $value nonint
412+ ;;
409413 powerled)
410414 ssys=0
411415 (grep -q " \\ [actpwr\\ ]" /sys/class/leds/led0/trigger > /dev/null 2>&1 ) && ssys=1
@@ -1562,7 +1566,7 @@ function expandpartition() {
15621566 fi
15631567 $msgrtn " * Mount $fulldevname to resize the root file system"
15641568 [ " $SDMPT " == " " ] && declare -x SDMPT=$( makemtpt)
1565- domount $fulldevname " Device"
1569+ domount $fulldevname " Device" " $SDMPT " $rootfstype
15661570 $msgrtn " * Resize the $rootfstype root file system"
15671571 $msgrtn " % (Ignore 'on-line resizing required' message)"
15681572 case " $rootfstype " in
@@ -1577,14 +1581,17 @@ function expandpartition() {
15771581 lvresize --extents 100%VG $( lvmfind $fulldevname vg) /$( lvmfind $fulldevname lv)
15781582 resize2fs $( lvmgetmapper $fulldevname )
15791583 ;;
1584+ zfs)
1585+ zpool online -e rpool sdb2
1586+ ;;
15801587 esac
15811588 # echo ",+" | sfdisk -N 2 $fulldevname
15821589 # errifrc $? "? sfdisk expand last partition failed with status"
15831590}
15841591
15851592function expandpartitionx() {
15861593 local rc
1587- expandpartition " $1 " " $2 " " $3 "
1594+ expandpartition " $1 " " $2 " " $3 " " $4 "
15881595 rc=$?
15891596 docleanup
15901597 return $rc
@@ -1707,9 +1714,10 @@ function domount() {
17071714 # $1: device name/IMG Name/directory name
17081715 # $2: "Directory" "IMG" or "Device"
17091716 # $3: mount point (D:$SDMPT)
1717+ # $4: fstype
17101718 # Tree will be mounted on the mountpoint, which must be set with makemtpt or makemtptX
17111719 #
1712- local dmimg=$1 imgtype=$2 mpoint=${3}
1720+ local dmimg=$1 imgtype=$2 mpoint=${3} fstype= $4
17131721 local p1=" 1" p2=" 2" pinfo csize bootstart bootsize rootstart rootsize mdir sts rootfsd lv=0 kf=" "
17141722
17151723 [ " $mpoint " == " " ] && mpoint=$SDMPT
@@ -1785,7 +1793,12 @@ function domount() {
17851793 errifrc $? " ? Cryptsetup failed to open ${dmimg}${p2} "
17861794 mount -v /dev/mapper/sdmcrypt $mpoint
17871795 else
1788- mount -v ${dmimg}${p2} $mpoint
1796+ if [ " $fstype " != " zfs" ]
1797+ then
1798+ mount -v ${dmimg}${p2} $mpoint
1799+ else
1800+ zfs mount rpool/ROOT/debian
1801+ fi
17891802 fi
17901803 fi
17911804 notmounted $mpoint && errexit " ? Error mounting device '$dmimg '"
@@ -1799,22 +1812,32 @@ function docleanup() {
17991812 #
18001813 # $1: if 'keep' (don't unset SDMPT)
18011814 local mnt=$SDMPT loopdev1 loopdev2 bp
1815+ local zfsp zfsmpt
1816+
1817+ zfsp=" $( type -p zfs) "
1818+ zfsmpt=" $( zfs list -o mountpoint -H rpool/ROOT/debian 2> /dev/null) "
18021819
18031820 for mnt in " ${SDMPT:-/ mnt/ sdm} " " $SDMPX "
18041821 do
18051822 if [ " $mnt " != " " ]
18061823 then
1807- # Find loop device names and delete them after dismounting if not automatically deleted
1808- [ -d $mnt /boot/firmware ] && bp=" $mnt /boot/firmware" || bp=" $mnt /boot"
1809- loopdev1=$( findmnt $bp --noheadings --output source)
1810- [ " $loopdev1 " != " /dev/loop1" ] && loopdev1=${loopdev1% p1}
1811- loopdev2=$( findmnt $mnt --noheadings --output source)
1812- loopdev2=${loopdev1% p2}
1813- ismounted $bp && umount -v $bp
1814- ismounted $mnt && umount -v $mnt
1815- [ " $loopdev1 " == " " ] || losetup --detach $loopdev1 > /dev/null 2>&1
1816- [ " $loopdev2 " == " " ] || losetup --detach $loopdev2 > /dev/null 2>&1
1817- [ " $fencrypted " == " 1" ] && cryptsetup luksClose /dev/mapper/sdmcrypt > /dev/null 2>&1
1824+ if [ " $zfsmpt " != " $mnt " ]
1825+ then
1826+ # Find loop device names and delete them after dismounting if not automatically deleted
1827+ [ -d $mnt /boot/firmware ] && bp=" $mnt /boot/firmware" || bp=" $mnt /boot"
1828+ loopdev1=$( findmnt $bp --noheadings --output source)
1829+ [ " $loopdev1 " != " /dev/loop1" ] && loopdev1=${loopdev1% p1}
1830+ loopdev2=$( findmnt $mnt --noheadings --output source)
1831+ loopdev2=${loopdev1% p2}
1832+ ismounted $bp && umount -v $bp
1833+ ismounted $mnt && umount -v $mnt
1834+ [ " $loopdev1 " == " " ] || losetup --detach $loopdev1 > /dev/null 2>&1
1835+ [ " $loopdev2 " == " " ] || losetup --detach $loopdev2 > /dev/null 2>&1
1836+ [ " $fencrypted " == " 1" ] && cryptsetup luksClose /dev/mapper/sdmcrypt > /dev/null 2>&1
1837+ else
1838+ umount -v /dev/sdb1
1839+ zfs unmount rpool/ROOT/debian
1840+ fi
18181841 fi
18191842 done
18201843 if [ " $1 " != " keep" ]
0 commit comments