Booyo LiveCD/Make Ash
BooyoLiveCD/MakeAsh ¶download http://developer.linuxtag.net/knoppix/sources/ash-knoppix-26_0.2-4.tar.gz
tar zxvf ash-knoppix-26_0.2-4.tar.gz
modutils-2.4.15 module-init-tools-3.0
292 rm -Rf module*
293 rm -Rf modut*
DEFINE _LINUX_SOURCE ÇÊ¿ä
dietlibc install
rpm -ivh module-init-tools-4.1-0.pre5.3.src.rpm
need to compare insmod.c in bltin and module-init-tools-3.0
edit Makefile
insert CC=diet gcc -O2 -Os
edit CFLAGS = $(RPM_OPT_FLAGS) -DSHELL -D_LINUX_SOURCE -I/usr/src/linux/include -I. -DBIT_TYPES_DEFINED
edit mystring.h
rm strlen
edit bltin/rmmod.c
"Usage: rmmod ?-a | module\n" "Usage: rmmod module\n"
cp /home/tcheun/ash-berry-0.2/bltin/losetup.c .
cp /home/tcheun/ash-berry-0.2/bltin/loop.h .
edit builtins
add losetup_main losetup
edit Makefile
add losetup.c losetuo.o
sh ÀÌ ¸¸µé¾î Áö±â´Â ÇßÁö¸¸, ÀÌ ¹æ¹ýÀÇ ¹®Á¦¸¦ ¾Ë°ÔµÊ. insmod ¸¦ sh ¿¡ builtin À¸·Î ¸¸µé°æ¿ì, insmod ¿¡¼ ¿À·ù°¡ »ý±â¸é, sh ¿¡¼ ºüÁ® ³ª¿À¹Ç·Î, °á°úÀûÀ¸·Î ºÎÆÃÀÌ µÇÁö ¾ÊÀ½. º°µµÀÇ insmod ¸¦ »ç¿ëÇϸé, insmod ÀÇ ¿À·ù¸¦ ¿À·ù·Î ó¸®ÇÒ ¼ö ÀÖ½¿. ÇöÀçÀÇ ¸ðµâ Áß fdomain.ko ¿¡¼ ¹®Á¦ ¹ß»ý. À̸¦ ¹æÁöÇϱâ À§ÇØ knopper °¡ signal(SIGSEGV, SIG_IGN) ¸¦ »ç¿ëÇÏ¿´Áö¸¸, ¼¼±×¸àÅ×ÀÌ¼Ç ¿À·ù ¹ß»ýÇÏ°í Á¤ÁöÇÔ. µð½ºÄÏÀ» »ç¿ëÇÑ ºÎÆÃÀ» °í·ÁÇÒ °æ¿ì, insmod ¸¦ sh ¿¡ builtin ÇÏ´Â °ÍÀÌ ÇÊ¿äÇÏÁö¸¸, udev ·Î ÀÎÇØ ÀÌ¹Ì µð½ºÄÏÀ» »ç¿ëÇÑ ºÎÆÃÀº ¾î·Á¿ö Áø °ÍÀÌ ¾Æ´Ñ°¡?
insmod ¿¡ ÀÇÇØ sh ÀÌ Á×À» °¡´É¼ºÀÌ ³Ê¹« ¸¹À¸¹Ç·Î, insmod.static ¸¦ »ç¿ëÇϱâ·Î ÇÔ.
Makefile ¶bltin ¿¡¼ insmod ¸¦ »©°í, losetup °ú pivot_root ¸¦ Ãß°¡ÇÏ¿´½¿. (SRCS, OBJ2)
insmod ´Â module-init-tools-3.0 ÀÇ insmod.o ¸¦ »ç¿ëÇÔ.
MOD_OBJ = ./module-init-tools-3.0/insmod.o
CFLAGS ÀÇ include ºÎºÐÀ» Á¦°ÅÇÔ.
all ÀÇ °æ¿ì MOD_OBJ Ãß°¡
bltin µð·ºÅ丮 ¹Ø¿¡ knoppix ÀÇ °æ¿ì´Â insmod.c °¡ ÀÖ°í, berry ÀÇ °æ¿ì´Â loop.h, losetup.c. pivot_root.c °¡ ÀÖ½¿.
bltin/mount.c ¶/*
#include "../builtins.h"
const char *pm="/proc/mounts";
knoppix ±×´ë·Î »ç¿ëÇصµ µÊ. (¼öÁ¤ÇÏ¿´½¿) ¾Æ¸¶ bltin/cat.c ÀÇ ¼öÁ¤ ¶Ç´Â bug fix ÀÏ °Í °°À½.
builtins ¶/*
insmodcmd insmod
*/
insmod_main insmod
losetup_main losetup
pivot_root_main pivot_root
mkinit.c ¶/*
for (p = line1 + 6 ; *p != '=' && *p != '/' ; p++);
*/
for (p = line1 + 6 ; *p != '=' && *p != '/' && *p != '\n' ; p++);
ÀÐ¾î º¸¾Æ¾ß ÇÒ±î?
module-init-tools-3.0/insmod.c ¶/*
return;
int main(int argc, char *argv[])
return(0);
return(1);
*/
exit(1);
int insmod_main(int argc, char *argv[])
exit(0);
exit(1);
module-init-tools-3.0/modinfo.c ¶/*
try_old_version("modinfo", argv);
*/
if (!getenv("NEW_MODINFO"))
try_old_version("modinfo", argv);
parser.c ¶/*
putprompt(ps1val());
*/
int i, n;
char pwd256;
if (getcwd(pwd, 256)) {
ÀÐ¾î º¼ °Í.
i=0;
while (i < 256 && pwdi != '\0') i++;
if (pwdi-1 == '/') pwdi++='/'; /* for / */
pwdi++=']';
n=0;
while (*(ps1val()+n) != '\0') { pwdi++=*(ps1val()+n); n++; }
pwdi='\0';
while (i >= 0 && pwdi != '/') i--;
if (pwdi-1 == '/') i--; /* for / */
pwdi='[';
putprompt(&pwdi);
} else {
putprompt(ps1val());
}
|
If you suspect a man, don't employ him. |