Browse Source

added an options to include a kiss shell into the bootdisk initrd (useful

for expert use and debugging ...)


git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@1105 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
rocklinux
Rene Rebe 21 years ago
parent
commit
2be68b21be
4 changed files with 37 additions and 17 deletions
  1. +7
    -12
      target/bootdisk/build_stage1.sh
  2. +6
    -0
      target/bootdisk/config.hlp
  3. +7
    -3
      target/bootdisk/config.in
  4. +17
    -2
      target/bootdisk/linuxrc.c

+ 7
- 12
target/bootdisk/build_stage1.sh

@ -9,13 +9,7 @@ diet $CC $base/target/$target/linuxrc.c -Wall \
-DSTAGE_2_BIG_IMAGE="\"${ROCKCFG_SHORTID}/2nd_stage.tar.gz\"" \
-DSTAGE_2_SMALL_IMAGE="\"${ROCKCFG_SHORTID}/2nd_stage_small.tar.gz\"" \
-o linuxrc # > $disksdir/tmp 2>&1
# I always prefer to see the output !
# Only print this output if it's not the usual dietlibc junk
#x="$( sed 's,^[^:]*: ,~~: ,' < $disksdir/tmp | md5sum | cut -f1 -d' ' )"
#if [ "$x" != "0ede96ab34b5572403579dfb48ebe10c" ] ; then
# cat $disksdir/tmp ; echo "[ $x ]"
#fi ; rm -f $disksdir/tmp
#
echo_status "Copy various helper applications."
cp ../2nd_stage/bin/{tar,gzip} bin/
cp ../2nd_stage/sbin/{ip,hwscan} bin/
@ -49,11 +43,12 @@ done
rm -f lib/modules/[0-9]*/kernel/drivers/scsi/{st,scsi_debug}.o
rm -f lib/modules/[0-9]*/kernel/drivers/net/{dummy,ppp*}.o
#
if [ "$ROCK_DEBUG_BOOTDISK_USEKISS" = 1 ]; then
echo_status "Using kiss shell for debugging initrd image."
cp /bin/kiss bin/; mv linuxrc bin/; ln -s bin/kiss linuxrc
rm -f lib/modules/[0-9]*/kernel/drivers/net/{dgrx,acenic}.o
rm -f lib/modules/[0-9]*/kernel/drivers/scsi/{advansys,qla1280}.o
if [ "$ROCKCFG_BOOTDISK_USEKISS" = 1 ]; then
echo_status "Adding kiss shell for expert use of the initrd image."
cp $root/bin/kiss bin/
#mv linuxrc bin/; ln -s bin/kiss linuxrc
#rm -f lib/modules/[0-9]*/kernel/drivers/net/{dgrx,acenic}.o
#rm -f lib/modules/[0-9]*/kernel/drivers/scsi/{advansys,qla1280}.o
fi
cd ..

+ 6
- 0
target/bootdisk/config.hlp

@ -0,0 +1,6 @@
ROCKCFG_BOOTDISK_USEKISS
If this options is enabled the kiss shell is installed into the first
stage initrd of the bootdisk. This is helpful for unusal installations
and debugging.

+ 7
- 3
target/bootdisk/config.in

@ -20,6 +20,8 @@
#
# --- ROCK-COPYRIGHT-NOTE-END ---
bool 'Include the kiss shell into the initrd' ROCKCFG_BOOTDISK_USEKISS 1
pkgfilter sed '
# Select some packages explicitely (base)
@ -50,9 +52,10 @@ pkgfilter sed '
/ base / ! { s/^X /O /p; d; }; /^. -----/ { s/^X /O /p; d; };
# Disable even more packages we do not need
/ gcc2 / { s/^X /O /p; d; }; / joe / { s/^X /O /p; d; }; / gdbm / { s/^X /O /p; d; };
/ kiss / { s/^X /O /p; d; }; / pdksh / { s/^X /O /p; d; }; / libelf / { s/^X /O /p; d; };
/ prelink / { s/^X /O /p; d; }; / ccache / { s/^X /O /p; d; }; / pam / { s/^X /O /p; d; };
/ gcc2 / { s/^X /O /p; d; }; / joe / { s/^X /O /p; d; };
/ gdbm / { s/^X /O /p; d; }; / pam / { s/^X /O /p; d; };
/ pdksh / { s/^X /O /p; d; }; / libelf / { s/^X /O /p; d; };
/ prelink / { s/^X /O /p; d; }; / ccache / { s/^X /O /p; d; };
/ cracklib / { s/^X /O /p; d; }; / hotplug / { s/^X /O /p; d; };'
ROCKCFGSET_CREATE_TARBZ2=1
@ -64,6 +67,7 @@ ROCKCFGSET_DIETLIBC_DYN=0
ROCKCFGSET_DIETLIBC_ALL=0
ROCKCFGSET_DIETLIBC_modutils=1
ROCKCFGSET_DIETLIBC_module_init_tools=1
ROCKCFGSET_DIETLIBC_kiss=1
ROCKCFGSET_DIETLIBC_tar=1
ROCKCFGSET_DIETLIBC_gzip=1
ROCKCFGSET_DIETLIBC_wget=1

+ 17
- 2
target/bootdisk/linuxrc.c

@ -130,7 +130,7 @@ void httpload()
if ( mount("none", "/mnt_root", "tmpfs", 0, TMPFS_OPTIONS) )
{ perror("Can't mount /mnt_root"); exit_linuxrc=0; }
if (pipe(fd) <0)
if ( pipe(fd) < 0 )
{ perror("Can't create pipe"); exit_linuxrc=0; }
if ( fork() == 0 ) {
@ -454,6 +454,16 @@ void autoload_modules()
wait(NULL);
}
void exec_sh()
{
if ( fork() == 0 ) {
execl("/bin/kiss", "kiss", NULL);
perror("kiss");
_exit(1);
}
wait(NULL);
}
int main()
{
char text[100];
@ -491,8 +501,9 @@ drivers (if needed) and configure the installation source so the\n\
4. Load kernel SCSI modules from this disk\n\
5. Load kernel modules from another disk\n\
6. Activate already formatted swap device\n\
7. Execute a (kiss) shell if present (for experts!)\n\
\n\
What do you want to do [0-6] (default=0)? ");
What do you want to do [0-7] (default=0)? ");
fflush(stdout);
text[0]=0; fgets(text, 100, stdin); text[99]=0;
@ -540,6 +551,10 @@ What do you want to do [0-6] (default=0)? ");
activate_swap();
break;
case 7:
exec_sh();
break;
default:
perror ("No such option present!");
}

Loading…
Cancel
Save