diff --git a/package/target-finish/1st-stage/1st-stage.conf b/package/target-finish/1st-stage/1st-stage.conf index 280857c6b..07ad08d81 100644 --- a/package/target-finish/1st-stage/1st-stage.conf +++ b/package/target-finish/1st-stage/1st-stage.conf @@ -4,7 +4,14 @@ mainfunction="first_stage_mainfunction" first_stage_mainfunction () { -disksdir="$build_rock/bootdisk" + +if [ $ROCKCFG_BUILD_TARGET != 1 ] ; then + echo "$xpkg can only be built with ./scripts/Build-Target!" + false +fi + +build_rock="/ROCK" +disksdir="$build_rock/$target" echo "Creating initrd data:" rm -rf $disksdir/initrd @@ -14,9 +21,6 @@ cd $disksdir/initrd; ln -s bin sbin; ln -s . usr # make mount not complain touch etc/fstab -rock_targetdir="$base/target/$target/" -rock_target="$target" - rootdir="$disksdir/2nd_stage" targetdir="$disksdir/initrd" cross_compile="" @@ -61,7 +65,7 @@ chroot ${base}/build/${ROCKCFG_ID}/ /compile_isomd5sum.sh cp ${base}/build/${ROCKCFG_ID}/isomd5sum/checkisomd5 bin/ rm -rf ${base}/build/${ROCKCFG_ID}/compile_isomd5sum.sh ${base}/build/${ROCKCFG_ID}/isomd5sum echo "Copying and adjusting linuxrc scipt" -cp ${base}/target/${target}/linuxrc.sh sbin/init +cp $confdir/linuxrc.sh sbin/init chmod +x sbin/init sed -i -e "s,^STAGE_2_BIG_IMAGE=\"2nd_stage.tar.gz\"$,STAGE_2_BIG_IMAGE=\"${ROCKCFG_SHORTID}/2nd_stage.tar.gz\"," \ -e "s,^STAGE_2_SMALL_IMAGE=\"2nd_stage_small.tar.gz\"$,STAGE_2_SMALL_IMAGE=\"${ROCKCFG_SHORTID}/2nd_stage_small.tar.gz\"," \ @@ -83,7 +87,7 @@ needed_libs() { libs="${libs} `needed_libs bin/checkisomd5`" echo "Copying other files ... " -for x in ${rock_targetdir}/initrd/initrd_* ; do +for x in $confdir/initrd/initrd_* ; do [ -f ${x} ] || continue while read file target ; do file="${rootdir}/${file}" @@ -222,6 +226,4 @@ esac echo "Compressing initrd image file." gzip -9 -c ${initrd_img} > ${initrd_img}.gz mv ${initrd_img%.img}{.img,}.gz - -target="$rock_target" } diff --git a/package/target-finish/1st-stage/1st-stage.desc b/package/target-finish/1st-stage/1st-stage.desc index 0c4a07980..c56cc2bad 100644 --- a/package/target-finish/1st-stage/1st-stage.desc +++ b/package/target-finish/1st-stage/1st-stage.desc @@ -21,11 +21,9 @@ [COPY] [COPY] --- ROCK-COPYRIGHT-NOTE-END --- -[I] Raid Configuration Tool +[I] Initial ramdisk image -[T] mdadm is a tool for creating, managing and monitoring -[T] device arrays using the "md" driver in Linux, also -[T] known as Software RAID arrays +[T] This package creates an initial ramdisk image for the first bootup stage. [A] The ROCK Linux Project [M] The ROCK Linux Project diff --git a/package/target-finish/1st-stage/initrd/initrd_bootdisk b/package/target-finish/1st-stage/initrd/initrd_bootdisk new file mode 100644 index 000000000..6aec220dc --- /dev/null +++ b/package/target-finish/1st-stage/initrd/initrd_bootdisk @@ -0,0 +1,39 @@ +/bin/tar /bin/tar +/bin/gzip /bin/gzip +/bin/bash2 /bin/bash2 +/bin/bash3 /bin/bash3 +/bin/bash /bin/bash +/bin/sh /bin/sh +/bin/mount /bin/mount +/bin/umount /bin/umount +/bin/ls /bin/ls +/bin/sed /bin/sed +/bin/cut /bin/cut +/bin/cp /bin/cp +/bin/cat /bin/cat +/bin/uname /bin/uname +/bin/rm /bin/rm +/bin/ln /bin/ln +/bin/mkdir /bin/mkdir +/bin/rmdir /bin/rmdir +/bin/find /bin/find +/bin/gawk /bin/gawk +/bin/awk /bin/awk +/bin/grep /bin/grep +/bin/sleep /bin/sleep +/sbin/ip /sbin/ip +/sbin/hwscan /sbin/hwscan +/sbin/pivot_root /sbin/pivot_root +/sbin/swapon /sbin/swapon +/sbin/swapoff /sbin/swapoff +/sbin/udevd /sbin/udevd +/sbin/udevsettle /sbin/udevsettle +/sbin/udevtrigger /sbin/udevtrigger +/usr/bin/wget /usr/bin/wget +/usr/bin/expand /usr/bin/expand +/usr/bin/readlink /usr/bin/readlink +/usr/bin/basename /usr/bin/basename +/usr/bin/tr /usr/bin/tr +/usr/sbin/lspci /usr/sbin/lspci +/etc/udev /etc/udev +/lib/udev /lib/udev diff --git a/package/target-finish/1st-stage/linuxrc.sh b/package/target-finish/1st-stage/linuxrc.sh new file mode 100644 index 000000000..6535d5503 --- /dev/null +++ b/package/target-finish/1st-stage/linuxrc.sh @@ -0,0 +1,503 @@ +#!/bin/bash + +STAGE_2_BIG_IMAGE="2nd_stage.tar.gz" +STAGE_2_SMALL_IMAGE="2nd_stage_small.tar.gz" +STAGE_2_COMPRESS_ARG="--use-compress-program=gzip" + +#640kB, err, 64 MB should be enought for the tmpfs ;-) +TMPFS_OPTIONS="size=67108864" + +mod_load_info () { # {{{ + read os host version rest < <( uname -a ) + if [ -z "${os}" ] ; then + echo "Can't run \`uname -a\`" + return + elif [ "${os}" != "Linux" ] ; then + echo "Your operating system is not supported ?!" + return + fi + + mod_loader="/sbin/insmod" + mod_dir="/lib/modules/" + + # kernel module suffix for <= 2.4 is .o, .ko if above + if [ ${version:2:1} -gt 4 ] ; then + mod_suffix=".ko" + mod_suffix_len=3 + else + mod_suffix=".o" + mod_suffix_len=2 + fi +} # }}} +doboot() { # {{{ + if ! mkdir /mnt_root/old_root ; then + echo "Can't create /mnt_root/old_root" + exit_linuxrc=0 + fi + + if [ ! -f /mnt_root/sbin/init ] ; then + echo "Can't find /mnt_root/sbin/init!" + exit_linuxrc=0 + 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 + cd / + + 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/sys /sys ; then + echo "Can't remount /old_root/sys as /sys" + 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" + + umount /mnt_root || echo "Can't umount /mnt_root" + rmdir /mnt_root || echo "Can't remove /mnt_root" + fi +} # }}} +trymount() { # {{{ + source=${1} + target=${2} + mount -t iso9600 -o ro ${source} ${target} && return 0 + mount -t ext3 -o ro ${source} ${target} && return 0 + mount -t ext2 -o ro ${source} ${target} && return 0 + mount -t minix -o ro ${source} ${target} && return 0 + mount -t vfat -o ro ${source} ${target} && return 0 + return -1 +} # }}} +httpload() { # {{{ + echo -n "Enter base URL (e.g. http://1.2.3.4/rock): " + + read baseurl + [ -z "${baseurl}" ] && return + + cat < " + read cmd par + if [ "${cmd}" == "cd" ] ; then + cd ${par} + elif [ -f "${cmd}${mod_suffix}" ] ; then + insmod ${PWD%/}/${cmd}${mod_suffix} ${par} + elif [ -z "${cmd}" ] ; then + break + else + echo "No such module: ${cmd}" + fi + done + return +} # }}} +getdevice () { # {{{ + while : ; do + echo -en "\nDevice file to use (q to return) : "; + read device; + [ "${device}" == "q" ] && return -1; + if [ ! -e "${device}" ] ; then + echo -e "\nNot a valid device!" + else + devicefile=${device} + return 0; + fi + done +} # }}} +getcdromdevice () { # {{{ + cdroms="${1}" + floppies="${2}" + autoboot="${3}" + devicelists="/dev/cdroms/* /dev/floppy/*" + + [ "${cdroms}" == "0" -a "${floppies}" == "0" ] && return -1 + + devnr=0 + for dev in ${devicelists} ; do + [ -e "${dev}" ] || continue + [[ ${dev} = /dev/cdroms* ]] && [ "${cdroms}" == "0" ] && continue + [[ ${dev} = /dev/floppy* ]] && [ "${floppies}" == "0" ] && continue + + eval "device_${devnr}='${dev}'" + devnr=$((${devnr}+1)) + done + + [ ${devnr} -eq 0 ] && return -1 + + x=0 + floppy=1 + cdrom=1 + while [ ${x} -lt ${devnr} ] ; do + eval "device=\${device_${x}}" + if [[ ${device} = /dev/cdrom* ]] ; then + echo " ${x}. CD-ROM #${cdrom} (IDE/ATAPI or SCSI)" + cdrom=$((${cdrom}+1)) + fi + if [[ ${device} = /dev/flopp* ]] ; then + echo " ${x}. FDD (Floppy Disk Drive) #${floppy}" + floppy=$((${floppy}+1)) + fi + x=$((${x}+1)) + done + + echo -en "\nEnter number or device file name (default=0): " + + if [ ${autoboot} -eq 1 ] ; then + echo "0" + text=0 + else + read text + fi + + [ -z "${text}" ] && text=0 + + while : ; do + if [ -e "${text}" ] ; then + devicefile="${text}" + return 0 + fi + + eval "text=\"\${device_${text}}\"" + if [ -n "${text}" ] ; then + devicefile="${text}" + return 0 + fi + + echo -n "No such device found. Try again (enter=back): " + read text + [ -z "${text}" ] && return -1 + done + + return 1; +} # }}} +load_ramdisk_file() { # {{{ + devicetype=${1} + autoboot=${2} + mountopts="" + + echo -en "Select a device for loading the 2nd stage system from: \n\n" + + if [ "${devicetype}" == "cdroms" ] ; then + getcdromdevice 1 1 ${autoboot} || return + mountopts="-o ro" + else + getdevice || return + fi + + cat << EOF +Select a stage 2 image file: + + 1. ${STAGE_2_BIG_IMAGE} + 2. ${STAGE_2_SMALL_IMAGE} + +EOF + echo -n "Enter number or image file name (default=1): " + if [ ${autoboot} -eq 1 ] ; then + echo "1" + text=1 + else + read text + fi + + if [ -z "${text}" ] ; then + filename="${STAGE_2_BIG_IMAGE}" + elif [ "${text}" == "1" ] ; then + filename="${STAGE_2_BIG_IMAGE}" + elif [ "${text}" == "2" ] ; then + filename="${STAGE_2_SMALL_IMAGE}" + else + filename="${text}" + fi + + exit_linuxrc=1 + echo "Using ${devicefile}:${filename}." + + if ! mkdir -p /mnt_source ; then + echo "Can't create /mnt_source" + exit_linuxrc=0 + fi + + if ! mount ${mountopts} ${devicefile} "/mnt_source" ; then + echo "Can't mount /mnt_source" + exit_linuxrc=0 + fi + + if ! mkdir -p /mnt_root ; then + echo "Can't create /mnt_root" + exit_linuxrc=0 + fi + + if ! mount -t tmpfs -o ${TMPFS_OPTIONS} tmpfs /mnt_root ; then + echo "Can't mount tmpfs on /mnt_root" + exit_linuxrc=0 + fi + + echo "Extracting 2nd stage filesystem to ram ..." + if ! tar ${STAGE_2_COMPRESS_ARG} -C /mnt_root -xf /mnt_source/${filename} ; then + echo "Can't extract /mnt/source/${filename}" + exit_linuxrc=0 + return 1 + fi + + if ! umount "/mnt_source" ; then + echo "Can't umount /mnt_source" + exit_linuxrc=0 + fi + + if ! rmdir "/mnt_source" ; then + echo "Can't remove /mnt_source" + exit_linuxrc=0 + fi + + export ROCK_INSTALL_SOURCE_DEV=${devicefile} + export ROCK_INSTALL_SOURCE_FILE=${filename} + doboot +} # }}} +activate_swap() { # {{{ + echo + echo -n "Enter file name of swap device: " + + read text + if [ -n "${text}" ] ; then + swapon ${text} + fi +} # }}} +config_net() { # {{{ + ip addr + echo + ip route + echo + + echo -n "Enter interface name (eth0): " + read dv + [ -z "${dv}" ] && dv="eth0" + + echo -n "Enter ip (192.168.0.254/24): " + read ip + [ -z "${ip}" ] && ip="192.168.0.254/24" + + ip addr add ${ip} dev ${dv} + ip link set ${dv} up + + echo -n "Enter default gateway (none): " + read gw + [ -n "${gw}" ] && ip route add default via ${gw} + + ip addr + echo + ip route + echo +} # }}} +exec_sh() { # {{{ + echo "Quit the shell to return to the stage 1 loader!" + /bin/sh +} # }}} +checkisomd5() { # {{{ + echo "Select a device for checking: " + + getcdromdevice 1 0 0 || return + echo "Running check..." + + /bin/checkisomd5 ${devicefile} + code=${?} + if [ ${code} -eq 1 ] ; then + echo "MD5Sum is correct." + elif [ ${code} -eq 0 ] ; then + echo "MD5Sum is NOT correct! Please contact the authors!" + fi + + echo "Press Return key to continue." + read +} # }}} + +emit_udev_events() { # {{{ + /sbin/udevtrigger + /sbin/udevsettle +} # }}} + +input=1 +exit_linuxrc=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 (for mount log)" +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 sysfs sysfs /sys || echo "Can't mount sysfs on /sys!" +mount -t tmpfs tmpfs /dev || echo "Can't mount a tmpfs on /dev!" + +cp -r /lib/udev/devices/* /dev + +echo "" > /proc/sys/kernel/hotplug +/sbin/udevd --daemon + +# 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 + +ip addr add 127.0.0.1 dev lo +ip link set lo up + +if [ ${autoboot} -eq 1 ] ; then + load_ramdisk_file cdroms 1 +fi +autoboot=0 +cat << EOF + ============================================ + === ROCK Linux 1st stage boot system === + ============================================ + +The ROCK Linux install / rescue system boots up in two stages. You +are now in the first of this two stages and if everything goes right +you will not spend much time here. Just load your SCSI and networking +drivers (if needed) and configure the installation source so the +2nd stage boot system can be loaded and you can start the installation. +EOF +while [ ${exit_linuxrc} -eq 0 ] ; do + cat < tmp/ncurses.tar.bz2 + x=tmp/ncurses.tar.bz2 +fi +tar $taropt $x \ usr/share/terminfo/x/xterm usr/share/terminfo/a/ansi \ usr/share/terminfo/n/nxterm usr/share/terminfo/l/linux \ usr/share/terminfo/v/vt200 usr/share/terminfo/v/vt220 \ usr/share/terminfo/v/vt100 usr/share/terminfo/s/screen # -if [ -f ../../pkgs/kbd.tar.bz2 ] ; then +if pkginstalled kbd ; then echo "Installing some keymaps ..." - tar $taropt ../../pkgs/kbd.tar.bz2 \ + pkg_ver="$( grep " kbd " $base/config/$config/packages | cut -f6 -d" " )" + pkg_extraver="$( grep " kbd " $base/config/$config/packages | cut -f7 -d" " )" + eval x=$build_rock/pkgs/kbd$pkg_suffix + if [[ "$pkg_suffix" == *gem ]] ; then + mine -k pkg_tarbz2 $x > tmp/kbd.tar.bz2 + x=tmp/kbd.tar.bz2 + fi + tar $taropt $x \ usr/share/kbd/keymaps/amiga usr/share/kbd/keymaps/i386/qwerty \ usr/share/kbd/keymaps/atari usr/share/kbd/keymaps/i386/qwertz \ usr/share/kbd/keymaps/sun @@ -115,15 +173,23 @@ if [ -f ../../pkgs/kbd.tar.bz2 ] ; then xargs rm -f fi # -if [ -f ../../pkgs/pciutils.tar.bz2 ] ; then +if pkginstalled pciutils ; then + pkg_ver="$( grep " pciutils " $base/config/$config/packages | cut -f6 -d" " )" + pkg_extraver="$( grep " pciutils " $base/config/$config/packages | cut -f7 -d" " )" + eval x=$build_rock/pkgs/pciutils$pkg_suffix + if [[ "$pkg_suffix" == *gem ]] ; then + mine -k pkg_tarbz2 $x > tmp/pciutils.tar.bz2 + x=tmp/pciutils.tar.bz2 + fi echo "Installing pci.ids ..." - tar $taropt ../../pkgs/pciutils.tar.bz2 \ - usr/share/pci.ids + tar $taropt $x usr/share/pci.ids fi +# Remove temporary .tar.bz2 packages, if any. +rm -f tmp/*.tar.bz2 # echo "Creating 2nd stage linuxrc." -cp -v $base/target/$target/linuxrc2.sh sbin/init ; chmod -v +x sbin/init -cp -v $base/target/$target/shutdown sbin/shutdown ; chmod -v +x sbin/shutdown +cp -v $confdir/linuxrc2.sh sbin/init ; chmod -v +x sbin/init +cp -v $confdir/shutdown sbin/shutdown ; chmod -v +x sbin/shutdown echo '$STONE install' > etc/stone.d/default.sh # echo "Creating 2nd_stage.tar.gz archive." @@ -149,7 +215,7 @@ for x in $progs ; do if [ "$fn" ] ; then cp -v ../2nd_stage/$fn $fn else - echo "\`- Program not found: $x" + echo "- Program not found: $x" fi done @@ -166,7 +232,7 @@ do if [ ! -f lib/$y ] && grep -q $y bin/* lib/* 2> /dev/null then - echo "\`- Found $y." + echo "- Found $y." cp -v $x/$y lib/$y ; found=1 fi done @@ -187,7 +253,7 @@ echo "Creating links for identical files." while read ck fn do if [ "$oldck" = "$ck" ] ; then - echo "\`- Found $fn -> $oldfn." + echo "- Found $fn -> $oldfn." rm -v $fn ; ln -v $oldfn $fn else oldck=$ck ; oldfn=$fn diff --git a/package/target-finish/2nd-stage/2nd-stage.desc b/package/target-finish/2nd-stage/2nd-stage.desc index 0c4a07980..296c74489 100644 --- a/package/target-finish/2nd-stage/2nd-stage.desc +++ b/package/target-finish/2nd-stage/2nd-stage.desc @@ -21,11 +21,10 @@ [COPY] [COPY] --- ROCK-COPYRIGHT-NOTE-END --- -[I] Raid Configuration Tool +[I] Second stage boot archive -[T] mdadm is a tool for creating, managing and monitoring -[T] device arrays using the "md" driver in Linux, also -[T] known as Software RAID arrays +[T] This package creates two archives containing a small and a somewhat +[T] larger minimal Linux system, respectively. [A] The ROCK Linux Project [M] The ROCK Linux Project @@ -35,5 +34,5 @@ [L] GPL [S] Stable [V] 1 -[P] O --------8- 195.200 +[P] O --------8- 194.200 diff --git a/package/target-finish/2nd-stage/linuxrc2.sh b/package/target-finish/2nd-stage/linuxrc2.sh new file mode 100644 index 000000000..fdfe83c2c --- /dev/null +++ b/package/target-finish/2nd-stage/linuxrc2.sh @@ -0,0 +1,90 @@ +#!/bin/sh + +export PATH="/sbin:/bin:/usr/sbin:/usr/bin" +if type -p gzip > /dev/null ; then + umount -d /old_root ; rmdir /old_root +else + PATH="$PATH:/old_root/bin" + for x in /old_root/* ; do + rmdir $x 2> /dev/null || rm -f $x 2> /dev/null + done +fi +grep -v "^rootfs " /proc/mounts > /etc/mtab +freeramdisk /dev/rd/* 2> /dev/null + +mkdir -p /lib/modules/$( uname -r ) +echo -n >> /lib/modules/$( uname -r )/modules.dep + +setterm -blank 0 -powersave off -powerdown 0 + +echo +echo ' ******************************************************************' +echo ' * Welcome to the ROCK Linux 2nd stage boot disk. *' +echo ' ******************************************************************' +echo +echo "This is a small linux distribution, loaded into your computer's memory." +echo "It has everything needed to install ROCK Linux, restore an old installation" +echo "or perform some administrative tasks." + +for x in /etc/setup-*.sh /setup/setup.sh ; do + if [ -f "$x" ] ; then + echo ; echo "Running $x ..." ; sh $x + echo "Setup script $x finished." + fi +done + +echo +ttydevs="" + +if [ -z "$autoboot" ]; then + echo "Enter the names of all terminal devices (e.g. 'vc/1' or 'tts/0')." + echo -n "An empty text stands for vc/1 - vc/6: "; read ttydevs +fi + +if [ -z "$ttydevs" ]; then + ttydevs="vc/1 vc/2 vc/3 vc/4 vc/5 vc/6" +fi + +if [[ "$ttydevs" = *tts/* ]] ; then + echo -n "Connection speed in Baud (default: 9600): " ; read baud + [ -z "$baud" ] && baud=9600 +else + baud=38400 +fi + +echo +echo 'Just type "stone" now if you want to make a normal installation of a ROCK' +echo -n 'Linux build ' +if type -p dialog > /dev/null ; then + echo '(or type "stone -text" if you prefer non-dialog based menus).' +else + echo '(only the text interface is available).' +fi + +if [ -z "$autoboot" ]; then + echo -e '#!/bin/sh\ncd ; exec /bin/sh --login' > /sbin/login-shell +else + cat <<- EOT > /sbin/login-shell + #!/bin/bash + cd + case "\$( tty )" in + /dev/vc/1) + echo "Running 'stone' now.." + /bin/sh --login -c "stone" + echo -e '#!/bin/sh\\ncd ; exec /bin/sh --login' > /sbin/login-shell + exit 0 + ;; + *) + exec /bin/sh --login + esac + EOT +fi +chmod +x /sbin/login-shell + +for x in $ttydevs ; do + ( ( while : ; do agetty -i $baud $x -n -l /sbin/login-shell ; done ) & ) +done + +exec < /dev/null > /dev/null 2>&1 +while : ; do sleep 1 ; done + diff --git a/package/target-finish/2nd-stage/shutdown b/package/target-finish/2nd-stage/shutdown new file mode 100644 index 000000000..ae045ae38 --- /dev/null +++ b/package/target-finish/2nd-stage/shutdown @@ -0,0 +1,21 @@ +#!/bin/sh + +echo "Sending all processes a SIGTERM (15)." +killall5 -15 || error=$? ; sleep 5 + +echo "Sending all processes a 2nd SIGTERM (15)." +killall5 -15 || error=$? ; sleep 5 + +echo "Sending all processes a SIGKILL (9)." +killall5 -9 || error=$? ; sleep 5 + +echo "Turning off swap devices." +swapoff -a || error=$? +sync ; sleep 1 + +echo "Unmounting filesystems." +umount -advf || error=$? + +echo "Reboot ..." +reboot -f + diff --git a/package/target-finish/bootloader/bootloader.conf b/package/target-finish/bootloader/bootloader.conf new file mode 100644 index 000000000..16d5e234a --- /dev/null +++ b/package/target-finish/bootloader/bootloader.conf @@ -0,0 +1,30 @@ + +mainfunction="bootloader_mainfunction" + +bootloader_mainfunction () +{ + +if [ "$ROCK_BUILD_TARGET" != 1 ] ; then + echo "$xpkg can only be built with ./scripts/Build-Target!" + false +fi + +build_rock="$xroot/ROCK" +disksdir="$build_rock/$target" + +if [ -f $confdir/$arch/build.sh ]; then + . $confdir/$arch/build.sh +fi + +echo "Creating ISO filesystem description." +cd $disksdir; rm -rf isofs; mkdir -p isofs + +echo "Creating isofs directory.." +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 + +echo "Creating isofs.txt file .." +echo "DISK1 build/${ROCKCFG_ID}/ROCK/$target/isofs/ ` + `${ROCKCFG_SHORTID}/" > $build_rock/isofs_bootdisk.txt + +} diff --git a/package/target-finish/bootloader/bootloader.desc b/package/target-finish/bootloader/bootloader.desc new file mode 100644 index 000000000..060801e44 --- /dev/null +++ b/package/target-finish/bootloader/bootloader.desc @@ -0,0 +1,37 @@ + +[COPY] --- ROCK-COPYRIGHT-NOTE-BEGIN --- +[COPY] +[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. +[COPY] Please add additional copyright information _after_ the line containing +[COPY] the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +[COPY] the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +[COPY] +[COPY] ROCK Linux: rock-src/package/base/mdadm/mdadm.desc +[COPY] ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf +[COPY] +[COPY] This program is free software; you can redistribute it and/or modify +[COPY] it under the terms of the GNU General Public License as published by +[COPY] the Free Software Foundation; either version 2 of the License, or +[COPY] (at your option) any later version. A copy of the GNU General Public +[COPY] License can be found at Documentation/COPYING. +[COPY] +[COPY] Many people helped and are helping developing ROCK Linux. Please +[COPY] have a look at http://www.rocklinux.org/ and the Documentation/TEAM +[COPY] file for details. +[COPY] +[COPY] --- ROCK-COPYRIGHT-NOTE-END --- + +[I] Boot-loaders for target builds + +[T] This package adds CD and floppy boot-loaders to a target. + +[A] The ROCK Linux Project +[M] The ROCK Linux Project + +[C] extra/base + +[L] GPL +[S] Stable +[V] 1 +[P] O --------8- 196.200 + diff --git a/package/target-finish/bootloader/powerpc/boot.msg b/package/target-finish/bootloader/powerpc/boot.msg new file mode 100644 index 000000000..c2f4be78f --- /dev/null +++ b/package/target-finish/bootloader/powerpc/boot.msg @@ -0,0 +1,16 @@ + ____ ___ ___ _ __ _ + | _ \ / _ \ / __| |/ / | | _ _ __ _ _ _ _ + | . _/| | | | | | '_/ | | |_| '_ \| | | | \/ | + | |\ \| |_| | |__| . \ | |__| | | | | `_' |> < + |_| \_\ ___/ \___|_|\_\ |____|_|_| |_|\___/|_/\_| + [============> http://www.rocklinux.org/ <============] + +So you are going to install ROCK Linux ... + +Possible choices are: + install ........... normal CD boot + install-novideo .., normal CD boot without accelerated framebuffer + hd-install ........ boot from hard-disc image + hd-install-novide . boot from hard-disc image without accelerated framebuffer + +. diff --git a/package/target-finish/bootloader/powerpc/build.sh b/package/target-finish/bootloader/powerpc/build.sh new file mode 100644 index 000000000..241ac23fd --- /dev/null +++ b/package/target-finish/bootloader/powerpc/build.sh @@ -0,0 +1,50 @@ + +use_yaboot=1 + +cd $disksdir + +echo "Creating cleaning boot directory:" +rm -rfv boot/*-rock boot/System.map boot/kconfig* + +if [ $use_yaboot -eq 1 ] +then + echo "Creating yaboot setup:" + # + echo "Extracting yaboot boot loader images." + mkdir -p boot etc + tar -O $taropt $base/build/${ROCKCFG_ID}/ROCK/pkgs/yaboot.tar.bz2 \ + usr/lib/yaboot/yaboot > boot/yaboot + tar -O $taropt $base/build/${ROCKCFG_ID}/ROCK/pkgs/yaboot.tar.bz2 \ + usr/lib/yaboot/yaboot.rs6k > boot/yaboot.rs6k + cp boot/yaboot.rs6k install.bin + # + echo "Creating yaboot config files." + cp -v $confdir/powerpc/{boot.msg,ofboot.b} \ + boot + ( + echo "device=cdrom:" + cat $confdir/powerpc/yaboot.conf + ) > etc/yaboot.conf + ( + echo "device=cd:" + cat $confdir/powerpc/yaboot.conf + ) > boot/yaboot.conf + # + echo "Moving image (initrd) to boot directory." + mv -v initrd.gz boot/ + # + echo "Copy more config files." + cp -v $confdir/powerpc/mapping . + # + datadir="build/${ROCKCFG_ID}/ROCK/$target" + cat > $xroot/ROCK/isofs_arch.txt <<- EOT + BOOT -hfs -part -map $datadir/mapping -hfs-volid "ROCK_Linux_CD" + BOOTx -hfs-bless boot -sysid PPC -l -L -r -T -chrp-boot + BOOTx --prep-boot install.bin + DISK1 $datadir/boot/ boot/ + DISK1 $datadir/etc/ etc/ + DISK1 $datadir/install.bin install.bin + EOT +# SCRIPT sh $confdir/powerpc/bless-rs6k.sh $disksdir +fi + diff --git a/package/target-finish/bootloader/powerpc/mapping b/package/target-finish/bootloader/powerpc/mapping new file mode 100644 index 000000000..34c898f43 --- /dev/null +++ b/package/target-finish/bootloader/powerpc/mapping @@ -0,0 +1,10 @@ +# Example filename mapping file +# +# EXTN XLate CREATOR TYPE Comment +.b Raw 'UNIX' 'tbxi' "bootstrap" +yaboot Raw 'UNIX' 'boot' "bootstrap" +*linux Raw 'UNIX' 'boot' "kernel" +*.conf Raw 'UNIX' 'conf' "bootstrap" +root.bin Raw 'UNIX' 'root' "root_image" +* Raw '????' '????' "Unknown" + diff --git a/package/target-finish/bootloader/powerpc/ofboot.b b/package/target-finish/bootloader/powerpc/ofboot.b new file mode 100644 index 000000000..3b6187718 --- /dev/null +++ b/package/target-finish/bootloader/powerpc/ofboot.b @@ -0,0 +1,64 @@ + + +MacRISC MacRISC3 + + +GNU/Linux PPC bootloader + + +" screen" output +load-base release-load-area +boot cd:,\\yaboot + + +1010 +000000000000F8FEACF6000000000000 +0000000000F5FFFFFEFEF50000000000 +00000000002BFAFEFAFCF70000000000 +0000000000F65D5857812B0000000000 +0000000000F5350B2F88560000000000 +0000000000F6335708F8FE0000000000 +00000000005600F600F5FD8100000000 +00000000F9F8000000F5FAFFF8000000 +000000008100F5F50000F6FEFE000000 +000000F8F700F500F50000FCFFF70000 +00000088F70000F50000F5FCFF2B0000 +0000002F582A00F5000008ADE02C0000 +00090B0A35A62B0000002D3B350A0000 +000A0A0B0B3BF60000505E0B0A0B0A00 +002E350B0B2F87FAFCF45F0B2E090000 +00000007335FF82BF72B575907000000 +000000000000ACFFFF81000000000000 +000000000081FFFFFFFF810000000000 +0000000000FBFFFFFFFFAC0000000000 +000000000081DFDFDFFFFB0000000000 +000000000081DD5F83FFFD0000000000 +000000000081DDDF5EACFF0000000000 +0000000000FDF981F981FFFF00000000 +00000000FFACF9F9F981FFFFAC000000 +00000000FFF98181F9F981FFFF000000 +000000ACACF981F981F9F9FFFFAC0000 +000000FFACF9F981F9F981FFFFFB0000 +00000083DFFBF981F9F95EFFFFFC0000 +005F5F5FDDFFFBF9F9F983DDDD5F0000 +005F5F5F5FDD81F9F9E7DF5F5F5F5F00 +0083DD5F5F83FFFFFFFFDF5F835F0000 +000000FBDDDFACFBACFBDFDFFB000000 +000000000000FFFFFFFF000000000000 +0000000000FFFFFFFFFFFF0000000000 +0000000000FFFFFFFFFFFF0000000000 +0000000000FFFFFFFFFFFF0000000000 +0000000000FFFFFFFFFFFF0000000000 +0000000000FFFFFFFFFFFF0000000000 +0000000000FFFFFFFFFFFFFF00000000 +00000000FFFFFFFFFFFFFFFFFF000000 +00000000FFFFFFFFFFFFFFFFFF000000 +000000FFFFFFFFFFFFFFFFFFFFFF0000 +000000FFFFFFFFFFFFFFFFFFFFFF0000 +000000FFFFFFFFFFFFFFFFFFFFFF0000 +00FFFFFFFFFFFFFFFFFFFFFFFFFF0000 +00FFFFFFFFFFFFFFFFFFFFFFFFFFFF00 +00FFFFFFFFFFFFFFFFFFFFFFFFFF0000 +000000FFFFFFFFFFFFFFFFFFFF000000 + + diff --git a/package/target-finish/bootloader/powerpc/yaboot.conf b/package/target-finish/bootloader/powerpc/yaboot.conf new file mode 100644 index 000000000..0dd216fdc --- /dev/null +++ b/package/target-finish/bootloader/powerpc/yaboot.conf @@ -0,0 +1,24 @@ +message=/boot/boot.msg + +timeout = 120 +default = auto + +## CD-ROM Installs ## +image=/boot/vmlinux + label=auto + initrd=/boot/initrd.gz + initrd-size=12288 + append="root=/dev/ram0 devfs=nocompat autoboot=1 rw" + +image=/boot/vmlinux + label=install + initrd=/boot/initrd.gz + initrd-size=12288 + append="root=/dev/ram0 devfs=nocompat rw" + +image=/boot/vmlinux + label=install-novideo + initrd=/boot/initrd.gz + initrd-size=12288 + append="root=/dev/ram0 devfs=nocompat rw video=ofonly" + diff --git a/package/target-finish/bootloader/sparc/boot.msg b/package/target-finish/bootloader/sparc/boot.msg new file mode 100644 index 000000000..212151584 --- /dev/null +++ b/package/target-finish/bootloader/sparc/boot.msg @@ -0,0 +1,20 @@ + ____ ___ ___ _ __ _ + | _ \ / _ \ / __| |/ / | | _ _ __ _ _ _ _ + | . _/| | | | | | '_/ | | |_| '_ \| | | | \/ | + | |\ \| |_| | |__| . \ | |__| | | | | `_' |> < + |_| \_\ ___/ \___|_|\_\ |____|_|_| |_|\___/|_/\_| + [============> http://www.rocklinux.org/ <============] + +Help Screens: +------------- + + <1> Installation overview + <0> This help-text + +Actions: +-------- + + Start installation + install options Start install with the given kernel options + help Show SILO's help + diff --git a/package/target-finish/bootloader/sparc/build.sh b/package/target-finish/bootloader/sparc/build.sh new file mode 100644 index 000000000..4e29346d3 --- /dev/null +++ b/package/target-finish/bootloader/sparc/build.sh @@ -0,0 +1,27 @@ + +cd $disksdir + +echo "Cleaning boot directory:" +rm -rfv boot/*-rock boot/System.map boot/kconfig* boot/initrd*img boot/*.b + +echo "Creating silo setup:" +# +echo "Extracting silo boot loader images." +mkdir -p boot +tar $taropt $base/build/${ROCKCFG_ID}/ROCK/pkgs/silo.tar.bz2 \ + boot/second.b -O > boot/second.b +# +echo "Creating silo config file." +cp -v $confdir/sparc/{silo.conf,boot.msg,help1.txt} \ + boot +# +echo "Moving image (initrd) to boot directory." +mv -v initrd.gz boot/ +# +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/ +EOT + diff --git a/package/target-finish/bootloader/sparc/help1.txt b/package/target-finish/bootloader/sparc/help1.txt new file mode 100644 index 000000000..6ba3e8e9c --- /dev/null +++ b/package/target-finish/bootloader/sparc/help1.txt @@ -0,0 +1,22 @@ +Installation Overview: + +The ROCK Linux install / rescue system boots up in two stages. In the first +stage only a small binary is running which is used to load the complete +install / rescue system into the memory. So in the first stage you can load +network and scsi kernel modules, configure network devices (for netwok +installation) or load the system from a floppy or CD-ROM device. + +For a normal installation from the first CD-ROM you only need to press enter +for each question to do use default options. + +You can freely choose which terminal devices (e.g. 'vc/1' or 'tts/0'). +If you just hit , you'll use vc/1 to vc/6. + +To start the installation just exectute our Setup Tool ONE via 'stone' or +'stone -text', if you prefer non-dialog based menus. + + +In STONE you can create your partitions and filesystems and after selecting +the Package Manager choose wich packages to install. + +At the end reboot your machine with 'reboot -f'. diff --git a/package/target-finish/bootloader/sparc/silo.conf b/package/target-finish/bootloader/sparc/silo.conf new file mode 100644 index 000000000..872bb857e --- /dev/null +++ b/package/target-finish/bootloader/sparc/silo.conf @@ -0,0 +1,22 @@ +partition=1 +timeout=600 +message=/boot/boot.msg +default=install +root=/dev/ram0 +initrd=/boot/initrd.gz +read-write +append="devfs=nocompat" + +image="cat /boot/boot.msg" + label=0 + single-key +image="cat /boot/help1.txt" + label=1 + single-key + +image[sun4u]=/boot/vmlinux64.gz + label=install + alias=linux +image[sun4c,sun4d,sun4m]=/boot/vmlinux32.gz + label=install + alias=linux diff --git a/package/target-finish/bootloader/x86/build.sh b/package/target-finish/bootloader/x86/build.sh new file mode 100644 index 000000000..d60c47f66 --- /dev/null +++ b/package/target-finish/bootloader/x86/build.sh @@ -0,0 +1,62 @@ + +use_isolinux=1 +syslinux_ver="`sed -n 's,.*syslinux-\(.*\).tar.*,\1,p' \ + $base/target/bootdisk/download.txt`" +use_mdlbl=1 +mdlbl_ver="`sed -n 's,.*mdlbl-\(.*\).tar.*,\1,p' \ + $base/target/bootdisk/download.txt`" + +cd $disksdir + +echo "Creating lilo config and cleaning boot directory:" +cp $confdir/x86/lilo-* boot/ +rm -rfv boot/*-rock boot/grub boot/System.map boot/kconfig boot/*.24** + +echo "Creating floppy disk images:" +cp $confdir/x86/makeimages.sh . +chmod +x makeimages.sh + +if [ $use_mdlbl -eq 1 ] +then + tar $taropt $base/download/mirror/m/mdlbl-$mdlbl_ver.tar.bz2 + cd mdlbl-$mdlbl_ver + cp ../boot/vmlinuz .; cp ../initrd.gz initrd; ./makedisks.sh + for x in disk*.img; do mv $x ../floppy${x#disk}; done; cd .. + du -sh floppy*.img | while read x; do echo $x; done +else + tmpfile=`mktemp -p $PWD` + if sh ./makeimages.sh &> $tmpfile; then + cat $tmpfile | while read x; do echo "$x"; done + else + cat $tmpfile | while read x; do echo "$x"; done + fi + rm -f $tmpfile + cat > $xroot/ROCK/isofs_arch.txt <<- EOT + BOOT -b ${ROCKCFG_SHORTID}/boot_288.img -c ${ROCKCFG_SHORTID}/boot.catalog + EOT +fi + +if [ $use_isolinux -eq 1 ] +then + echo "Creating isolinux setup:" + # + echo "Extracting isolinux boot loader." + mkdir -p isolinux + tar -O $taropt $base/download/mirror/s/syslinux-$syslinux_ver.tar.bz2 \ + syslinux-$syslinux_ver/isolinux.bin > isolinux/isolinux.bin + # + echo "Creating isolinux config file." + cp $confdir/x86/isolinux.cfg isolinux/ + cp $confdir/x86/help?.txt isolinux/ + # + echo "Copy images to isolinux directory." + [ -e boot/memtest86.bin ] && cp boot/memtest86.bin isolinux/memtest86 || true + cp initrd.gz boot/vmlinuz isolinux/ + # + cat > $xroot/ROCK/isofs_arch.txt <<- EOT + BOOT -b isolinux/isolinux.bin -c isolinux/boot.catalog + BOOTx -no-emul-boot -boot-load-size 4 -boot-info-table + DISK1 build/${ROCKCFG_ID}/ROCK/$target/isolinux/ isolinux/ + EOT +fi + diff --git a/package/target-finish/bootloader/x86/help0.txt b/package/target-finish/bootloader/x86/help0.txt new file mode 100644 index 000000000..14524a0e5 --- /dev/null +++ b/package/target-finish/bootloader/x86/help0.txt @@ -0,0 +1,22 @@ + ____ ___ ___ _ __ _ + | _ \ / _ \ / __| |/ / | | _ _ __ _ _ _ _ + | . _/| | | | | | '_/ | | |_| '_ \| | | | \/ | + | |\ \| |_| | |__| . \ | |__| | | | | `_' |> < + |_| \_\ ___/ \___|_|\_\ |____|_|_| |_|\___/|_/\_| + [============> http://www.rocklinux.org/ <============] + +Help Screens: +------------- + + <1> Installation overview + <2> Installing on systems with less than 64 MB RAM + <0> This help-text + +Actions: +-------- + + Start installation system + ROCK [options] The same with interactive stage 1 (for experts) + linux [options] Boot a plain linux kernel (for rescue purposes) + memtest86 Boot the memtest86 mini-os + diff --git a/package/target-finish/bootloader/x86/help1.txt b/package/target-finish/bootloader/x86/help1.txt new file mode 100644 index 000000000..6ba3e8e9c --- /dev/null +++ b/package/target-finish/bootloader/x86/help1.txt @@ -0,0 +1,22 @@ +Installation Overview: + +The ROCK Linux install / rescue system boots up in two stages. In the first +stage only a small binary is running which is used to load the complete +install / rescue system into the memory. So in the first stage you can load +network and scsi kernel modules, configure network devices (for netwok +installation) or load the system from a floppy or CD-ROM device. + +For a normal installation from the first CD-ROM you only need to press enter +for each question to do use default options. + +You can freely choose which terminal devices (e.g. 'vc/1' or 'tts/0'). +If you just hit , you'll use vc/1 to vc/6. + +To start the installation just exectute our Setup Tool ONE via 'stone' or +'stone -text', if you prefer non-dialog based menus. + + +In STONE you can create your partitions and filesystems and after selecting +the Package Manager choose wich packages to install. + +At the end reboot your machine with 'reboot -f'. diff --git a/package/target-finish/bootloader/x86/help2.txt b/package/target-finish/bootloader/x86/help2.txt new file mode 100644 index 000000000..0334b76ed --- /dev/null +++ b/package/target-finish/bootloader/x86/help2.txt @@ -0,0 +1,13 @@ +Installation on systems with less than 64MB of RAM: + +To load the ramdisk for the 2nd stage installation you nead arround +20MB of RAM. It can also be loaded on small sized memory systems when +a swap partition is available. If you already have partitionized the +disk you can activate it in the first stage program using the option +"Activate already formatted swap device". + +If you need to partitionize your disk you can load a very small ram- +disk ("2nd_stage_small") to perform initial configuration such as +partitionizing the disk, and then reboot to choose the normal 2nd_ +stage file for installation. + diff --git a/package/target-finish/bootloader/x86/isolinux.cfg b/package/target-finish/bootloader/x86/isolinux.cfg new file mode 100644 index 000000000..2ad97ae89 --- /dev/null +++ b/package/target-finish/bootloader/x86/isolinux.cfg @@ -0,0 +1,36 @@ + +DEFAULT auto +TIMEOUT 600 +PROMPT 1 + +DISPLAY help0.txt + +F1 help1.txt +F2 help2.txt +F3 help3.txt +F4 help4.txt +F5 help5.txt +F6 help6.txt +F7 help7.txt +F8 help8.txt +F9 help9.txt +F0 help0.txt + +LABEL auto + kernel vmlinuz + APPEND initrd=initrd.gz root=/dev/ram0 devfs=nocompat autoboot=1 rw + +LABEL ROCK + kernel vmlinuz + APPEND initrd=initrd.gz root=/dev/ram0 devfs=nocompat rw + +LABEL ramdisk + kernel vmlinuz + APPEND initrd=initrd.gz root=/dev/ram0 devfs=nocompat rw + +LABEL linux + kernel vmlinuz + +LABEL memtest86 + kernel memtest86 + diff --git a/package/target-finish/bootloader/x86/lilo-conf-144 b/package/target-finish/bootloader/x86/lilo-conf-144 new file mode 100644 index 000000000..854d24985 --- /dev/null +++ b/package/target-finish/bootloader/x86/lilo-conf-144 @@ -0,0 +1,30 @@ +disk=/dev/floppy/0 + bios = 0x00 + sectors = 18 + heads = 2 + cylinders = 80 + +nowarn +boot=/dev/floppy/0 +install=/mnt/boot.b +map=/mnt/map +vga=normal +message=/mnt/lilo-help.txt +geometric +compact +prompt + +image=/mnt/vmlinuz + read-write + append="root=/dev/fd devfs=nocompat \ + load_ramdisk=1 prompt_ramdisk=1 \ + ramdisk_size=12288" + label=ramdisk + +image=/mnt/vmlinuz + label=linux + +image=/mnt/memtest.bin + label=memtest + optional + diff --git a/package/target-finish/bootloader/x86/lilo-conf-1x2 b/package/target-finish/bootloader/x86/lilo-conf-1x2 new file mode 100644 index 000000000..790ce0a81 --- /dev/null +++ b/package/target-finish/bootloader/x86/lilo-conf-1x2 @@ -0,0 +1,29 @@ +disk=/dev/floppy/0 + bios = 0x00 + sectors = 18 + heads = 2 + cylinders = 80 + +nowarn +boot=/dev/floppy/0 +install=/mnt/boot.b +map=/mnt/map +vga=normal +message=/mnt/lilo-help.txt +geometric +compact +prompt + +image=/mnt/vmlinuz + read-write + append="root=/dev/ram0 devfs=nocompat" + initrd=/mnt/initrd.gz + label=ramdisk + +image=/mnt/vmlinuz + label=linux + +image=/mnt/memtest.bin + label=memtest + optional + diff --git a/package/target-finish/bootloader/x86/lilo-conf-288 b/package/target-finish/bootloader/x86/lilo-conf-288 new file mode 100644 index 000000000..3647df41d --- /dev/null +++ b/package/target-finish/bootloader/x86/lilo-conf-288 @@ -0,0 +1,29 @@ +disk=/dev/floppy/0 + bios = 0x00 + sectors = 36 + heads = 2 + cylinders = 80 + +nowarn +boot=/dev/floppy/0 +install=/mnt/boot.b +map=/mnt/map +vga=normal +message=/mnt/lilo-help.txt +geometric +compact +prompt + +image=/mnt/vmlinuz + read-write + append="root=/dev/ram0 devfs=nocompat" + initrd=/mnt/initrd.gz + label=ramdisk + +image=/mnt/vmlinuz + label=linux + +image=/mnt/memtest.bin + label=memtest + optional + diff --git a/package/target-finish/bootloader/x86/lilo-help.txt b/package/target-finish/bootloader/x86/lilo-help.txt new file mode 100644 index 000000000..79750d5eb --- /dev/null +++ b/package/target-finish/bootloader/x86/lilo-help.txt @@ -0,0 +1,4 @@ + +This is the ROCK Linux Install system. If you don't know what to do now just +press enter and start reading the documentation. + diff --git a/package/target-finish/bootloader/x86/makeimages.sh b/package/target-finish/bootloader/x86/makeimages.sh new file mode 100644 index 000000000..f66ad1b9f --- /dev/null +++ b/package/target-finish/bootloader/x86/makeimages.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +if [ "$1" = -reroot ] ; then + echo "Old PATH: $PATH" + PATH="../../sbin:../../bin:../../../sbin:../usr/bin:$PATH" + echo "New PATH: $PATH" + echo "Old LD_LIBRARY_PATH: $LD_LIBRARY_PATH" + export LD_LIBRARY_PATH="../../lib:../../usr/lib:$LD_LIBRARY_PATH" + LD_LIBRARY_PATH=${LD_LIBRARY_PATH%:} + echo "New LD_LIBRARY_PATH: $LD_LIBRARY_PATH" + shift +fi + +if [ "$1" = -combo ] ; then + combo=1 +elif [ "$#" != 0 ] ; then + echo "usage: $0 [-reroot] [-combo]" + exit 1 +fi + +tmpfile=`mktemp -p $PWD` +tmpdir=$tmpfile.dir +mkdir $tmpdir || exit 1 +rc=0 + +tmpdev="" +for x in /dev/loop/* ; do + if losetup $x $tmpfile 2> /dev/null ; then + tmpdev=$x ; break + fi +done +if [ -z "$tmpdev" ] ; then + echo "No free loopback device found!" + rm -f $tmpfile ; rmdir $tmpdir + exit 1 +fi +echo "Using $tmpdev." + +for image in initrd boot_144 boot_288 +do + case ${image} in + initrd) + echo "Creating ${image}.gz ..." + size=4096 ;; + boot_144) + echo "Creating ${image}.img ..." + size=1440 ;; + boot_288) + echo "Creating ${image}.img ..." + size=2880 ;; + esac + + dd if=/dev/zero of=$tmpfile bs=1024 count=$size &> /dev/null + losetup -d $tmpdev ; losetup $tmpdev $tmpfile || rc=1 + mke2fs -q $tmpdev &> /dev/null ; mount $tmpdev $tmpdir || rc=1 + + case ${image} in + initrd) + cp -a initrd/* $tmpdir || rc=1 + ;; + + boot_144|boot_288) + cp -a boot/{vmlinuz,lilo-help.txt} $tmpdir || rc=1 + if [ -f /boot/boot-text.b ]; then + cp /boot/boot-text.b $tmpdir/boot.b || rc=1 + fi + liloconf=lilo-conf-${image#boot_} + if [ $image = boot_288 -o "$combo" = 1 ] ; then + cp initrd.gz $tmpdir || rc=1 + [ $image = boot_144 ] && liloconf=lilo-conf-1x2 + fi + sed -e "s,/mnt/,$tmpdir/,g" \ + -e "s,/dev/floppy/0,$tmpdev,;" \ + < boot/$liloconf > $tmpdir/lilo.conf || rc=1 + lilo -C $tmpdir/lilo.conf > /dev/null || rc=1 + ;; + esac + + umount $tmpdir + + case ${image} in + initrd) gzip -9 < $tmpfile > $image.gz || rc=1 ;; + *) cp $tmpfile $image.img || rc=1 ;; + esac +done + +losetup -d $tmpdev +rm -f $tmpfile +rmdir $tmpdir + +exit $rc + diff --git a/package/target-finish/isofs/isofs.conf b/package/target-finish/isofs/isofs.conf new file mode 100644 index 000000000..6c5420502 --- /dev/null +++ b/package/target-finish/isofs/isofs.conf @@ -0,0 +1,25 @@ + +mainfunction="packagedb_mainfunction" + +packagedb_mainfunction () +{ + + if [ "$ROCK_BUILD_TARGET" != 1 ] ; then + echo "$xpkg can only be built with ./scripts/Build-Target!" + false + fi + + echo "Creating isofs.txt file .." + admdir="build/${ROCKCFG_ID}/var/adm" + cat << EOT > $xroot/ROCK/isofs_generic.txt +DISK1 $admdir/cache/ ${ROCKCFG_SHORTID}/info/cache/ +DISK1 $admdir/cksums/ ${ROCKCFG_SHORTID}/info/cksums/ +DISK1 $admdir/dependencies/ ${ROCKCFG_SHORTID}/info/dependencies/ +DISK1 $admdir/descs/ ${ROCKCFG_SHORTID}/info/descs/ +DISK1 $admdir/flists/ ${ROCKCFG_SHORTID}/info/flists/ +DISK1 $admdir/md5sums/ ${ROCKCFG_SHORTID}/info/md5sums/ +DISK1 $admdir/packages/ ${ROCKCFG_SHORTID}/info/packages/ +EOT + + cat $xroot/ROCK/isofs_*.txt > $xroot/ROCK/isofs.txt +} diff --git a/package/target-finish/isofs/isofs.desc b/package/target-finish/isofs/isofs.desc new file mode 100644 index 000000000..5361cd478 --- /dev/null +++ b/package/target-finish/isofs/isofs.desc @@ -0,0 +1,38 @@ + +[COPY] --- ROCK-COPYRIGHT-NOTE-BEGIN --- +[COPY] +[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. +[COPY] Please add additional copyright information _after_ the line containing +[COPY] the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +[COPY] the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +[COPY] +[COPY] ROCK Linux: rock-src/package/base/mdadm/mdadm.desc +[COPY] ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf +[COPY] +[COPY] This program is free software; you can redistribute it and/or modify +[COPY] it under the terms of the GNU General Public License as published by +[COPY] the Free Software Foundation; either version 2 of the License, or +[COPY] (at your option) any later version. A copy of the GNU General Public +[COPY] License can be found at Documentation/COPYING. +[COPY] +[COPY] Many people helped and are helping developing ROCK Linux. Please +[COPY] have a look at http://www.rocklinux.org/ and the Documentation/TEAM +[COPY] file for details. +[COPY] +[COPY] --- ROCK-COPYRIGHT-NOTE-END --- + +[I] ISO file system description + +[T] This package creates a file describing the contents of ISO images +[T] for targets. + +[A] The ROCK Linux Project +[M] The ROCK Linux Project + +[C] extra/base + +[L] GPL +[S] Stable +[V] 1 +[P] O --------8- 198.200 + diff --git a/package/target-finish/packagedb/packagedb.conf b/package/target-finish/packagedb/packagedb.conf new file mode 100644 index 000000000..eeeb5fa28 --- /dev/null +++ b/package/target-finish/packagedb/packagedb.conf @@ -0,0 +1,20 @@ + +mainfunction="packagedb_mainfunction" + +packagedb_mainfunction () +{ + + if [ "$ROCK_BUILD_TARGET" != 1 ] ; then + echo "$xpkg can only be built with ./scripts/Build-Target!" + false + fi + + echo "Creating package database ..." + admdir="$xroot/var/adm" + create_package_db $admdir $xroot/ROCK/pkgs + + cat << EOT >> $xroot/ROCK/isofs_packages.txt +EVERY build/${ROCKCFG_ID}/ROCK/pkgs/packages.db ${ROCKCFG_SHORTID}/pkgs/packages.db +SPLIT build/${ROCKCFG_ID}/ROCK/pkgs/ ${ROCKCFG_SHORTID}/pkgs/ +EOT +} diff --git a/package/target-finish/packagedb/packagedb.desc b/package/target-finish/packagedb/packagedb.desc new file mode 100644 index 000000000..17dc2b7dd --- /dev/null +++ b/package/target-finish/packagedb/packagedb.desc @@ -0,0 +1,37 @@ + +[COPY] --- ROCK-COPYRIGHT-NOTE-BEGIN --- +[COPY] +[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. +[COPY] Please add additional copyright information _after_ the line containing +[COPY] the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +[COPY] the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +[COPY] +[COPY] ROCK Linux: rock-src/package/base/mdadm/mdadm.desc +[COPY] ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf +[COPY] +[COPY] This program is free software; you can redistribute it and/or modify +[COPY] it under the terms of the GNU General Public License as published by +[COPY] the Free Software Foundation; either version 2 of the License, or +[COPY] (at your option) any later version. A copy of the GNU General Public +[COPY] License can be found at Documentation/COPYING. +[COPY] +[COPY] Many people helped and are helping developing ROCK Linux. Please +[COPY] have a look at http://www.rocklinux.org/ and the Documentation/TEAM +[COPY] file for details. +[COPY] +[COPY] --- ROCK-COPYRIGHT-NOTE-END --- + +[I] Package database for targets + +[T] This package creates a database file for all packages in a target. + +[A] The ROCK Linux Project +[M] The ROCK Linux Project + +[C] extra/base + +[L] GPL +[S] Stable +[V] 1 +[P] O --------8- 197.200 +