Changeset 6384846


Ignore:
Timestamp:
12/12/14 11:06:13 (9 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.1.1, releng/10.1.2, releng/10.2, stable/10
Children:
3855bbf, fb46926
Parents:
3b3ff1e (diff), f5df39d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:pcbsd/pcbsd

Files:
3 added
10 edited

Legend:

Unmodified
Added
Removed
  • pbi-modules/multimedia/audacious/pbi.conf

    r8374584 ra753f0c  
    11#!/bin/sh 
    2 # PBING Module Config 
     2# 10.x (5/21/14) PBING Build Configuration 
     3# Generated using EasyPBI 
    34 
    4 # -- Program Base Information -- 
    5 PBI_ORIGIN="multimedia/audacious" 
    65PBI_PROGNAME="Audacious" 
    7 PBI_PROGWEB="" 
    86PBI_PROGAUTHOR="Audacious Team" 
     7PBI_DESC="Audacious is a fork of beep-media-player 0.9.7.1. 
     8The primary goals of this fork are keeping ideology of original BMP 
     9and merging miscellaneous plugins into Audacious 
    910 
    10 # -- Additional repo information (optional) -- 
     11Now includes Audacious-plugins package by default! 
     12 
     13WWW: http://audacious-media-player.org/ 
     14" 
    1115PBI_LICENSE="BSD" 
    1216PBI_TAGS="audio,mp3,ogg" 
    1317PBI_PROGTYPE="Graphical" 
    14 PBI_CATEGORY="Multimedia" 
    15  
    16 # -- Additional package to install along with ORIGIN 
    17 PBI_OTHERPKGS="" 
    18  
    19 # -- Optional related packages to show user 
     18PBI_ORIGIN="multimedia/audacious" 
     19PBI_OTHERPKGS="multimedia/audacious-plugins" 
    2020PBI_PLUGINS="" 
    21  
    22  
    23  
    24 # -- Space delimited list of URLs to screenshots 
    2521PBI_SCREENSHOTS="" 
    26  
    27 # -- Other PBIs which are similar to this PBI 
    2822PBI_RELATED="" 
    2923 
    30 export PBI_ORIGIN PBI_PROGNAME PBI_PROGWEB PBI_PROGAUTHOR 
    31 export PBI_LICENSE PBI_TAGS PBI_PROGTYPE PBI_CATEGORY 
    32 export PBI_OTHERPKGS PBI_PLUGINS 
    33 export PBI_SCREENSHOTS PBI_RELATED 
    34  
     24export PBI_PROGNAME PBI_PROGAUTHOR PBI_DESC PBI_LICENSE PBI_TAGS PBI_PROGTYPE PBI_ORIGIN PBI_OTHERPKGS PBI_PLUGINS PBI_SCREENSHOTS PBI_RELATED 
  • src-sh/lpreserver/backend/functions.sh

    rb7c6643 rb88a670  
    168168 
    169169   echo -e "$cLine\troot    ${cronscript} $1" >> /etc/crontab 
     170} 
     171 
     172list_cron_snap() 
     173{ 
     174echo "Datasets scheduled for snapshots:" 
     175echo "---------------------------------" 
     176for i in `grep "${PROGDIR}/backend/runsnap.sh" /etc/crontab | awk '{print $8}'` 
     177do 
     178   min=`grep "${PROGDIR}/backend/runsnap.sh ${i}" /etc/crontab | awk '{print $1}'` 
     179   hour=`grep "${PROGDIR}/backend/runsnap.sh ${i}" /etc/crontab | awk '{print $2}'` 
     180   count=`grep "${PROGDIR}/backend/runsnap.sh ${i}" /etc/crontab | awk '{print $9}'` 
     181   time="Min: $min Hour: $hour"; 
     182   if [ "$min" = "0" -a "$hour" != '*' ] ; then time="daily@$hour" ; fi 
     183   if [ "$min" = "0" -a "$hour" = '*' ] ; then time="hourly" ; fi 
     184   if [ "$min" = "0,30" ] ; then time="30min" ; fi 
     185   if [ "$min" = '*/10' ] ; then time="10min" ; fi 
     186   if [ "$min" = '*/5' ] ; then time="5min" ; fi 
     187   if [ "$min" = '*/5' -a "$count" = "auto" ] ; then time="Automatic" ; fi 
     188   echo "$i - $time - total: $count" 
     189   echo "" 
     190done 
     191} 
     192 
     193list_cron_scrub() 
     194{ 
     195echo "Pools scheduled for scrub:" 
     196echo "---------------------------------" 
     197for i in `grep "${PROGDIR}/backend/runscrub.sh" /etc/crontab | awk '{print $8}'` 
     198do 
     199   hour=`grep "${PROGDIR}/backend/runscrub.sh ${i}" /etc/crontab | awk '{print $2}'` 
     200   day_week=`grep "${PROGDIR}/backend/runscrub.sh ${i}" /etc/crontab | awk '{print $5}'` 
     201   day_month=`grep "${PROGDIR}/backend/runscrub.sh ${i}" /etc/crontab | awk '{print $3}'` 
     202   if [ "$hour" != '*' -a "$day_week" = '*' -a "$day_month" = '*' ] ; then time="daily @ hour $hour" ; fi 
     203   if [ "$day_week" != '*' ] ; then time="weekly @ day $day_week @ hour $hour" ; fi 
     204   if [ "$day_month" != '*' ] ; then time="monthly @ day $day_month @ hour $hour" ; fi 
     205   echo "$i - $time" 
     206   echo "" 
     207done 
    170208} 
    171209 
  • src-sh/lpreserver/backend/zfslistcron.sh

    rabf54cd rb88a670  
    1212. ${PROGDIR}/backend/functions.sh 
    1313 
    14 echo "Datasets scheduled for snapshots:" 
    15 echo "---------------------------------" 
    16 for i in `grep "${PROGDIR}/backend/runsnap.sh" /etc/crontab | awk '{print $8}'` 
    17 do 
    18    min=`grep "${PROGDIR}/backend/runsnap.sh ${i}" /etc/crontab | awk '{print $1}'` 
    19    hour=`grep "${PROGDIR}/backend/runsnap.sh ${i}" /etc/crontab | awk '{print $2}'` 
    20    count=`grep "${PROGDIR}/backend/runsnap.sh ${i}" /etc/crontab | awk '{print $9}'` 
    21    time="Min: $min Hour: $hour"; 
    22    if [ "$min" = "0" -a "$hour" != '*' ] ; then time="daily@$hour" ; fi 
    23    if [ "$min" = "0" -a "$hour" = '*' ] ; then time="hourly" ; fi 
    24    if [ "$min" = "0,30" ] ; then time="30min" ; fi 
    25    if [ "$min" = '*/10' ] ; then time="10min" ; fi 
    26    if [ "$min" = '*/5' ] ; then time="5min" ; fi 
    27    if [ "$min" = '*/5' -a "$count" = "auto" ] ; then time="Automatic" ; fi 
    28    echo "$i - $time - total: $count" 
    29    echo "" 
    30 done 
     14if [ -z "$1" ]; then 
     15    list_cron_snap 
     16    list_cron_scrub 
     17    exit 0 
     18fi 
    3119 
    32 echo "Pools scheduled for scrub:" 
    33 echo "---------------------------------" 
    34 for i in `grep "${PROGDIR}/backend/runscrub.sh" /etc/crontab | awk '{print $8}'` 
    35 do 
    36    hour=`grep "${PROGDIR}/backend/runscrub.sh ${i}" /etc/crontab | awk '{print $2}'` 
    37    day_week=`grep "${PROGDIR}/backend/runscrub.sh ${i}" /etc/crontab | awk '{print $5}'` 
    38    day_month=`grep "${PROGDIR}/backend/runscrub.sh ${i}" /etc/crontab | awk '{print $3}'` 
    39    if [ "$hour" != '*' -a "$day_week" = '*' -a "$day_month" = '*' ] ; then time="daily @ hour $hour" ; fi 
    40    if [ "$day_week" != '*' ] ; then time="weekly @ day $day_week @ hour $hour" ; fi 
    41    if [ "$day_month" != '*' ] ; then time="monthly @ day $day_month @ hour $hour" ; fi 
    42    echo "$i - $time" 
    43 done 
     20if [ "$1" == "snap" ]; then 
     21    list_cron_snap 
     22    exit 0 
     23fi 
    4424 
     25if [ "$1" == "scrub" ]; then 
     26    list_cron_scrub 
     27    exit 0 
     28fi 
  • src-sh/lpreserver/lpreserver

    rabf54cd rb88a670  
    284284Usage: 
    285285 
    286   lpreserver listcron 
     286  lpreserver listcron <scrub|snap> 
     287 
     288Exmaple: 
     289 
     290  lpreserver listcron snap 
     291 
     292  or 
     293 
     294  lpreserver listcron scrub 
     295   
     296  (NOTE: Empty argument list shows both scheduled snapshots 
     297  and scrubs.) 
     298 
    287299" 
    288300}; 
     
    578590         ;; 
    579591 
    580  listcron) require_root 
    581          ${PROGDIR}/backend/zfslistcron.sh  
    582          ;; 
    583  
     592 listcron)  
     593         if [ -z "$2" ]; then 
     594             ${PROGDIR}/backend/zfslistcron.sh 
     595             exit 0 
     596         fi 
     597         case ${2} in 
     598             snap) ${PROGDIR}/backend/zfslistcron.sh snap;; 
     599             scrub) ${PROGDIR}/backend/zfslistcron.sh scrub;; 
     600             *) help_listcron;; 
     601         esac 
     602         ;; 
     603         
    584604 listsnap) require_root 
    585605         DATASET="$2" 
  • src-sh/pcbsd-utils/pc-updatemanager/pc-updatemanager

    r7354a70 rf5df39d  
    739739{ 
    740740  touch_updateinprogress 
     741  doPkgUpdates="YES" 
    741742 
    742743  if [ -e "/usr/local/bin/pc-systemflag" ]; then 
     
    772773  # Set the new version of FreeBSD we are installing 
    773774  NEWFREEBSDVERSION="$1" 
     775  doPkgUpdates="YES" 
    774776 
    775777  touch_updateinprogress 
     
    847849 
    848850  # Lets create a new repo file to match the version of BSD we are upgrading to 
     851 
     852  # Set the new ABI 
     853  ABIVER="`echo $NEWFREEBSDVERSION | cut -d '-' -f 1 | cut -d '.' -f 1`" 
     854  pV="`${PKG_CMD} ${PKG_FLAG} query '%v' ports-mgmt/pkg`" 
     855  echo $pV | grep -q '^1.3' 
     856  if [ $? -eq 0 ] ; then 
     857    PKG_FLAG="$PKG_FLAG -o ABI=freebsd:$ABIVER:x86:64" 
     858  else 
     859    PKG_FLAG="$PKG_FLAG -o ABI=freebsd:$ABIVER:`uname -m`" 
     860  fi 
     861  #echo "Setting ABI with: ${PKG_FLAG}" 
    849862 
    850863  # See if we need to adjust pcbsd.conf repo file 
     
    896909 
    897910  # Set the new PKG_FLAG to use this repo config 
    898   PKG_FLAG="-R /tmp/.updateRepo" 
     911  PKG_FLAG="-R /tmp/.updateRepo ${PKG_FLAG}" 
    899912} 
    900913 
     
    10921105mkdir -p /compat/linux/proc 
    10931106mkdir -p /compat/linux/sys 
     1107mkdir -p /compat/linux/usr 
     1108ln -s /usr/home /compat/linux/usr/home 
    10941109 
    10951110# Check for a new linux compat version to set 
     
    11641179  # Start the upgrade with freebsd-update, get files downloaded installed 
    11651180  echo_log "Fetching freebsd-update files..." 
    1166   rc_halt "chroot ${STAGEMNT} freebsd-update --non-interactive fetch" >>${LOGOUT} 2>${LOGOUT} 
     1181  rc_halt "chroot ${STAGEMNT} freebsd-update --non-interactive fetch" >>${LOGOUT} 2>>${LOGOUT} 
    11671182  echo_log "Installing freebsd-update files..." 
    1168   rc_halt "chroot ${STAGEMNT} freebsd-update install" >>${LOGOUT} 2>${LOGOUT} 
     1183  rc_halt "chroot ${STAGEMNT} freebsd-update install" >>${LOGOUT} 2>>${LOGOUT} 
     1184 
     1185  # Run again to remove any shared objs 
     1186  chroot ${STAGEMNT} freebsd-update install >/dev/null 2>/dev/null 
    11691187  NEWFREEBSDVERSION="`chroot ${STAGEMNT} /bin/freebsd-version`" 
    11701188} 
  • src-sh/warden/bin/warden

    r60faaca rbb6487e  
    5353       delete - Deletes a jail 
    5454       export - Exports a jail to a .wdn file 
     55   fbsdupdate - Update the FreeBSD world inside jail 
     56  fbsdupgrade - Upgrade the version of FreeBSD inside a jail 
    5557        fstab - Start users \$EDITOR on jails custom fstab 
    5658          get - Gets options list for a jail 
    5759       import - Imports a jail from a .wdn file 
    5860         list - Lists the installed jails 
     61    pkgupdate - Update packages inside a jail 
    5962         pkgs - Lists the installed packages in a jail 
    6063         pbis - Lists the installed pbi's in a jail 
     
    473476}; 
    474477 
    475  
     478help_fbsdupgrade() 
     479{ 
     480 title 
     481 echo "Help fbsdupgrade 
     482 
     483Upgrades the version of FreeBSD inside the jail 
     484 
     485Usage: 
     486 
     487  warden fbsdupgrade <jail> <new version> 
     488 
     489Example: 
     490 
     491  warden fbsdupgrade myjail 10.2-RELEASE 
     492" 
     493}; 
     494 
     495help_fbsdupdate() 
     496{ 
     497 title 
     498 echo "Help fbsdupdate 
     499 
     500Updates the freebsd world inside a jail 
     501 
     502Available Flags: 
     503  --pkgupdate (Also update the packages in the jail) 
     504 
     505Usage: 
     506 
     507  warden fbsdupdate <jail> 
     508 
     509Example: 
     510 
     511  warden fbsdupdate myjail 
     512" 
     513}; 
     514 
     515help_pkgupdate() 
     516{ 
     517 title 
     518 echo "Help pkgupdate 
     519 
     520Updates all the packages inside a jail 
     521 
     522Usage: 
     523 
     524  warden pkgupdate <Jail> 
     525 
     526Example: 
     527 
     528  warden pkgupdate myjail 
     529 
     530NOTE: 
     531 
     532  The upgrade will stop the jail, and do the package upgrade in stopped mode. 
     533  If the jail was previously running, it will be re-started upon completion.  
     534" 
     535}; 
    476536 
    477537help_chroot() 
     
    605665           checkup) help_checkup ;; 
    606666           chroot) help_chroot ;; 
     667           fbsdupdate) help_fbsdupdate ;; 
     668           fbsdupgrade) help_fbsdupgrade ;; 
    607669           list) help_list ;; 
    608670           export) help_export ;; 
    609671           fstab) help_fstab ;; 
    610672           import) help_import ;; 
     673           pbis) help_pbis ;; 
    611674           pkgs) help_pkgs ;; 
    612            pbis) help_pbis ;; 
     675           pkgupdate) help_pkgupdate ;; 
    613676           template) help_template ;; 
    614677           type) help_type ;; 
     
    628691 
    629692         ${PROGDIR}/scripts/backend/listpkgs.sh "${JAILNAME}"  
     693         ;; 
     694pkgupdate) JAILNAME="${2}" 
     695         if [ -z "${JAILNAME}" ]; then exit_err "No jail specified!"; fi 
     696         if [ ! -e "${JDIR}/${JAILNAME}" ]; then exit_err "No such jail!"; fi 
     697         set_warden_metadir 
     698 
     699         ${PROGDIR}/scripts/backend/pkgupdate.sh "${JAILNAME}"  
     700         ;; 
     701fbsdupdate) JAILNAME="${2}" 
     702         if [ -z "${JAILNAME}" ]; then exit_err "No jail specified!"; fi 
     703         if [ ! -e "${JDIR}/${JAILNAME}" ]; then exit_err "No such jail!"; fi 
     704         set_warden_metadir 
     705 
     706         ${PROGDIR}/scripts/backend/fbsdupdate.sh "${JAILNAME}" "$3" 
     707         ;; 
     708fbsdupgrade) JAILNAME="${2}" 
     709         NEWFBSDVER="${3}" 
     710         if [ -z "${JAILNAME}" ]; then exit_err "No jail specified!"; fi 
     711         if [ -z "${NEWFBSDVER}" ]; then exit_err "No FreeBSD version specified!"; fi 
     712         if [ ! -e "${JDIR}/${JAILNAME}" ]; then exit_err "No such jail!"; fi 
     713         set_warden_metadir 
     714 
     715         ${PROGDIR}/scripts/backend/fbsdupgrade.sh "$JAILNAME" "$NEWFBSDVER" 
    630716         ;; 
    631717details) JAILNAME="${2}" 
  • src-sh/warden/scripts/backend/functions.sh

    r001f7a3 ra6e6439  
    348348  rp=`getZFSRelativePath "$1"` 
    349349  zdate=`date +%Y-%m-%d-%H-%M-%S` 
    350   zfs snapshot $tank${rp}@$zdate 
     350  snaptag="$zdate" 
     351  if [ -n "$3" ] ; then snaptag="$3"; fi 
     352 
     353  rc_halt "zfs snapshot $tank${rp}@${snaptag}" 
     354 
    351355  # Do we have a comment to set? 
    352356  if [ -n "$2" ] ; then 
    353       zfs set warden:comment="$2" ${tank}${rp}@${zdate} 
     357      zfs set warden:comment="$2" ${tank}${rp}@${snaptag} 
    354358  fi 
    355359} 
     
    810814} 
    811815 
    812 install_pc_extractoverlay() 
    813 { 
    814   if [ -z "${1}" ] ; then 
    815     return 1  
    816   fi  
    817  
    818   mkdir -p ${1}/usr/local/bin 
    819   mkdir -p ${1}/usr/local/share/pcbsd/conf 
    820   mkdir -p ${1}/usr/local/share/pcbsd/distfiles 
    821  
    822   cp /usr/local/bin/pc-extractoverlay ${1}/usr/local/bin/ 
    823   chmod 755 ${1}/usr/local/bin/pc-extractoverlay 
    824  
    825   cp /usr/local/share/pcbsd/conf/server-excludes \ 
    826     ${1}/usr/local/share/pcbsd/conf 
    827   cp /usr/local/share/pcbsd/distfiles/server-overlay.txz \ 
    828     ${1}/usr/local/share/pcbsd/distfiles 
    829  
    830   return 0 
    831 } 
    832  
    833816make_bootstrap_pkgng_file_standard() 
    834817{ 
     
    1007990      rm -f "${jaildir}/bootstrap-pkgng" 
    1008991      rm -f "${jaildir}/pluginjail-packages" 
    1009       chroot ${jaildir} pc-extractoverlay server --sysinit 
    1010992      return 0 
    1011993    fi 
     
    12611243 
    12621244} 
     1245 
     1246stop_jail_savestate() 
     1247{ 
     1248  # Check if the jail is running first 
     1249  ${PROGDIR}/scripts/backend/checkstatus.sh "${JAILNAME}" 
     1250  if [ "$?" = "0" ]; then 
     1251    stateRestartJail="YES" 
     1252    # Make sure the jail is stopped 
     1253    ${PROGDIR}/scripts/backend/stopjail.sh "${JAILNAME}" 
     1254    ${PROGDIR}/scripts/backend/checkstatus.sh "${JAILNAME}" 
     1255    if [ "$?" = "0" ]; then 
     1256       exit_err "Failed to stop jail: $JAILNAME..." 
     1257    fi 
     1258  fi 
     1259} 
     1260 
     1261start_jail_savedstate() 
     1262{ 
     1263  if [ "$stateRestartJail" = "YES" ] ; then 
     1264    ${PROGDIR}/scripts/backend/startjail.sh "${JAILNAME}" 
     1265  fi 
     1266} 
     1267 
     1268############################################################## 
     1269# Functions for upgrading jails 
     1270############################################################## 
     1271 
     1272echo_logout() 
     1273{ 
     1274  echo "$@" 
     1275  echo "$@" >> ${LOGOUT} 
     1276} 
     1277 
     1278set_update_vars() 
     1279{ 
     1280  unset EVENT_PIPE 
     1281 
     1282  # Set some locations 
     1283  STAGEMNT="$JAILDIR" 
     1284  LOGOUT="/var/log/warden-update.log" 
     1285  OLDPKGLIST="/tmp/.pkgUpdateList.$$" 
     1286  NEWPKGLIST="/tmp/.newPkgUpdateList.$$" 
     1287  PKGUPGRADELOG="/tmp/.pkgUpdateLog.$$" 
     1288  PKGDLCACHE="/usr/local/pkg-cache" 
     1289  PKG_CMD="chroot ${JAILDIR} /usr/sbin/pkg" 
     1290  echo "" > $LOGOUT 
     1291 
     1292  # Some basic sanity tests 
     1293  if [ ! -d "$JAILDIR" -o "$JAILDIR" = "/" ] ; then 
     1294     exit_err "Invalid JAILDIR" 
     1295  fi 
     1296  chroot ${STAGEMNT} freebsd-version 2>/dev/null >/dev/null 
     1297  if [ $? -ne 0 ] ; then 
     1298     exit_err "Needs FreeBSD > 10 to do updates" 
     1299  fi 
     1300} 
     1301 
     1302update_freebsd() 
     1303{ 
     1304 
     1305  set_update_vars 
     1306 
     1307  stop_jail_savestate 
     1308 
     1309  mk_snapshot "FreeBSD update snapshot" 
     1310 
     1311  run_freebsd_update_script 
     1312 
     1313  start_jail_savedstate 
     1314  echo_logout "Your security update is finished!" 
     1315  exit 0 
     1316} 
     1317 
     1318 
     1319update_pkgs_only() 
     1320{ 
     1321  set_update_vars 
     1322 
     1323  mk_pkg_conf 
     1324  build_pkg_list 
     1325  dl_pkgs 
     1326 
     1327  stop_jail_savestate 
     1328 
     1329  mk_snapshot "Pkg update snapshot" 
     1330  prep_pkgs_chroot 
     1331  install_pkgs_chroot 
     1332 
     1333  start_jail_savedstate 
     1334 
     1335  echo_logout "Your package update is finished!" 
     1336  exit 0 
     1337} 
     1338 
     1339update_world_and_pkgs() 
     1340{ 
     1341  # Set the new version of FreeBSD we are installing 
     1342  NEWFREEBSDVERSION="$1" 
     1343 
     1344  set_update_vars 
     1345 
     1346  mk_pkg_conf 
     1347  build_pkg_list 
     1348  dl_pkgs 
     1349 
     1350  stop_jail_savestate 
     1351 
     1352  mk_snapshot "FreeBSD upgrade snapshot" 
     1353  run_freebsd_upgrade_script 
     1354  prep_pkgs_chroot 
     1355  install_pkgs_chroot 
     1356 
     1357  start_jail_savedstate 
     1358  echo_logout "Your FreeBSD upgrade is finished!" 
     1359  exit 0 
     1360} 
     1361 
     1362mk_pkg_conf() 
     1363{ 
     1364   PKG_FLAG="" 
     1365   PKG_CFLAG="" 
     1366 
     1367   if [ ! -d "${JAILDIR}/${PKGDLCACHE}" ] ; then 
     1368     mkdir -p ${JAILDIR}/${PKGDLCACHE} 
     1369   fi 
     1370 
     1371   # Get rid of FreeBSD.conf repo 
     1372   if [ -e "${JAILDIR}/etc/pkg/FreeBSD.conf" ] ; then 
     1373      rm ${JAILDIR}/etc/pkg/FreeBSD.conf 
     1374   fi 
     1375 
     1376   # Set the cache directory 
     1377   PKG_CFLAG="-C /tmp/.pkgUpdate.conf" 
     1378   echo "PKG_CACHEDIR: $PKGDLCACHE" > ${JAILDIR}/tmp/.pkgUpdate.conf 
     1379 
     1380   # If doing a major update also, add the new repos config 
     1381   if [ -n "$NEWFREEBSDVERSION" ] ; then 
     1382      setup_pkgng_newrepo_conf 
     1383   fi 
     1384} 
     1385 
     1386setup_pkgng_newrepo_conf() { 
     1387 
     1388  # Lets create a new repo file to match the version of BSD we are upgrading to 
     1389 
     1390  # Set the new ABI 
     1391  ABIVER="`echo $NEWFREEBSDVERSION | cut -d '-' -f 1 | cut -d '.' -f 1`" 
     1392  pV="`${PKG_CMD} ${PKG_FLAG} query '%v' ports-mgmt/pkg`" 
     1393  echo $pV | grep -q '^1.3' 
     1394  if [ $? -eq 0 ] ; then 
     1395    PKG_FLAG="$PKG_FLAG -o ABI=freebsd:$ABIVER:x86:64" 
     1396  else 
     1397    PKG_FLAG="$PKG_FLAG -o ABI=freebsd:$ABIVER:`uname -m`" 
     1398  fi 
     1399  #echo "Setting ABI with: ${PKG_FLAG}" 
     1400 
     1401  # See if we need to adjust pcbsd.conf repo file 
     1402  if [ ! -e "/usr/local/etc/pkg/repos/pcbsd.conf.dist" ];then 
     1403     echo_logout "ERROR: Missing /usr/local/etc/pkg/repos/pcbsd.conf.dist" 
     1404     exit 1 
     1405  fi 
     1406 
     1407  ARCH=`uname -m` 
     1408  FBSDVER="$NEWFREEBSDVERSION" 
     1409  MAJORVER="`echo $FBSDVER | cut -d '-' -f 1 |  cut -d '.' -f 1`.0-RELEASE" 
     1410 
     1411  # Make sure we are on a -RELEASE or -STABLE, otherwise use the proper uname 
     1412  echo $FBSDVER | grep -q -e 'RELEASE' -e 'STABLE' 
     1413  if [ $? -ne 0 ] ; then MAJORVER="$FBSDVER"; fi 
     1414 
     1415  # If using the EDGE package set, set the right path 
     1416  case $PACKAGE_SET in 
     1417       EDGE) FBSDVER="$FBSDVER/edge" 
     1418             MAJORVER="$MAJORVER/edge" 
     1419             ;; 
     1420          *) ;; 
     1421  esac 
     1422 
     1423  rm -rf ${JAILDIR}/tmp/.updateRepo >/dev/null 2>/dev/null 
     1424  mkdir ${JAILDIR}/tmp/.updateRepo 
     1425 
     1426  # Now create standard pcbsd.conf file 
     1427  if [ "$PACKAGE_SET" = "CUSTOM" -a -n "$CUSTOM_URL" ] ; then 
     1428     # Change %VERSION% / %ARCH% keys 
     1429     CUSTOM_URL=`echo $CUSTOM_URL | sed "s|%VERSION%|$MAJORVER|g" | sed "s|%ARCH%|$ARCH|g"` 
     1430     cat << EOF >${JAILDIR}/tmp/.updateRepo/pkgUpdateRepo.conf 
     1431pcbsd-major: { 
     1432               url: "$CUSTOM_URL", 
     1433               signature_type: "fingerprints", 
     1434               fingerprints: "/usr/local/etc/pkg/fingerprints/pcbsd", 
     1435               enabled: true 
     1436              } 
     1437EOF 
     1438  else 
     1439    # Using PC-BSD CDN 
     1440    cat /usr/local/etc/pkg/repos/pcbsd.conf.dist \ 
     1441      | sed "s|pcbsd: |pcbsd-major: |g" \ 
     1442      | sed "s|%VERSION%|$MAJORVER|g" \ 
     1443      | sed "s|%ARCH%|$ARCH|g" \ 
     1444      | sed "s|VERSION|$MAJORVER|g" \ 
     1445      | sed "s|ARCH|$ARCH|g" > ${JAILDIR}/tmp/.updateRepo/pkgUpdateRepo.conf 
     1446  fi 
     1447 
     1448  # Set the new PKG_FLAG to use this repo config 
     1449  PKG_FLAG="-R /tmp/.updateRepo ${PKG_FLAG}" 
     1450} 
     1451 
     1452build_pkg_list() 
     1453{ 
     1454  # Build top-level list of pkgs installed 
     1455  echo_logout "Getting list of packages..." 
     1456  ${PKG_CMD} query -e '%#r=0' '%o %n-%v' | sort | grep -v 'ports-mgmt/pkg ' > $OLDPKGLIST 
     1457 
     1458  echo "Original top-level packages:" > $PKGUPGRADELOG 
     1459  echo "-----------------------------------------------" >> $PKGUPGRADELOG 
     1460  cat $OLDPKGLIST >> $PKGUPGRADELOG 
     1461  echo "-----------------------------------------------" >> $PKGUPGRADELOG 
     1462} 
     1463 
     1464dl_pkgs() 
     1465{ 
     1466  # Update the DB first 
     1467  echo_logout "Updating the package repo database..." 
     1468  ${PKG_CMD} ${PKG_FLAG} update -f >${LOGOUT} 2>${LOGOUT} 
     1469 
     1470  # Clean pkgs 
     1471  echo_logout "Cleaning old pkg upgrade cache..." 
     1472  ${PKG_CMD} ${PKG_CFLAG} ${PKG_FLAG} clean -y >${LOGOUT} 2>${LOGOUT} 
     1473 
     1474  if [ -e "$NEWPKGLIST" ] ; then rm $NEWPKGLIST; fi 
     1475 
     1476  # Save the PKGNG filename 
     1477  PKGFILENAME="`${PKG_CMD} ${PKG_FLAG} rquery -U '%n-%v' ports-mgmt/pkg 2>/dev/null | head -n 1`.txz" 
     1478 
     1479  # First off, fetch the pkgng pkg 
     1480  echo_logout "Fetching packages for ports-mgmt/pkg - $PKGFILENAME" 
     1481  ${PKG_CMD} ${PKG_CFLAG} ${PKG_FLAG} fetch -U -d -y ports-mgmt/pkg >/tmp/.pkgOut.$$ 2>/tmp/.pkgOut.$$ 
     1482  if [ $? -ne 0 ] ; then 
     1483     cat /tmp/.pkgOut.$$ 
     1484     cat /tmp/.pkgOut.$$ >> $LOGOUT 
     1485     cat /tmp/.pkgOut.$$ >> $PKGUPGRADELOG 
     1486     exit_err "Failed fetching: ports-mgmt/pkg - $PKGFILENAME" 
     1487  fi 
     1488 
     1489  CHROOTREALPKGDLCACHE="${PKGDLCACHE}" 
     1490  REALPKGDLCACHE="${JAILDIR}/${PKGDLCACHE}" 
     1491  # PKGNG lies, we need to verify if the package was really downloaded 
     1492  if [ ! -e "${JAILDIR}/${PKGDLCACHE}/${PKGFILENAME}" ] ; then 
     1493     # Also check All/ since pkg docs are rather unclear about if that will be used or not 
     1494     if [ -e "${JAILDIR}/${PKGDLCACHE}/All/${PKGFILENAME}" ] ; then 
     1495        CHROOTREALPKGDLCACHE="${PKGDLCACHE}/All" 
     1496        REALPKGDLCACHE="${JAILDIR}/${PKGDLCACHE}/All" 
     1497     else 
     1498        exit_err "Failed downloading ports-mgmt/pkg with: $PKG_CMD $PKG_FLAG fetch -d -y ports-mgmt/pkg" 
     1499     fi 
     1500  fi 
     1501 
     1502  # Create the NEWPKGLIST 
     1503  touch $NEWPKGLIST 
     1504 
     1505  # Now start fetching all the update packages 
     1506  while read pkgLine 
     1507  do 
     1508    pkgOrigin="`echo $pkgLine | cut -d ' ' -f 1`" 
     1509    pkgName="`echo $pkgLine | cut -d ' ' -f 2`" 
     1510 
     1511    # Check if this pkg exists in the new repo 
     1512    unset FETCHFILENAME 
     1513    FETCHFILENAME="`${PKG_CMD} ${PKG_FLAG} rquery -U '%n-%v' $pkgOrigin 2>/dev/null | head -n 1`" 
     1514    if [ -z "$FETCHFILENAME" ] ; then 
     1515       echo_logout "*****" 
     1516       echo_logout "No such package in new repo: $pkgOrigin" 
     1517       echo_logout "*****" >> $LOGOUT 
     1518       echo "*****" >> $PKGUPGRADELOG 
     1519       echo "No such package in new repo: $pkgOrigin" >> $PKGUPGRADELOG 
     1520       echo "*****" >> $PKGUPGRADELOG 
     1521       continue 
     1522    fi 
     1523    FETCHFILENAME="${FETCHFILENAME}.txz" 
     1524 
     1525    # Fetch the pkg now 
     1526    echo_logout "Fetching packages for ${pkgOrigin} - $FETCHFILENAME" 
     1527    echo "Fetching packages for ${pkgOrigin} - $FETCHFILENAME" >> ${PKGUPGRADELOG} 
     1528    ${PKG_CMD} ${PKG_CFLAG} ${PKG_FLAG} fetch -U -d -y $pkgOrigin >/tmp/.pkgOut.$$ 2>/tmp/.pkgOut.$$ 
     1529    if [ $? -ne 0 ] ; then 
     1530       echo "*****" >> $PKGUPGRADELOG 
     1531       echo_logout "Failed fetching: $pkgOrigin" 
     1532       cat /tmp/.pkgOut.$$ 
     1533       cat /tmp/.pkgOut.$$ >> $LOGOUT 
     1534       echo_logout "*****" 
     1535 
     1536       echo "*****" >> $PKGUPGRADELOG 
     1537       echo "Failed fetching: $pkgOrigin" >> $PKGUPGRADELOG 
     1538       cat /tmp/.pkgOut.$$ >> $PKGUPGRADELOG 
     1539       echo "*****" >> $PKGUPGRADELOG 
     1540    fi 
     1541 
     1542    # PKGNG lies, we need to verify if the package was really downloaded 
     1543    if [ ! -e "${REALPKGDLCACHE}/${FETCHFILENAME}" ] ; then 
     1544       echo_logout "*****" 
     1545       echo_logout "Failed fetching: $pkgOrigin - $FETCHFILENAME" 
     1546       cat /tmp/.pkgOut.$$ 
     1547       cat /tmp/.pkgOut.$$ >> $LOGOUT 
     1548       echo_logout "*****" 
     1549 
     1550       echo "*****" >> $PKGUPGRADELOG 
     1551       echo "Failed fetching: $pkgOrigin - $FETCHFILENAME" >> $PKGUPGRADELOG 
     1552       cat /tmp/.pkgOut.$$ >> $PKGUPGRADELOG 
     1553       echo "*****" >> $PKGUPGRADELOG 
     1554       echo "Failed downloading $pkgOrigin with: $PKG_CMD $PKG_FLAG fetch -d -y $pkgOrigin" 
     1555    fi 
     1556    echo "$pkgOrigin $FETCHFILENAME" >> $NEWPKGLIST 
     1557  done < $OLDPKGLIST 
     1558 
     1559  # Copy the list of packages to install 
     1560  rc_halt "cp $NEWPKGLIST ${JAILDIR}/install-pkg-list" 
     1561 
     1562  echo_logout "-----------------------------------------------" 
     1563  echo "-----------------------------------------------" >> ${PKGUPGRADELOG} 
     1564} 
     1565 
     1566do_prune_auto_snaps() 
     1567{ 
     1568  # Get list of snaps 
     1569  snaps=$(listZFSSnap "${JAILDIR}") 
     1570 
     1571  # Reverse the list 
     1572  for tmp in $snaps 
     1573  do 
     1574     rSnaps="$tmp $rSnaps" 
     1575  done 
     1576 
     1577  # Do any pruning 
     1578  num=0 
     1579  keep=2 
     1580  for snap in $rSnaps 
     1581  do 
     1582     echo "$snap" | grep -q "beforeUp-" 
     1583     if [ $? -ne 0 ] ; then continue; fi 
     1584 
     1585     if [ $num -ge $keep ] ; then 
     1586        echo "Pruning old upgrade snapshot: $snap" 
     1587        rmZFSSnap "${JAILDIR}" "$snap" 
     1588     fi 
     1589     num=`expr $num + 1` 
     1590  done 
     1591} 
     1592 
     1593mk_snapshot() 
     1594{ 
     1595  echo_logout "Creating snapshot of $JAILNAME..." 
     1596 
     1597  # Auto-prune any old / stale BEs 
     1598  do_prune_auto_snaps 
     1599 
     1600  revertSnap="beforeUp-`date +%Y%m%d_%H%M%S`" 
     1601  ${PROGDIR}/scripts/backend/zfsmksnap.sh ${JAILNAME} "${1}" $revertSnap 
     1602  if [ $? -ne 0 ] ; then 
     1603     exit_err "Failed creating automatic snapshot!" 
     1604  fi 
     1605} 
     1606 
     1607exit_revertsnap() 
     1608{ 
     1609  # We had an error and need to exit, but first revert the snapshot 
     1610  echo_logout "Reverting to snapshot: $revertSnap" 
     1611  ${PROGDIR}/scripts/backend/zfsrevertsnap.sh ${JAILNAME} $revertSnap 
     1612  if [ $? -ne 0 ] ; then 
     1613     echo_logout "Failed reverting automatic snapshot!" 
     1614  fi 
     1615  exit_err "$@" 
     1616} 
     1617 
     1618prep_pkgs_chroot() 
     1619{ 
     1620  # Make sure jail log dir exists 
     1621  if [ ! -d "${JAILDIR}/var/log/warden" ] ; then 
     1622     mkdir -p ${JAILDIR}/var/log/warden 
     1623  fi 
     1624 
     1625  # First, clean the jail environment 
     1626  echo_logout "Cleaning the jail environment... (This may take a while)" 
     1627  chroot ${STAGEMNT} /usr/sbin/pkg delete -ay >>${LOGOUT} 2>>${LOGOUT} 
     1628  if [ $? -ne 0 ] ; then 
     1629     exit_revertsnap "Failed cleaning jail environment!" 
     1630  fi 
     1631 
     1632  # Next create the script to bootstrap pkgng 
     1633  echo "#!/bin/sh 
     1634tar xvpf ${CHROOTREALPKGDLCACHE}/${PKGFILENAME} -C / /usr/local/sbin/pkg-static >/dev/null 2>/dev/null 
     1635/usr/local/sbin/pkg-static add -f ${CHROOTREALPKGDLCACHE}/${PKGFILENAME} 
     1636if [ \$? -ne 0 ] ; then exit 1; fi 
     1637cd ${CHROOTREALPKGDLCACHE} 
     1638 
     1639# Cleanup the old /compat/linux for left-overs 
     1640umount /compat/linux/proc >/dev/null 2>/dev/null 
     1641umount /compat/linux/sys >/dev/null 2>/dev/null 
     1642rm -rf /compat/linux 
     1643mkdir -p /compat/linux/proc 
     1644mkdir -p /compat/linux/sys 
     1645 
     1646while read pkgLine 
     1647do 
     1648  pkgOrigin=\"\`echo \$pkgLine | cut -d ' ' -f 1\`\" 
     1649  pkgName=\"\`echo \$pkgLine | cut -d ' ' -f 2\`\" 
     1650  if [ ! -e \"\${pkgName}\" ] ; then 
     1651     echo \"No such package: \${pkgName}\" 
     1652     echo \"No such package: \${pkgName}\" >>/removed-pkg-list 
     1653     continue 
     1654  fi 
     1655 
     1656  echo \"Installing \$pkgName...\" 
     1657  pkg add \${pkgName} >/pkg-add.log 2>/pkg-add.log 
     1658  if [ \$? -ne 0 ] ; then 
     1659     echo \"Failed installing \${pkgName}\" 
     1660     cat /pkg-add.log 
     1661     echo \"Failed installing \${pkgName}\" >>/failed-pkg-list 
     1662     cat /pkg-add.log >>/failed-pkg-list 
     1663  fi 
     1664done < /install-pkg-list 
     1665rm /pkg-add.log >/dev/null 2>/dev/null 
     1666 
     1667# Save the log files 
     1668touch /install-pkg-list 
     1669touch /removed-pkg-list 
     1670touch /failed-pkg-list 
     1671mv /install-pkg-list /var/log/warden/ 
     1672mv /removed-pkg-list /var/log/warden/ 
     1673mv /failed-pkg-list /var/log/warden 
     1674 
     1675exit 0 
     1676" > ${STAGEMNT}/.doPkgUp.sh 
     1677 
     1678} 
     1679 
     1680install_pkgs_chroot() 
     1681{ 
     1682  # Run it now 
     1683  echo_logout "Installing packages to jail ${JAILNAME}... (This may take a while)" 
     1684  chroot ${STAGEMNT} sh /.doPkgUp.sh >>${LOGOUT} 2>>${LOGOUT} 
     1685  if [ $? -ne 0 ] ; then 
     1686     exit_revertsnap "Failed upgrading packages!" 
     1687  fi 
     1688  rm ${STAGEMNT}/.doPkgUp.sh 
     1689} 
     1690 
     1691run_freebsd_update_script() 
     1692{ 
     1693  # Start the upgrade with freebsd-update, get files downloaded installed 
     1694  echo_logout "Fetching FreeBSD update files..." 
     1695  chroot ${STAGEMNT} freebsd-update --non-interactive fetch >>${LOGOUT} 2>>${LOGOUT} 
     1696  if [ $? -ne 0 ] ; then 
     1697     exit_revertsnap "Failed fetching FreeBSD update files!" 
     1698  fi 
     1699  echo_logout "Installing freebsd-update files..." 
     1700  chroot ${STAGEMNT} freebsd-update install >>${LOGOUT} 2>>${LOGOUT} 
     1701  if [ $? -ne 0 ] ; then 
     1702     exit_revertsnap "Failed installing FreeBSD update files!" 
     1703  fi 
     1704 
     1705  # Do it again, remove any old shared objs 
     1706  chroot ${STAGEMNT} freebsd-update install >/dev/null 2>/dev/null 
     1707} 
     1708 
     1709run_freebsd_upgrade_script() 
     1710{ 
     1711  # Start the upgrade with freebsd-update, get files downloaded installed 
     1712  echo_logout "Fetching FreeBSD upgrade files..." 
     1713  chroot ${STAGEMNT} freebsd-update --non-interactive upgrade -r $NEWFREEBSDVERSION >>${LOGOUT} 2>>${LOGOUT} 
     1714  if [ $? -ne 0 ] ; then 
     1715     exit_revertsnap "Failed fetching FreeBSD upgrade files!" 
     1716  fi 
     1717  echo_logout "Installing freebsd-update files..." 
     1718  chroot ${STAGEMNT} freebsd-update install >>${LOGOUT} 2>>${LOGOUT} 
     1719  if [ $? -ne 0 ] ; then 
     1720     exit_revertsnap "Failed installing FreeBSD upgrade files!" 
     1721  fi 
     1722 
     1723  # Do it again, remove any old shared objs 
     1724  chroot ${STAGEMNT} freebsd-update install >/dev/null 2>/dev/null 
     1725} 
     1726 
     1727############################################################## 
     1728# End functions for upgrading jails 
     1729############################################################## 
  • src-sh/warden/scripts/backend/zfsmksnap.sh

    r9d5cf20 rbb6487e  
    3333fi 
    3434 
    35 mkZFSSnap "${JAILDIR}" "$2" 
     35mkZFSSnap "${JAILDIR}" "$2" "$3" 
     36exit $? 
  • src-qt5/pc-systemupdatertray/SysStatus.cpp

    r0a9db28 rd5bf56d  
    1616         
    1717void SysStatus::checkSystem(bool checkjails){ 
    18   complete = QFile::exists("/tmp/.fbsdup-reboot"); 
     18  complete = QFile::exists("/tmp/.rebootRequired"); 
    1919  if(!complete){  
    2020    //Get all the possible flag files and only take the most recent (latest flag - they overwrite each other) 
  • src-sh/syscache/daemon/DB.cpp

    r0183a22 r3b3ff1e  
    10111011  } 
    10121012  //Always update the needs reboot flag (no time at all) 
    1013   HASH->insert("System/needsReboot", QFile::exists("/tmp/.fbsdup-reboot") ? "true": "false"); 
     1013  HASH->insert("System/needsReboot", QFile::exists("/tmp/.rebootRequired") ? "true": "false"); 
    10141014} 
    10151015 
Note: See TracChangeset for help on using the changeset viewer.