Browse Source

Tobias Hintze:

update rockinitramfs package



git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@8626 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
rocklinux
Tobias Hintze 17 years ago
parent
commit
f9ee1623c7
7 changed files with 57 additions and 13 deletions
  1. +2
    -0
      package/teha/rockinitramfs/build.d/11-run_init
  2. +1
    -1
      package/teha/rockinitramfs/build.d/80-init_d
  3. +4
    -0
      package/teha/rockinitramfs/files/etc/profile
  4. +3
    -8
      package/teha/rockinitramfs/files/linuxrc.sh
  5. +34
    -0
      package/teha/rockinitramfs/files/run_init/90-go_real
  6. +12
    -3
      package/teha/rockinitramfs/libexec/mkinitramfs.sh
  7. +1
    -1
      package/teha/rockinitramfs/rockinitramfs.desc

+ 2
- 0
package/teha/rockinitramfs/build.d/11-run_init

@ -5,4 +5,6 @@ gcc -c $filesdir/run_init/runinitlib.c -o $TMPDIR/run_init/runinitlib.o
gcc $TMPDIR/run_init/*.o -o $TMPDIR/run_init/run_init
echo dir /real-root 0755 0 0
echo file /sbin/run_init $TMPDIR/run_init/run_init 0755 0 0
echo file /init.d/90-go_real $filesdir/run_init/90-go_real 0644 0 0

+ 1
- 1
package/teha/rockinitramfs/build.d/80-init_d

@ -3,7 +3,7 @@ echo "file /etc/fstab $filesdir/empty 644 0 0"
echo "file /etc/mtab $filesdir/empty 644 0 0"
echo "dir /init.d 0755 0 0"
for x in $filesdir/init.d/[0-9]*
for x in $filesdir/init.d/[0-9][0-9]*
do
echo "file /init.d/`basename $x` $x 755 0 0"
done

+ 4
- 0
package/teha/rockinitramfs/files/etc/profile

@ -1 +1,5 @@
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
for x in /etc/profile.d/*
do
[ -f "$x" ] && . $x
done

+ 3
- 8
package/teha/rockinitramfs/files/linuxrc.sh

@ -4,11 +4,6 @@ for x in /init.d/*
do
. $x
done
echo "going real..."
if [ -x /real-root/sbin/init ]
then
exec /sbin/run_init /real-root /sbin/init
else
echo "no /real-root/sbin/init found. spawning /bin/bash..."
exec /bin/bash --login
fi
echo "end of build.d reached -- spawning /bin/bash..."
exec /bin/bash --login

+ 34
- 0
package/teha/rockinitramfs/files/run_init/90-go_real

@ -0,0 +1,34 @@
# read root parameter from cmdline
root=$(sed 's/.*\<root=\([^ ]*\).*/\1/' /proc/cmdline)
# set $(< /proc/cmdline ) ; for arg ; do [[ ${arg} == root=* ]] && root=${arg#root=}
if [ ! -e "$root" ]
then
echo "your root <$root> does not exist."
else
# FIXME mount ro if /proc/cmdline says so...
mount $root /real-root
fi
# thanks udevd. you did a great job.
# now go away and let the real system do its work.
echo "terminating udevd..."
killall udevd
sleep 1
rm -rf /dev/.udev
if [ -e /real-root/dev ]
then
mount --move /dev /real-root/dev
mount --move /sys /real-root/sys
mount --move /proc /real-root/proc
else
echo "outch. /real-root/dev does not exist."
fi
echo "going real..."
if [ -x /real-root/sbin/init ]
then
exec /bin/run_init /real-root /sbin/init
fi

+ 12
- 3
package/teha/rockinitramfs/libexec/mkinitramfs.sh

@ -19,9 +19,11 @@ usage() {
mkinitramfs -r $k_ver -m $mod_origin -o $outfile
Options:
-r Specify kernel version to use for modules dir
-m Specify directory where to search for kernel modules
-o Specify location of output file
-r Specify kernel version to use for modules dir
-m Specify directory where to search for kernel modules
-o Specify location of output file
-p VAR=val Pass some variable definition to the build.d scripts
-O output file list to given location
--root-dir
--build-dir
@ -45,6 +47,10 @@ do
mod_origin=$2
shift
;;
-O)
listoutfile=$2
shift
;;
-o)
outfile=$2
shift
@ -96,6 +102,7 @@ export LIBEXEC=${BASE}/libexec
[ "${filesdir:0:1}" = "/" ] || filesdir="$rootdir/$filesdir"
[ ${outfile:0:1} = "/" ] || outfile="`pwd`/$outfile"
[ ${listoutfile:0:1} = "/" ] || listoutfile="`pwd`/$listoutfile"
[ ${mod_origin:0:1} = "/" ] || mod_origin="`pwd`/$mod_origin"
@ -135,6 +142,8 @@ fi
# create and compress cpio archive
${LIBEXEC}/${cross_compile}gen_init_cpio ${TMPDIR}/list | gzip -9 > $outfile
[ -n "$listoutfile" ] && cp -v ${TMPDIR}/list "$listoutfile"
if [ -n "$verbose" ]
then
echo "contents of TMPDIR=$TMPDIR:"

+ 1
- 1
package/teha/rockinitramfs/rockinitramfs.desc

@ -34,6 +34,6 @@
[L] GPL
[S] Stable
[V] 2
[V] 3
[P] X ---3-----9 236.500

Loading…
Cancel
Save