Browse Source

Stefan Fiedler:


			
			
				rocklinux
			
			
		
Stefan Fiedler 18 years ago
parent
commit
a49fe09c18
10 changed files with 140 additions and 124 deletions
  1. +20
    -35
      package/target-finish/1st-stage/1st-stage.conf
  2. +7
    -0
      package/target-finish/1st-stage/initrd/initrd_bootdisk
  3. +69
    -56
      package/target-finish/1st-stage/linuxrc.sh
  4. +18
    -12
      package/target-finish/2nd-stage/2nd-stage.conf
  5. +3
    -2
      package/target-finish/2nd-stage/linuxrc2.sh
  6. +4
    -2
      package/target-finish/bootloader/bootloader.conf
  7. +8
    -11
      package/target-finish/bootloader/sparc/build.sh
  8. +1
    -1
      package/target-finish/bootloader/sparc/silo.conf
  9. +7
    -5
      package/target-finish/bootloader/x86/build.sh
  10. +3
    -0
      package/target-finish/isofs/isofs.conf

+ 20
- 35
package/target-finish/1st-stage/1st-stage.conf

@ -9,11 +9,10 @@ if [ "$ROCK_BUILD_TARGET" != 1 ] ; then
false false
fi fi
initrd_config="$ROCKCFG_1ST_STAGE_INITRD"
initrd_config="$ROCKCFG_PKG_1ST_STAGE_INITRD"
rootdir="$root" rootdir="$root"
build_rock="$root/ROCK" build_rock="$root/ROCK"
# disksdir="$build_rock/$target"
disksdir="$build_rock/target" disksdir="$build_rock/target"
mkdir -p "$disksdir" mkdir -p "$disksdir"
targetdir="$disksdir/$initrd_config" targetdir="$disksdir/$initrd_config"
@ -28,42 +27,32 @@ initrdfs="ext2fs"
block_size="" block_size=""
case ${initrdfs} in
ext2fs|ext3fs|cramfs)
initrd_img="${disksdir}/$initrd_config.img"
;;
ramfs)
initrd_img="${disksdir}/$initrd_config.cpio"
;;
esac
initrd_img="${disksdir}/$initrd_config.img"
# kernel="$( basename "$( readlink -mn $rootdir/usr/src/linux )" )"
kernel="$( grep "[ =]$ROCKCFG_PKG_LINUX_DEFAULT " $base/config/$config/packages | cut -f6 -d" " )-rock" kernel="$( grep "[ =]$ROCKCFG_PKG_LINUX_DEFAULT " $base/config/$config/packages | cut -f6 -d" " )-rock"
# echo "kernel $kernel"
echo "Creating initrd data:" echo "Creating initrd data:"
rm -rf $disksdir/$initrd_config
mkdir -p $disksdir/$initrd_config/{dev,proc,sys,tmp,scsi,net,bin,etc,lib}
cd $disksdir/$initrd_config # ; ln -s bin sbin ; ln -s . usr
rm -rf ${targetdir}
mkdir -p ${targetdir}/{dev,proc,sys,tmp,scsi,net,bin,sbin,etc,lib}
cd ${targetdir}
# this copies a set of programs and the necessary libraries into a # this copies a set of programs and the necessary libraries into a
# chroot environment # chroot environment
# make mount not complain # make mount not complain
# touch etc/fstab
echo "/dev/root / auto defaults 0 0" > etc/fstab
echo "/dev/root / auto defaults 0 0" > etc/fstab
# supress udev uig/gid warnings # supress udev uig/gid warnings
cp -vp $base/build/$ROCKCFG_ID/etc/{passwd,group} etc/
cp -vp $base/build/$ROCKCFG_ID/lib/libnss_files.so.* lib/
cp -vp ${rootdir}/etc/{passwd,group} etc/
cp -vp ${rootdir}/lib/libnss_files.so.* lib/
echo "Creating some device nodes" echo "Creating some device nodes"
mknod ${targetdir}/dev/ram0 b 1 0
mknod ${targetdir}/dev/null c 1 3
mknod ${targetdir}/dev/zero c 1 5
mknod ${targetdir}/dev/tty c 5 0
mknod ${targetdir}/dev/console c 5 1
mknod dev/ram0 b 1 0
mknod dev/null c 1 3
mknod dev/zero c 1 5
mknod dev/tty c 5 0
mknod dev/console c 5 1
# echo "Create checkisomd5 binary" # echo "Create checkisomd5 binary"
# cp -r ${base}/misc/isomd5sum ${base}/build/${ROCKCFG_ID}/ # cp -r ${base}/misc/isomd5sum ${base}/build/${ROCKCFG_ID}/
@ -132,13 +121,13 @@ sed -i -e "s,^STAGE_2_BIG_IMAGE=\"2nd_stage.tar.gz\"$,STAGE_2_BIG_IMAGE=\"${ROCK
sbin/init sbin/init
for x in modprobe.static modprobe.static.old insmod.static insmod.static.old ; do for x in modprobe.static modprobe.static.old insmod.static insmod.static.old ; do
if [ -f ../2nd_stage/sbin/${x/.static/} ]; then
if [ -f ${rootdir}/sbin/${x/.static/} ]; then
rm -f bin/${x/.static/} rm -f bin/${x/.static/}
cp -a ../2nd_stage/sbin/${x/.static/} bin/
cp -a ${rootdir}/sbin/${x/.static/} bin/
fi fi
if [ -f ../2nd_stage/sbin/$x ]; then
if [ -f ${rootdir}/sbin/$x ]; then
rm -f bin/$x bin/${x/.static/} rm -f bin/$x bin/${x/.static/}
cp -a ../2nd_stage/sbin/$x bin/
cp -a ${rootdir}/sbin/$x bin/
ln -sf $x bin/${x/.static/} ln -sf $x bin/${x/.static/}
fi fi
done done
@ -163,7 +152,8 @@ add_module_to_initrd() {
echo "Copy scsi and network kernel modules." echo "Copy scsi and network kernel modules."
tmptar="`mktemp`" ; tar cfT ${tmptar} /dev/null tmptar="`mktemp`" ; tar cfT ${tmptar} /dev/null
for x in $( cd ${rootdir} ; echo lib/modules/*/kernel/drivers/{scsi,net} )
mkdir -p lib/modules/${kernel}
for x in $( cd ${rootdir} ; echo lib/modules/*/kernel/ drivers/{scsi,net} )
do do
[ -e "${rootdir}/${x}" ] && tar rf ${tmptar} -C ${rootdir} ${x} [ -e "${rootdir}/${x}" ] && tar rf ${tmptar} -C ${rootdir} ${x}
done done
@ -175,9 +165,6 @@ rm -f lib/modules/[0-9]*/kernel/drivers/net/{dummy,ppp*}.{o,ko}
[ -e lib/modules ] && find lib/modules -type f -exec $STRIP --strip-debug {} \; [ -e lib/modules ] && find lib/modules -type f -exec $STRIP --strip-debug {} \;
depmod -b ${targetdir} -F ${rootdir}/boot/System.map -v ${kernel} depmod -b ${targetdir} -F ${rootdir}/boot/System.map -v ${kernel}
# for x in ${rootdir}/lib/modules/*/modules.{dep,pcimap,isapnpmap} ; do
# cp $x ${x#*$rootdir/} || echo "not found: $x" ;
# done
for x in lib/modules/*/kernel/drivers/{scsi,net}; do for x in lib/modules/*/kernel/drivers/{scsi,net}; do
[ -d $x ] && ln -s ${x#lib/modules/} lib/modules/ [ -d $x ] && ln -s ${x#lib/modules/} lib/modules/
@ -219,9 +206,6 @@ done < <( find ${targetdir} -type f | xargs md5sum | sort )
cd .. cd ..
# ramdisk_size=8192
# ramdisk_size="$(( $( du -s $targetdir --block-size=1K | cut -f1 ) + $( du -s $targetdir -block-size=1K | cut -f1 ) / 10 ))"
# [ $ramdisk_size -lt 8192 ] && ramdisk_size=8192
echo "Creating initrd filesystem image (${initrdfs}): " echo "Creating initrd filesystem image (${initrdfs}): "
case "${initrdfs}" in case "${initrdfs}" in
cramfs) cramfs)
@ -232,6 +216,7 @@ ext2fs|ext3fs)
[ "${block_size}" == "" ] && block_size=1024 [ "${block_size}" == "" ] && block_size=1024
block_count="$(( ( $( du -s $targetdir --block-size=$block_size | cut -f1 ) * 11 ) / 10 ))" block_count="$(( ( $( du -s $targetdir --block-size=$block_size | cut -f1 ) * 11 ) / 10 ))"
echo "block_size=$block_size block_count=$block_count" echo "block_size=$block_size block_count=$block_count"
tmpdir=`mktemp -d` ; mkdir -p ${tmpdir} tmpdir=`mktemp -d` ; mkdir -p ${tmpdir}
echo "Creating temporary files in $tmpdir." echo "Creating temporary files in $tmpdir."
dd if=/dev/zero of=${initrd_img} bs=${block_size} count=${block_count} &> /dev/null dd if=/dev/zero of=${initrd_img} bs=${block_size} count=${block_count} &> /dev/null

