[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[plamo:29346] Re: Plamo-4.5b2 のinstallpkg について



From: "M.H" <misty_haiku@xxxxxxxxx>
Subject: [plamo:29344] Re: Plamo-4.5b2 の installpkg について
Date: Sun, 21 Sep 2008 00:00:41 +0900

> と思ったんですが、1点だけ気になるのは、-root オプションが
> 効かなくなってしまっているんじゃないかということです。
> 
> -root /mnt とかが設定されている場合は、
> ( cd /mnt ; /etc/rc.d/rc.initpkg )

rc.initpkg の方も絶対パスで指定していたところがあったので,こんな感じになるかな?

diff -car org/etc/rc.d/rc.initpkg new/etc/rc.d/rc.initpkg
*** org/etc/rc.d/rc.initpkg	2008-09-21 09:19:18.036305493 +0900
--- new/etc/rc.d/rc.initpkg	2008-09-21 09:33:39.963225657 +0900
***************
*** 3,26 ****
  
  # initialize package with newly installed environment.
  # echo "ldconfig to new libraries"
! /sbin/ldconfig
  # Set the hostname.
  #echo -n "Set the hostname: "
  if [ ! -r /etc/HOSTNAME ]; then
      # If there's no /etc/HOSTNAME, fall back on this default.
!     echo "darkstar.frop.org" > /etc/HOSTNAME
  fi
- HOST=`cat /etc/HOSTNAME`
  HOST=${HOST%%.*}
  /bin/hostname "$HOST"
  
  while true; do
      DO_INIT=no
!     for p in `ls -1tr /var/log/initpkg`; do
!       sh /var/log/initpkg/$p && (rm /var/log/initpkg/$p; DO_INIT=yes)
  # for debugging
  #       echo "initpkg:$p" >> /var/log/packages/initpkg.log
! #       sh /var/log/initpkg/$p 2>&1 | tee -a /var/log/packages/initpkg.log && (rm /var/log/initpkg/$p; DO_INIT=yes)
      done
      if [ "$DO_INIT" = "no" ]; then
        break
--- 3,27 ----
  
  # initialize package with newly installed environment.
  # echo "ldconfig to new libraries"
! ldconfig
  # Set the hostname.
  #echo -n "Set the hostname: "
  if [ ! -r /etc/HOSTNAME ]; then
      # If there's no /etc/HOSTNAME, fall back on this default.
!     HOST='darkstar.frop.org'
! else
!     HOST=`cat /etc/HOSTNAME`
  fi
  HOST=${HOST%%.*}
  /bin/hostname "$HOST"
  
  while true; do
      DO_INIT=no
!     for p in `ls -1tr ./var/log/initpkg`; do
!       sh ./var/log/initpkg/$p && (rm ./var/log/initpkg/$p; DO_INIT=yes)
  # for debugging
  #       echo "initpkg:$p" >> /var/log/packages/initpkg.log
! #       sh ./var/log/initpkg/$p 2>&1 | tee -a ./var/log/packages/initpkg.log && (rm ./var/log/initpkg/$p; DO_INIT=yes)
      done
      if [ "$DO_INIT" = "no" ]; then
        break
diff -car org/sbin/installpkg new/sbin/installpkg
*** org/sbin/installpkg	2008-09-21 07:57:47.820960373 +0900
--- new/sbin/installpkg	2008-09-21 08:00:05.237641902 +0900
***************
*** 42,47 ****
--- 42,48 ----
    case $1 in
      -root)  # -root /mnt
         opts="`echo $opts $1 $2`"
+        mnt_point=$2
         shift ; shift
       ;;
      -priority) 
***************
*** 99,103 ****
  
  # we are on the running system, so need to run initpkg now.
  if [ -x /etc/rc.d/rc.initpkg ]; then
!     /etc/rc.d/rc.initpkg
  fi
--- 100,108 ----
  
  # we are on the running system, so need to run initpkg now.
  if [ -x /etc/rc.d/rc.initpkg ]; then
!     if [ "$mnt_point.x" = ".x" ]; then
!    	( cd / ;  /etc/rc.d/rc.initpkg )
!     else
! 	( cd $mnt_point ; /etc/rc.d/rc.initpkg )
!     fi
  fi
diff -car org/sbin/installpkg2 new/sbin/installpkg2
*** org/sbin/installpkg2	2008-09-21 08:10:38.453382372 +0900
--- new/sbin/installpkg2	2008-09-21 08:11:24.223378916 +0900
***************
*** 164,170 ****
  # Set the prefix for the package database directories (packages, scripts).
  ADM_DIR="$ROOT/var/log"
  # If the directories don't exist, "initialize" the package database:
! for PKGDBDIR in packages removed_packages removed_scripts scripts setup ; do
    if [ ! -d $ADM_DIR/$PKGDBDIR ]; then
      rm -rf $ADM_DIR/$PKGDBDIR # make sure it's not a symlink or something stupid
      mkdir -p $ADM_DIR/$PKGDBDIR
--- 164,170 ----
  # Set the prefix for the package database directories (packages, scripts).
  ADM_DIR="$ROOT/var/log"
  # If the directories don't exist, "initialize" the package database:
! for PKGDBDIR in packages removed_packages removed_scripts scripts setup initpkg ; do
    if [ ! -d $ADM_DIR/$PKGDBDIR ]; then
      rm -rf $ADM_DIR/$PKGDBDIR # make sure it's not a symlink or something stupid
      mkdir -p $ADM_DIR/$PKGDBDIR

-----
こじま


Follow-Ups
[plamo:29349] Re: Plamo-4.5b2 のinstallpkg について, M.H
References
[plamo:29342] Re: Plamo-4.5b2 のinstallpkg について, KOJIMA Mitsuhiro
[plamo:29343] Re: Plamo-4.5b2 のinstallpkg について, M.H
[plamo:29344] Re: Plamo-4.5b2 のinstallpkg について, M.H

[検索ページ] [メール一覧]
Plamo ML 公開システム