1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Shell script to manage ZFS boot environments
8 HOMEPAGE= https://github.com/vermaden/beadm
9 CONTACT= Michael_Reim[kraileth@elderlinux.org]
12 SITES[main]= GITHUB/vermaden:beadm:1.2.7
13 DISTFILE[1]= generated:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
20 ONLY_FOR_OPSYS= freebsd
22 LICENSE= BSD2CLAUSE:single
23 LICENSE_FILE= BSD2CLAUSE:{{WRKDIR}}/LICENSE
26 FPC_EQUIVALENT= sysutils/beadm
31 head -n 26 beadm | tail -n 24 > ${WRKSRC}/LICENSE
34 ${INSTALL_SCRIPT} ${WRKSRC}/beadm ${STAGEDIR}${PREFIX}/sbin
35 ${INSTALL_MAN} ${WRKSRC}/beadm.1 ${STAGEDIR}${PREFIX}/share/man/man1
37 [FILE:130:descriptions/desc.single]
38 Beadm is a utility for managing ZFS Boot Environments in an
39 Illumos/Solaris-like way on FreeBSD. It's written as a shell script.
43 6982b4d495d954d971470a1b3bcc8bf886e0a412fdf70c034dbaf74f9216f866 14924 vermaden-beadm-1.2.7.tar.gz
46 [FILE:37:manifests/plist.single]
48 share/man/man1/beadm.1.gz
51 [FILE:4208:patches/patch-beadm]
52 --- beadm.orig 2017-01-13 23:25:44 UTC
54 @@ -128,6 +128,24 @@ __be_new() { # 1=SOURCE 2=TARGET
57 local SOURCE=$( echo ${1} | cut -d '@' -f 1 )
59 + # secure current /boot/entropy file
60 + if [ -f /boot/entropy ]
62 + if ! cp -p /boot/entropy /boot/entropy.OLD 1> /dev/null 2> /dev/null
64 + echo "ERROR: Can not copy current '/boot/entropy' file"
69 + # create new /boot/entropy file that would be used in new boot environment
70 + if ! dd if=/dev/random of=/boot/entropy bs=4096 count=1 1> /dev/null 2> /dev/null
72 + echo "ERROR: Can not generate new '/boot/entropy' file"
75 + # create snapshot that will be used as a base for new boot environment
78 # create boot environment from snapshot
79 @@ -138,6 +156,13 @@ __be_new() { # 1=SOURCE 2=TARGET
80 if ! zfs list -H -o name ${FS}@${SNAPSHOT} 1> /dev/null 2> /dev/null
82 echo "ERROR: Child snapshot '${FS}@${SNAPSHOT}' does not exist"
83 + if [ ${ENTROPY} -ne 0 ]
85 + if ! mv /boot/entropy.OLD /boot/entropy 1> /dev/null 2> /dev/null
87 + echo "WARNING: Can not bring back original '/boot/entropy' file"
93 @@ -146,6 +171,13 @@ __be_new() { # 1=SOURCE 2=TARGET
94 if zfs list -H -o name ${1}@${2##*/} 1> /dev/null 2> /dev/null
96 echo "ERROR: Snapshot '${1}@${2##*/}' already exists"
97 + if [ ${ENTROPY} -ne 0 ]
99 + if ! mv /boot/entropy.OLD /boot/entropy 1> /dev/null 2> /dev/null
101 + echo "WARNING: Can not bring back original '/boot/entropy' file"
107 @@ -153,9 +185,25 @@ __be_new() { # 1=SOURCE 2=TARGET
108 if ! zfs snapshot -r ${1}@${FMT} 1> /dev/null 2> /dev/null
110 echo "ERROR: Cannot create snapshot '${1}@${FMT}'"
111 + if [ ${ENTROPY} -ne 0 ]
113 + if ! mv /boot/entropy.OLD /boot/entropy 1> /dev/null 2> /dev/null
115 + echo "WARNING: Can not bring back original '/boot/entropy' file"
121 + # bring back secured /boot/entropy.OLD file
122 + if [ -f /boot/entropy.OLD ]
124 + if ! mv /boot/entropy.OLD /boot/entropy 1> /dev/null 2> /dev/null
126 + echo "WARNING: Can not bring back original '/boot/entropy' file"
130 # clone properties of source boot environment
131 zfs list -H -o name -r ${SOURCE} \
133 @@ -303,7 +351,7 @@ case ${1} in
134 while(CMD_ZFS_LIST BENAME_BEGINS_WITH | getline) {
135 if($1 != BENAME_BEGINS_WITH) {
137 - FSNAMES[length(FSNAME) + 1] = FSNAME
138 + FSNAMES[length(FSNAMES) + 1] = FSNAME
139 USED = __normalize($2)
140 USEDBYDATASET = __normalize($3)
141 USEDBYSNAPSHOTS = __normalize($4)
142 @@ -492,6 +540,7 @@ case ${1} in
145 # do not change root (/) mounted boot environment mountpoint
147 if [ "${ROOTFS}" != "${POOL}/${BEDS}/${2}" ]
149 TMPMNT=$( mktemp -d -t BE-${2} )
150 @@ -519,6 +568,9 @@ EOF
154 + if [ -f ${TMPMNT}/etc/rc.d/zfsbe ]; then
157 if [ -f /boot/zfs/zpool.cache ]
159 cp /boot/zfs/zpool.cache ${TMPMNT}/boot/zfs/zpool.cache
160 @@ -555,11 +607,16 @@ EOF
161 zfs set canmount=noauto ${NAME}
163 # enable automatic mount for active boot environment and promote it
164 + if [ ${HAVE_ZFSBE} -eq 1 ]; then
165 + ZFSBE_CANMOUNT=noauto
170 | grep -E "^${POOL}/${BEDS}/${2}(/|$)" \
173 - zfs set canmount=on ${NAME}
174 + zfs set canmount=${ZFSBE_CANMOUNT} ${NAME}
175 while __be_clone ${NAME}
180 [FILE:500:patches/patch-beadm.1]
181 commit 25a066def7cddd0f9178d07531b1f18703308db0
182 Author: Alan Somers <asomers@gmail.com>
183 Date: Wed Sep 6 09:17:00 2017 -0600
185 Fix indentation in man page
187 --- beadm.1.orig 2017-01-13 23:25:44 UTC
189 @@ -87,9 +87,11 @@ If the -e param is specified, the new environment will
190 Creates a snapshot of the existing boot environment named
198 .Ao Ar beName | beName@snapshot Ac