+ 7
- 0
package/target-finish/1st-stage/initrd/initrd_bootdisk

@ -21,6 +21,7 @@
/bin/awk /bin/awk /bin/awk /bin/awk
/bin/grep /bin/grep /bin/grep /bin/grep
/bin/sleep /bin/sleep /bin/sleep /bin/sleep
/bin/ps /bin/ps
/sbin/ip /sbin/ip /sbin/ip /sbin/ip
/sbin/hwscan /sbin/hwscan /sbin/hwscan /sbin/hwscan
/sbin/pivot_root /sbin/pivot_root /sbin/pivot_root /sbin/pivot_root
@ -29,10 +30,16 @@
/sbin/udevd /sbin/udevd /sbin/udevd /sbin/udevd
/sbin/udevsettle /sbin/udevsettle /sbin/udevsettle /sbin/udevsettle
/sbin/udevtrigger /sbin/udevtrigger /sbin/udevtrigger /sbin/udevtrigger
/sbin/modprobe /sbin/modprobe
/sbin/depmod /sbin/depmod
/bin/mknod /bin/mknod
/usr/sbin/udevmonitor /usr/sbin/udevmonitor
/bin/dmesg /bin/dmesg
/usr/bin/wget /usr/bin/wget /usr/bin/wget /usr/bin/wget
/usr/bin/expand /usr/bin/expand /usr/bin/expand /usr/bin/expand
/usr/bin/readlink /usr/bin/readlink /usr/bin/readlink /usr/bin/readlink
/usr/bin/basename /usr/bin/basename /usr/bin/basename /usr/bin/basename
/usr/bin/killall /usr/bin/killall
/usr/bin/tr /usr/bin/tr /usr/bin/tr /usr/bin/tr
/usr/sbin/lspci /usr/sbin/lspci /usr/sbin/lspci /usr/sbin/lspci
/etc/udev /etc/udev /etc/udev /etc/udev

+ 69
- 56
package/target-finish/1st-stage/linuxrc.sh

@ -4,7 +4,9 @@ export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
STAGE_2_BIG_IMAGE="2nd_stage.tar.gz" STAGE_2_BIG_IMAGE="2nd_stage.tar.gz"
STAGE_2_SMALL_IMAGE="2nd_stage_small.tar.gz" STAGE_2_SMALL_IMAGE="2nd_stage_small.tar.gz"
STAGE_2_COMPRESS_ARG="--use-compress-program=gzip"
# Use -m to not let tar complain about modification times in the future, e.g.
# if the system clock is not set.
STAGE_2_COMPRESS_ARG="--use-compress-program=gzip -m"
#640kB, err, 64 MB should be enought for the tmpfs ;-) #640kB, err, 64 MB should be enought for the tmpfs ;-)
TMPFS_OPTIONS="size=67108864" TMPFS_OPTIONS="size=67108864"
@ -32,46 +34,53 @@ mod_load_info () { # {{{
fi fi
} # }}} } # }}}
doboot() { # {{{ doboot() { # {{{
if ! mkdir /mnt_root/old_root ; then
if ! mkdir -p /mnt_root/old_root ; then
echo "Can't create /mnt_root/old_root" echo "Can't create /mnt_root/old_root"
exit_linuxrc=0
return 1
fi fi
if [ ! -f /mnt_root/sbin/init ] ; then if [ ! -f /mnt_root/sbin/init ] ; then
echo "Can't find /mnt_root/sbin/init!" echo "Can't find /mnt_root/sbin/init!"
exit_linuxrc=0
return 1
fi fi
if [ ${exit_linuxrc} -ne 0 ] ; then
if ! pivot_root "/mnt_root" "/mnt_root/old_root" ; then
echo "Can't call pivot_root"
exit_linuxrc=0
return
fi
# pivot_root may or may not change the PWD and root of the
# caller, so we change into the new root directory first.
cd /mnt_root
if ! pivot_root . "/mnt_root/old_root" ; then
echo "Can't call pivot_root"
cd / cd /
return 1
fi
if ! mount --move /old_root/dev /dev ; then
echo "Can't remount /old_root/dev as /dev"
fi
if ! mount --move /old_root/dev /dev ; then
echo "Can't remount /old_root/dev as /dev"
fi
if ! mount --move /old_root/proc /proc ; then
echo "Can't remount /old_root/proc as /proc"
fi
if ! mount --move /old_root/proc /proc ; then
echo "Can't remount /old_root/proc as /proc"
fi
if [[ "$( < /proc/version )" == "Linux version 2.6."* ]] ; then
if ! mount --move /old_root/sys /sys ; then if ! mount --move /old_root/sys /sys ; then
echo "Can't remount /old_root/sys as /sys" echo "Can't remount /old_root/sys as /sys"
fi fi
fi
if ! umount /old_root/tmp ; then
echo "Can't umount /old_root/tmp"
fi
if ! umount /old_root/tmp ; then
echo "Can't umount /old_root/tmp"
fi
else
rmdir /mnt_root/old_root || echo "Can't remove /mnt_root/old_root"
sed -e "s, /mnt_root , / ," /old_root/etc/mtab > /etc/mtab
umount /mnt_root || echo "Can't umount /mnt_root"
rmdir /mnt_root || echo "Can't remove /mnt_root"
fi
# Kill udevd so /old_root can be unmounted.
udev_pid="$( ps -C udevd -o pid= )"
[ "$udev_pid" ] && kill $udev_pid
exec chroot . sh -c "exec /sbin/init" <dev/console >dev/console 2>&1
echo "Can't exec /sbin/init!"
return 1
} # }}} } # }}}
trymount() { # {{{ trymount() { # {{{
source=${1} source=${1}
@ -111,15 +120,14 @@ EOF
echo "[ ${url} ]" echo "[ ${url} ]"
export ROCK_INSTALL_SOURCE_URL=${baseurl} export ROCK_INSTALL_SOURCE_URL=${baseurl}
exit_linuxrc=1;
if ! mkdir /mnt_root ; then if ! mkdir /mnt_root ; then
echo "Can't create /mnt_root" echo "Can't create /mnt_root"
exit_linuxrc=0
return 1
fi fi
if ! mount -t tmpfs -O ${TMPFS_OPTIONS} none /mnt_root ; then
if ! mount -t tmpfs -O ${TMPFS_OPTIONS} tmpfs /mnt_root ; then
echo "Can't mount /mnt_root" echo "Can't mount /mnt_root"
exit_linuxrc=0
return 1
fi fi
wget -O - ${url} | tar ${STAGE_2_COMPRESS_ARG} -C /mnt_root -xf - wget -O - ${url} | tar ${STAGE_2_COMPRESS_ARG} -C /mnt_root -xf -
@ -296,44 +304,42 @@ EOF
filename="${text}" filename="${text}"
fi fi
exit_linuxrc=1
echo "Using ${devicefile}:${filename}." echo "Using ${devicefile}:${filename}."
if ! mkdir -p /mnt_source ; then if ! mkdir -p /mnt_source ; then
echo "Can't create /mnt_source" echo "Can't create /mnt_source"
exit_linuxrc=0
return 1
fi fi
if ! mount ${mountopts} ${devicefile} "/mnt_source" ; then if ! mount ${mountopts} ${devicefile} "/mnt_source" ; then
echo "Can't mount /mnt_source" echo "Can't mount /mnt_source"
exit_linuxrc=0
return 1
fi fi
if ! mkdir -p /mnt_root ; then if ! mkdir -p /mnt_root ; then
echo "Can't create /mnt_root" echo "Can't create /mnt_root"
exit_linuxrc=0
return 1
fi fi
if ! mount -t tmpfs -o ${TMPFS_OPTIONS} tmpfs /mnt_root ; then if ! mount -t tmpfs -o ${TMPFS_OPTIONS} tmpfs /mnt_root ; then
echo "Can't mount tmpfs on /mnt_root" echo "Can't mount tmpfs on /mnt_root"
exit_linuxrc=0
return 1
fi fi
echo "Extracting 2nd stage filesystem to ram ..." echo "Extracting 2nd stage filesystem to ram ..."
if ! tar ${STAGE_2_COMPRESS_ARG} -C /mnt_root -xf /mnt_source/${filename} ; then if ! tar ${STAGE_2_COMPRESS_ARG} -C /mnt_root -xf /mnt_source/${filename} ; then
echo "Can't extract /mnt/source/${filename}" echo "Can't extract /mnt/source/${filename}"
exit_linuxrc=0
return 1 return 1
fi fi
if ! umount "/mnt_source" ; then if ! umount "/mnt_source" ; then
echo "Can't umount /mnt_source" echo "Can't umount /mnt_source"
exit_linuxrc=0
return 1
fi fi
if ! rmdir "/mnt_source" ; then if ! rmdir "/mnt_source" ; then
echo "Can't remove /mnt_source" echo "Can't remove /mnt_source"
exit_linuxrc=0
return 1
fi fi
export ROCK_INSTALL_SOURCE_DEV=${devicefile} export ROCK_INSTALL_SOURCE_DEV=${devicefile}
@ -385,11 +391,11 @@ checkisomd5() { # {{{
getcdromdevice 1 0 0 || return getcdromdevice 1 0 0 || return
echo "Running check..." echo "Running check..."
/bin/checkisomd5 ${devicefile}
/bin/checkisomd5 --verbose ${devicefile}
code=${?} code=${?}
if [ ${code} -eq 1 ] ; then
if [ ${code} -eq 0 ] ; then
echo "MD5Sum is correct." echo "MD5Sum is correct."
elif [ ${code} -eq 0 ] ; then
elif [ ${code} -eq 1 ] ; then
echo "MD5Sum is NOT correct! Please contact the authors!" echo "MD5Sum is NOT correct! Please contact the authors!"
fi fi
@ -403,29 +409,40 @@ emit_udev_events() { # {{{
} # }}} } # }}}
input=1 input=1
exit_linuxrc=0
[ -z "${autoboot}" ] && autoboot=0 [ -z "${autoboot}" ] && autoboot=0
# mount / / -o remount,rw || echo "Can't remount / read-/writeable" # mount / / -o remount,rw || echo "Can't remount / read-/writeable"
# mount / / -o remount,rw || echo "Can't remount / read-/writeable (for mount log)" # mount / / -o remount,rw || echo "Can't remount / read-/writeable (for mount log)"
mount -t tmpfs tmpfs /tmp -o ${TMPFS_OPTIONS} || echo "Can't mount a tmpfs on /tmp" mount -t tmpfs tmpfs /tmp -o ${TMPFS_OPTIONS} || echo "Can't mount a tmpfs on /tmp"
mount -t proc proc /proc || echo "Can't mount proc on /proc!" mount -t proc proc /proc || echo "Can't mount proc on /proc!"
mount -t sysfs sysfs /sys || echo "Can't mount sysfs on /sys!"
mount -t tmpfs tmpfs /dev || echo "Can't mount a tmpfs on /dev!"
mount -t tmpfs tmpfs /tmp -o ${TMPFS_OPTIONS} || echo "Can't mount a tmpfs on /tmp"
mount -t proc proc /proc || echo "Can't mount proc on /proc!"
# /sbin/depmod -ae
cp -r /lib/udev/devices/* /dev
case "$( < /proc/version )" in
"Linux version 2.4."*)
mount -t devfs devfs /dev || echo "Can't mount devfs on /dev!" ;;
"Linux version 2.6."*)
mount -t sysfs sysfs /sys || echo "Can't mount sysfs on /sys!"
echo "" > /proc/sys/kernel/hotplug
/sbin/udevd --daemon
if type -p udevd > /dev/null ; then
mount -t tmpfs tmpfs /dev || echo "Can't mount a tmpfs on /dev!"
# create nodes for devices already in kernel
emit_udev_events
cp -r /lib/udev/devices/* /dev
mod_load_info
echo "" > /proc/sys/kernel/hotplug
/sbin/udevd --daemon
# some devices (scsi...) need time to settle...
echo "Waiting for devices to settle..."
sleep 5
# create nodes for devices already in kernel
emit_udev_events
mod_load_info
# some devices (scsi...) need time to settle...
echo "Waiting for devices to settle..."
sleep 5
fi ;;
esac
ip addr add 127.0.0.1 dev lo ip addr add 127.0.0.1 dev lo
ip link set lo up ip link set lo up
@ -445,7 +462,7 @@ you will not spend much time here. Just load your SCSI and networking
drivers (if needed) and configure the installation source so the drivers (if needed) and configure the installation source so the
2nd stage boot system can be loaded and you can start the installation. 2nd stage boot system can be loaded and you can start the installation.
EOF EOF
while [ ${exit_linuxrc} -eq 0 ] ; do
while : ; do
cat <<EOF cat <<EOF
0. Load 2nd stage system from cdrom or floppy drive 0. Load 2nd stage system from cdrom or floppy drive
1. Load 2nd stage system from any device 1. Load 2nd stage system from any device
@ -499,7 +516,3 @@ EOF
echo "No such option present!" echo "No such option present!"
esac esac
done done
exec /sbin/init
echo "Can't start /sbin/init!! Life sucks.\n\n"

+ 18
- 12
package/target-finish/2nd-stage/2nd-stage.conf

@ -70,8 +70,6 @@ if [ "$ROCK_BUILD_TARGET" != 1 ] ; then
false false
fi fi
# taropt="--use-compress-program=bzip2 -xf"
build_rock="$root/ROCK" build_rock="$root/ROCK"
disksdir="$build_rock/target" disksdir="$build_rock/target"
@ -80,7 +78,7 @@ echo "Creating 2nd stage filesystem:"
rm -rf $disksdir/2nd_stage{,_small} rm -rf $disksdir/2nd_stage{,_small}
mkdir -p $disksdir/2nd_stage mkdir -p $disksdir/2nd_stage
cd $disksdir/2nd_stage cd $disksdir/2nd_stage
mkdir -p mnt/source mnt/target
mkdir -p mnt/{source,target}
# #
if [ "$ROCKCFG_CREATE_TARBZ2" == 1 ] ; then if [ "$ROCKCFG_CREATE_TARBZ2" == 1 ] ; then
@ -105,11 +103,6 @@ do
xpkg="${pkg#*=}" ; pkg="{pkg%=*}" xpkg="${pkg#*=}" ; pkg="{pkg%=*}"
eval x="$build_rock/pkgs/$xpkg$pkg_suffix" eval x="$build_rock/pkgs/$xpkg$pkg_suffix"
# if $ROCKCFG_PKGFILE_VER == 1 ; then
# x="$xpkg-$pkg_ver-$pkg_extraver.$pkg_suffix"
# else
# x="$xpkg.$pkg_suffix"
# fi
if [ -z "${xpkg##*:dev*}" -o -z "${xpkg##*:doc*}" ] if [ -z "${xpkg##*:dev*}" -o -z "${xpkg##*:doc*}" ]
then then
@ -130,16 +123,29 @@ do
fi fi
done done
# #
echo "Saving boot/* - we do not need this on the 2nd stage ..."
rm -rf ../boot ; mkdir ../boot
mv boot/* ../boot/
#
echo "Remove the stuff we do not need ..." echo "Remove the stuff we do not need ..."
rm -rf boot
rm -rf home usr/{local,doc,man,info,games,share} rm -rf home usr/{local,doc,man,info,games,share}
rm -rf var/{adm,games,mail,opt} rm -rf var/{adm,games,mail,opt}
rm -rf usr/{include,src,*-linux-gnu} {,usr/}lib/*.{a,la,o} rm -rf usr/{include,src,*-linux-gnu} {,usr/}lib/*.{a,la,o}
for x in usr/lib/*/ ; do rm -rf ${x%/} ; done for x in usr/lib/*/ ; do rm -rf ${x%/} ; done
# #
if [ $ROCKCFG_ARCH = arm ] ; then
echo "Installing /usr/lib/libgcc_s.so.1 ..."
pkg_ver="$( grep "[ =]$ROCKCFG_DEFAULT_CC " $base/config/$config/packages | cut -f6 -d" " )"
pkg_extraver="$( grep "[ =]$ROCKCFG_DEFAULT_CC " $base/config/$config/packages | cut -f7 -d" " )"
echo "$pkg_suffix $pkg_ver $pkg_extraver"
eval echo $pkg_suffix
eval x=$build_rock/pkgs/$ROCKCFG_DEFAULT_CC$pkg_suffix
if [[ "$pkg_suffix" == *gem ]] ; then
mine -k pkg_tarbz2 $x > tmp/$ROCKCFG_DEFAULT_CC.tar.bz2
x=tmp/$ROCKCFG_DEFAULT_CC.tar.bz2
fi
tar $taropt $x "usr/lib/libgcc_s.so*"
fi
ldconfig -r $disksdir/2nd_stage
echo "Installing some terminfo databases ..." echo "Installing some terminfo databases ..."
pkg_ver="$( grep " ncurses " $base/config/$config/packages | cut -f6 -d" " )" pkg_ver="$( grep " ncurses " $base/config/$config/packages | cut -f6 -d" " )"
pkg_extraver="$( grep " ncurses " $base/config/$config/packages | cut -f7 -d" " )" pkg_extraver="$( grep " ncurses " $base/config/$config/packages | cut -f7 -d" " )"

+ 3
- 2
package/target-finish/2nd-stage/linuxrc2.sh

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
if type -p gzip > /dev/null ; then if type -p gzip > /dev/null ; then
umount -d /old_root ; rmdir /old_root umount -d /old_root ; rmdir /old_root
else else
@ -66,6 +67,7 @@ if [ -z "$autoboot" ]; then
else else
cat <<- EOT > /sbin/login-shell cat <<- EOT > /sbin/login-shell
#!/bin/bash #!/bin/bash
cd cd
case "\$( tty )" in case "\$( tty )" in
/dev/vc/1) /dev/vc/1)
@ -87,4 +89,3 @@ done
exec < /dev/null > /dev/null 2>&1 exec < /dev/null > /dev/null 2>&1
while : ; do sleep 1 ; done while : ; do sleep 1 ; done

+ 4
- 2
package/target-finish/bootloader/bootloader.conf

@ -1,3 +1,4 @@
#!/bin/bash
mainfunction="bootloader_mainfunction" mainfunction="bootloader_mainfunction"
@ -9,7 +10,8 @@ if [ "$ROCK_BUILD_TARGET" != 1 ] ; then
false false
fi fi
build_rock="$xroot/ROCK"
rootdir="$root"
build_rock="$root/ROCK"
disksdir="$build_rock/target" disksdir="$build_rock/target"
tmpdir="$( mktemp -d )" ; mkdir -p "$tmpdir" tmpdir="$( mktemp -d )" ; mkdir -p "$tmpdir"
@ -35,7 +37,7 @@ cd $disksdir; rm -rf isofs; mkdir -p isofs
echo "Creating isofs directory.." echo "Creating isofs directory.."
ln 2nd_stage.tar.gz 2nd_stage_small.tar.gz isofs/ ln 2nd_stage.tar.gz 2nd_stage_small.tar.gz isofs/
ln *.img initrd.gz isofs/ 2>/dev/null || true # might not exist on some architectures
ln *.img $ROCKCFG_PKG_1ST_STAGE_INITRD.gz isofs/ 2>/dev/null || true # might not exist on some architectures
echo "Creating isofs.txt file .." echo "Creating isofs.txt file .."
echo "DISK1 build/${ROCKCFG_ID}/ROCK/target/isofs/ ` echo "DISK1 build/${ROCKCFG_ID}/ROCK/target/isofs/ `

+ 8
- 11
package/target-finish/bootloader/sparc/build.sh

@ -1,8 +1,8 @@
cd $disksdir cd $disksdir
echo "Cleaning boot directory:"
rm -rfv boot/*-rock boot/System.map boot/kconfig* boot/initrd*img boot/*.b
# echo "Cleaning boot directory:"
# rm -rfv boot/*-rock boot/System.map boot/kconfig* boot/initrd*img boot/*.b
echo "Creating silo setup:" echo "Creating silo setup:"
# #
@ -19,15 +19,12 @@ fi
tar -O $taropt $x boot/second.b > boot/second.b tar -O $taropt $x boot/second.b > boot/second.b
# #
echo "Creating silo config file." echo "Creating silo config file."
cp -v $confdir/sparc/{silo.conf,boot.msg,help1.txt} \
boot
cp -v $confdir/sparc/{silo.conf,boot.msg,help1.txt} boot/
# #
echo "Moving image (initrd) to boot directory."
mv -v $ROCKCFG_PKG_1ST_STAGE_INITRD.gz boot/
echo "Copying images to boot directory."
cp -p $ROCKCFG_PKG_1ST_STAGE_INITRD.gz $rootdir/boot/{vmlinuz32,image} boot/ || true
# #
buildroot="build/${ROCKCFG_ID}"
datadir="build/${ROCKCFG_ID}/ROCK/target"
cat > $xroot/ROCK/isofs_arch.txt <<- EOT
BOOT -G $buildroot/boot/isofs.b -B ...
DISK1 $datadir/boot/ boot/
cat > $build_rock/isofs_arch.txt <<- EOT
BOOT -G $rootdir/boot/isofs.b -B ...
DISK1 $disksdir/boot/ boot/
EOT EOT

+ 1
- 1
package/target-finish/bootloader/sparc/silo.conf

@ -17,6 +17,6 @@ image="cat /boot/help1.txt"
image[sun4u]=/boot/vmlinux64.gz image[sun4u]=/boot/vmlinux64.gz
label=install label=install
alias=linux alias=linux
image[sun4c,sun4d,sun4m]=/boot/vmlinux32.gz
image[sun4c,sun4d,sun4m]=/boot/image.gz
label=install label=install
alias=linux alias=linux

+ 7
- 5
package/target-finish/bootloader/x86/build.sh

@ -9,6 +9,7 @@ mdlbl_ver="`sed -n 's,.*mdlbl-\(.*\).tar.*,\1,p' \
cd $disksdir cd $disksdir
echo "Creating lilo config and cleaning boot directory:" echo "Creating lilo config and cleaning boot directory:"
rm -rf boot/ ; mkdir -p boot/
cp $confdir/x86/lilo-* boot/ cp $confdir/x86/lilo-* boot/
rm -rfv boot/{grub,System.map*,kconfig*} rm -rfv boot/{grub,System.map*,kconfig*}
@ -41,7 +42,7 @@ then
echo "Creating isolinux setup:" echo "Creating isolinux setup:"
# #
echo "Extracting isolinux boot loader." echo "Extracting isolinux boot loader."
mkdir -p isolinux
rm -rf isolinux ; mkdir -p isolinux
tar -O $taropt $base/download/mirror/s/syslinux-$syslinux_ver.tar.bz2 \ tar -O $taropt $base/download/mirror/s/syslinux-$syslinux_ver.tar.bz2 \
syslinux-$syslinux_ver/isolinux.bin > isolinux/isolinux.bin syslinux-$syslinux_ver/isolinux.bin > isolinux/isolinux.bin
# #
@ -50,13 +51,14 @@ then
cp $confdir/x86/help?.txt isolinux/ cp $confdir/x86/help?.txt isolinux/
# #
echo "Copy images to isolinux directory." echo "Copy images to isolinux directory."
[ -e boot/memtest86.bin ] && cp boot/memtest86.bin isolinux/memtest86 || true
cp initrd.gz boot/vmlinuz isolinux/
[ -e $rootdir/boot/memtest86.bin ] && \
cp $rootdir/boot/memtest86.bin isolinux/memtest86 || true
cp $ROCKCFG_PKG_1ST_STAGE_INITRD.gz $rootdir/boot/vmlinuz isolinux/
# #
cat > $xroot/ROCK/isofs_arch.txt <<- EOT
cat > $build_rock/isofs_arch.txt <<- EOT
BOOT -b isolinux/isolinux.bin -c isolinux/boot.catalog BOOT -b isolinux/isolinux.bin -c isolinux/boot.catalog
BOOTx -no-emul-boot -boot-load-size 4 -boot-info-table BOOTx -no-emul-boot -boot-load-size 4 -boot-info-table
DISK1 build/${ROCKCFG_ID}/ROCK/target/isolinux/ isolinux/
DISK1 $disksdir/isolinux/ isolinux/
EOT EOT
fi fi

+ 3
- 0
package/target-finish/isofs/isofs.conf

@ -19,6 +19,9 @@ DISK1 $admdir/descs/ ${ROCKCFG_SHORTID}/info/descs/
DISK1 $admdir/flists/ ${ROCKCFG_SHORTID}/info/flists/ DISK1 $admdir/flists/ ${ROCKCFG_SHORTID}/info/flists/
DISK1 $admdir/md5sums/ ${ROCKCFG_SHORTID}/info/md5sums/ DISK1 $admdir/md5sums/ ${ROCKCFG_SHORTID}/info/md5sums/
DISK1 $admdir/packages/ ${ROCKCFG_SHORTID}/info/packages/ DISK1 $admdir/packages/ ${ROCKCFG_SHORTID}/info/packages/
DISK1 $admdir/provides/ ${ROCKCFG_SHORTID}/info/provides/
DISK1 $admdir/requires/ ${ROCKCFG_SHORTID}/info/requires/
DISK1 $admdir/conflicts/ ${ROCKCFG_SHORTID}/info/conflicts/
EOT EOT
ls -l $xroot/ROCK/isofs_*.txt ls -l $xroot/ROCK/isofs_*.txt

Loading…
Cancel
Save