Added some more binaries to the image.

This commit is contained in:
Alex Smith
2012-08-01 11:00:35 +01:00
parent e6b3188fcb
commit 8110732b03
12 changed files with 80 additions and 67 deletions
+11 -6
View File
@@ -19,14 +19,19 @@ if $(HAIKU_ATA_STACK) = 1 {
IDE_ONLY = "" ; IDE_ONLY = "" ;
} }
SYSTEM_BIN = "[" base64 basename bash cat chgrp chmod chown chroot cksum comm SYSTEM_BIN = "[" addattr base64 basename bash beep cal cat catattr chgrp chmod
cp split cut date dd dircolors dirname du echo env expand expr factor false chown chroot cksum clear clockconfig cmp collectcatkeys comm compress
fmt fold getlimits groups head hostname id <bin>install join kill link copyattr cp csplit cut date dd diff diff3 dircolors dirname du
ln locale logname ls md5sum mkdir mkfifo mktemp mv nl nohup nproc od paste dumpcatalog echo eject env error expand expr factor false find finddir
pathchk pr printenv printf ps ptx pwd readlink rm rmdir safemode seq fmt fold fortune gawk gzip gzexe getlimits groups head hostname id
<bin>install isvolume join kernel_debugger kill less lessecho lesskey link
linkcatkeys listdev ln locale locate logger logname ls md5sum mkdir mkfifo
mktemp mount mountvolume mv nl nohup nproc od paste patch pathchk pr
printenv printf ps ptx pwd readlink rm rmattr rmdir safemode sdiff seq
sha1sum shred shuf sleep sort split stat stty su sum sync sysinfo tac tail sha1sum shred shuf sleep sort split stat stty su sum sync sysinfo tac tail
tee test timeout touch tr true truncate tsort tty unexpand uname uniq tee test timeout touch tr true truncate tsort tty unexpand uname uniq
unlink wc whoami yes unlink unmount unzip <bin>updatedb waitfor wc whoami xargs xres yes
zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew
; ;
SYSTEM_APPS = ; SYSTEM_APPS = ;
+10 -10
View File
@@ -43,7 +43,7 @@ dumpRawData(const char *buffer, size_t size)
while (dumpPosition < size) { while (dumpPosition < size) {
// Position for this line // Position for this line
printf("0x%06lx: ", dumpPosition); printf("0x%06" B_PRIx32 ": ", dumpPosition);
// Print the bytes in form of hexadecimal numbers // Print the bytes in form of hexadecimal numbers
for (uint32 i = 0; i < kChunkSize; i++) { for (uint32 i = 0; i < kChunkSize; i++) {
@@ -88,7 +88,7 @@ type_to_string(uint32 type)
sprintf(buffer, "'%c%c%c%c'", value[0], value[1], value[2], sprintf(buffer, "'%c%c%c%c'", value[0], value[1], value[2],
value[3]); value[3]);
} else } else
sprintf(buffer, "0x%08lx", type); sprintf(buffer, "0x%08" B_PRIx32, type);
return buffer; return buffer;
} }
@@ -218,28 +218,28 @@ catAttr(const char *attribute, const char *fileName, bool keepRaw,
switch (info.type) { switch (info.type) {
case B_INT8_TYPE: case B_INT8_TYPE:
printf("%d\n", *((int8*)buffer)); printf("%" B_PRId8 "\n", *((int8*)buffer));
break; break;
case B_UINT8_TYPE: case B_UINT8_TYPE:
printf("%u\n", *((uint8*)buffer)); printf("%" B_PRIu8 "\n", *((uint8*)buffer));
break; break;
case B_INT16_TYPE: case B_INT16_TYPE:
printf("%d\n", *((int16*)buffer)); printf("%" B_PRId16 "\n", *((int16*)buffer));
break; break;
case B_UINT16_TYPE: case B_UINT16_TYPE:
printf("%u\n", *((uint16*)buffer)); printf("%" B_PRIu16 "\n", *((uint16*)buffer));
break; break;
case B_INT32_TYPE: case B_INT32_TYPE:
printf("%ld\n", *((int32*)buffer)); printf("%" B_PRId32 "\n", *((int32*)buffer));
break; break;
case B_UINT32_TYPE: case B_UINT32_TYPE:
printf("%lu\n", *((uint32*)buffer)); printf("%" B_PRIu32 "\n", *((uint32*)buffer));
break; break;
case B_INT64_TYPE: case B_INT64_TYPE:
printf("%Ld\n", *((int64*)buffer)); printf("%" B_PRId64 "\n", *((int64*)buffer));
break; break;
case B_UINT64_TYPE: case B_UINT64_TYPE:
printf("%Lu\n", *((uint64*)buffer)); printf("%" B_PRIu64 "\n", *((uint64*)buffer));
break; break;
case B_FLOAT_TYPE: case B_FLOAT_TYPE:
printf("%f\n", *((float*)buffer)); printf("%f\n", *((float*)buffer));
+1 -1
View File
@@ -73,7 +73,7 @@ setTimeZoneOffset(BPath path)
_kern_set_timezone(timeZoneOffset, timeZoneID.String(), _kern_set_timezone(timeZoneOffset, timeZoneID.String(),
timeZoneID.Length()); timeZoneID.Length());
printf("timezone is %s, offset is %ld seconds from GMT.\n", printf("timezone is %s, offset is %" B_PRId32 " seconds from GMT.\n",
timeZoneID.String(), timeZoneOffset); timeZoneID.String(), timeZoneOffset);
} }
+1 -1
View File
@@ -320,7 +320,7 @@ print_error(char *number)
error = p->value; error = p->value;
} }
printf("0x%lx: %s\n", error, strerror(error)); printf("0x%" B_PRIx32 ": %s\n", error, strerror(error));
} }
+6 -6
View File
@@ -93,8 +93,8 @@ main(int argc, char** argv)
BVolume volume(volumeDevice); BVolume volume(volumeDevice);
status_t ret = volume.InitCheck(); status_t ret = volume.InitCheck();
if (ret != B_OK) { if (ret != B_OK) {
fprintf(stderr, "%s: failed to get BVolume for device %ld: %s\n", fprintf(stderr, "%s: failed to get BVolume for device %" B_PRIdDEV
argv[0], volumeDevice, strerror(ret)); ": %s\n", argv[0], volumeDevice, strerror(ret));
return 1; return 1;
} }
@@ -103,8 +103,8 @@ main(int argc, char** argv)
BPartition* partition; BPartition* partition;
ret = roster.FindPartitionByVolume(volume, &diskDevice, &partition); ret = roster.FindPartitionByVolume(volume, &diskDevice, &partition);
if (ret != B_OK) { if (ret != B_OK) {
fprintf(stderr, "%s: failed to get partition for device %ld: %s\n", fprintf(stderr, "%s: failed to get partition for device %" B_PRIdDEV
argv[0], volumeDevice, strerror(ret)); ": %s\n", argv[0], volumeDevice, strerror(ret));
return 1; return 1;
} }
// check this option directly and not via fs_stat_dev() // check this option directly and not via fs_stat_dev()
@@ -122,8 +122,8 @@ main(int argc, char** argv)
return 0; return 0;
} else { } else {
fprintf(stderr, "%s: can't get information about dev_t: %ld\n", fprintf(stderr, "%s: can't get information about dev_t: %" B_PRIdDEV
argv[0], volumeDevice); "\n", argv[0], volumeDevice);
return 1; return 1;
} }
} }
+13 -13
View File
@@ -29,7 +29,7 @@ dump_raw_data(const char *buffer, size_t size)
while (dumpPosition < size) { while (dumpPosition < size) {
// Position for this line // Position for this line
printf("\t%04lx: ", dumpPosition); printf("\t%04" B_PRIx32 ": ", dumpPosition);
// Print the bytes in form of hexadecimal numbers // Print the bytes in form of hexadecimal numbers
for (uint32 i = 0; i < kChunkSize; i++) { for (uint32 i = 0; i < kChunkSize; i++) {
@@ -72,35 +72,35 @@ show_attr_contents(BNode& node, const char* attribute, const attr_info& info)
char buffer[kLimit]; char buffer[kLimit];
ssize_t bytesRead = node.ReadAttr(attribute, info.type, 0, buffer, size); ssize_t bytesRead = node.ReadAttr(attribute, info.type, 0, buffer, size);
if (bytesRead != size) { if (bytesRead != size) {
fprintf(stderr, "Could only read %lld bytes from attribute!\n", fprintf(stderr, "Could only read %" B_PRIdOFF " bytes from attribute!\n",
size); size);
return; return;
} }
switch (info.type) { switch (info.type) {
case B_INT8_TYPE: case B_INT8_TYPE:
printf("%d\n", *((int8 *)buffer)); printf("%" B_PRId8 "\n", *((int8 *)buffer));
break; break;
case B_UINT8_TYPE: case B_UINT8_TYPE:
printf("%u\n", *((uint8 *)buffer)); printf("%" B_PRIu8 "\n", *((uint8 *)buffer));
break; break;
case B_INT16_TYPE: case B_INT16_TYPE:
printf("%d\n", *((int16 *)buffer)); printf("%" B_PRId16 "\n", *((int16 *)buffer));
break; break;
case B_UINT16_TYPE: case B_UINT16_TYPE:
printf("%u\n", *((uint16 *)buffer)); printf("%" B_PRIu16 "\n", *((uint16 *)buffer));
break; break;
case B_INT32_TYPE: case B_INT32_TYPE:
printf("%ld\n", *((int32 *)buffer)); printf("%" B_PRId32 "\n", *((int32 *)buffer));
break; break;
case B_UINT32_TYPE: case B_UINT32_TYPE:
printf("%lu\n", *((uint32 *)buffer)); printf("%" B_PRIu32 "\n", *((uint32 *)buffer));
break; break;
case B_INT64_TYPE: case B_INT64_TYPE:
printf("%lld\n", *((int64 *)buffer)); printf("%" B_PRId64 "\n", *((int64 *)buffer));
break; break;
case B_UINT64_TYPE: case B_UINT64_TYPE:
printf("%llu\n", *((uint64 *)buffer)); printf("%" B_PRIu64 "\n", *((uint64 *)buffer));
break; break;
case B_FLOAT_TYPE: case B_FLOAT_TYPE:
printf("%f\n", *((float *)buffer)); printf("%f\n", *((float *)buffer));
@@ -198,7 +198,7 @@ get_type(type_code type)
sprintf(buffer, "'%c%c%c%c'", value[0], value[1], value[2], sprintf(buffer, "'%c%c%c%c'", value[0], value[1], value[2],
value[3]); value[3]);
} else } else
sprintf(buffer, "0x%08lx", type); sprintf(buffer, "0x%08" B_PRIx32, type);
return buffer; return buffer;
} }
@@ -262,7 +262,7 @@ main(int argc, char *argv[])
status = node.GetAttrInfo(name, &attrInfo); status = node.GetAttrInfo(name, &attrInfo);
if (status >= B_OK) { if (status >= B_OK) {
printf("%*s", kTypeWidth, get_type(attrInfo.type)); printf("%*s", kTypeWidth, get_type(attrInfo.type));
printf("% *Li ", kSizeWidth, attrInfo.size); printf("% *" B_PRId64 " ", kSizeWidth, attrInfo.size);
printf("\"%s\"", name); printf("\"%s\"", name);
if (printContents) { if (printContents) {
@@ -283,6 +283,6 @@ main(int argc, char *argv[])
} }
} }
printf("\n%Ld bytes total in attributes.\n", total); printf("\n%" B_PRId64 " bytes total in attributes.\n", total);
return 0; return 0;
} }
+8 -4
View File
@@ -87,16 +87,20 @@ dump_attribute(struct device_attr_info *attr, int32 level)
printf("string : \"%s\"", attr->value.string); printf("string : \"%s\"", attr->value.string);
break; break;
case B_UINT8_TYPE: case B_UINT8_TYPE:
printf("uint8 : %u (%#x)", attr->value.ui8, attr->value.ui8); printf("uint8 : %" B_PRIu8 " (%#" B_PRIx8 ")", attr->value.ui8,
attr->value.ui8);
break; break;
case B_UINT16_TYPE: case B_UINT16_TYPE:
printf("uint16 : %u (%#x)", attr->value.ui16, attr->value.ui16); printf("uint16 : %" B_PRIu16 " (%#" B_PRIx16 ")", attr->value.ui16,
attr->value.ui16);
break; break;
case B_UINT32_TYPE: case B_UINT32_TYPE:
printf("uint32 : %lu (%#lx)", attr->value.ui32, attr->value.ui32); printf("uint32 : %" B_PRIu32 " (%#" B_PRIx32 ")", attr->value.ui32,
attr->value.ui32);
break; break;
case B_UINT64_TYPE: case B_UINT64_TYPE:
printf("uint64 : %Lu (%#Lx)", attr->value.ui64, attr->value.ui64); printf("uint64 : %" B_PRIu64 " (%#" B_PRIx64 ")", attr->value.ui64,
attr->value.ui64);
break; break;
default: default:
printf("raw data"); printf("raw data");
+6 -6
View File
@@ -184,11 +184,11 @@ collectAllCatalogKeys(BString& inputStr)
if (fetchKey(in)) { if (fetchKey(in)) {
if (haveID) { if (haveID) {
if (showKeys) if (showKeys)
printf("CatKey(%ld)\n", id); printf("CatKey(%" B_PRId32 ")\n", id);
res = catalog->SetString(id, ""); res = catalog->SetString(id, "");
if (res != B_OK) { if (res != B_OK) {
fprintf(stderr, "couldn't add key %ld - error: %s\n", fprintf(stderr, "couldn't add key %" B_PRId32 " - error: "
id, strerror(res)); "%s\n", id, strerror(res));
exit(-1); exit(-1);
} }
} else { } else {
@@ -285,8 +285,8 @@ main(int argc, char **argv)
char *buf = inputStr.LockBuffer(sz); char *buf = inputStr.LockBuffer(sz);
off_t rsz = inFile.Read(buf, sz); off_t rsz = inFile.Read(buf, sz);
if (rsz < sz) { if (rsz < sz) {
fprintf(stderr, "couldn't read %Ld bytes from %s (got only %Ld)\n", fprintf(stderr, "couldn't read %" B_PRId64 " bytes from %s (got "
sz, inputFile, rsz); "only %" B_PRId64 ")\n", sz, inputFile, rsz);
exit(-1); exit(-1);
} }
inputStr.UnlockBuffer(rsz); inputStr.UnlockBuffer(rsz);
@@ -301,7 +301,7 @@ main(int argc, char **argv)
if (showSummary) { if (showSummary) {
int32 count = catalog->CountItems(); int32 count = catalog->CountItems();
if (count) if (count)
fprintf(stderr, "%ld key%s found and written to %s\n", fprintf(stderr, "%" B_PRId32 " key%s found and written to %s\n",
count, (count==1 ? "": "s"), outputFile.String()); count, (count==1 ? "": "s"), outputFile.String());
else else
fprintf(stderr, "no keys found\n"); fprintf(stderr, "no keys found\n");
+6 -5
View File
@@ -64,15 +64,16 @@ main(int argc, char **argv)
while (!walker.AtEnd()) { while (!walker.AtEnd()) {
const CatKey &key(walker.GetKey()); const CatKey &key(walker.GetKey());
key.GetStringParts(&str, &ctx, &cmt); key.GetStringParts(&str, &ctx, &cmt);
printf("Hash:\t\t%lu\nKey:\t\t<%s:%s:%s>\nTranslation:\t%s\n-----\n", printf("Hash:\t\t%" B_PRIu32 "\nKey:\t\t<%s:%s:%s>\nTranslation:\t%s\n"
key.fHashVal, str.String(), ctx.String(), cmt.String(), "-----\n", key.fHashVal, str.String(), ctx.String(), cmt.String(),
walker.GetValue()); walker.GetValue());
walker.Next(); walker.Next();
} }
int32 count = inputCatalog.CountItems(); int32 count = inputCatalog.CountItems();
if (count) if (count) {
fprintf(stderr, "%ld entr%s dumped\n", count, (count==1 ? "y": "ies")); fprintf(stderr, "%" B_PRId32 " entr%s dumped\n", count,
else (count==1 ? "y": "ies"));
} else
fprintf(stderr, "no entries found\n"); fprintf(stderr, "no entries found\n");
return res; return res;
} }
+1 -1
View File
@@ -180,7 +180,7 @@ main(int argc, char **argv)
if (showSummary) { if (showSummary) {
int32 count = targetCatalog.CountItems(); int32 count = targetCatalog.CountItems();
if (count) { if (count) {
fprintf(stderr, "%ld key%s found and written to %s\n", fprintf(stderr, "%" B_PRId32 " key%s found and written to %s\n",
count, (count==1 ? "": "s"), outputFile.String()); count, (count==1 ? "": "s"), outputFile.String());
} else } else
fprintf(stderr, "no keys found\n"); fprintf(stderr, "no keys found\n");
+1 -1
View File
@@ -99,7 +99,7 @@ size_string(int64 size)
static char string[64]; static char string[64];
if (size < 1024) if (size < 1024)
sprintf(string, "%Ld", size); sprintf(string, "%" B_PRId64, size);
else { else {
const char* units[] = {"K", "M", "G", NULL}; const char* units[] = {"K", "M", "G", NULL};
int32 i = -1; int32 i = -1;
+16 -13
View File
@@ -28,8 +28,8 @@ printTeamInfo(team_info *teamInfo, bool printHeader)
printf("%-50s %5s %8s %4s %4s\n", "Team", "Id", "#Threads", "Gid", \ printf("%-50s %5s %8s %4s %4s\n", "Team", "Id", "#Threads", "Gid", \
"Uid"); "Uid");
printf("%-50s %5ld %8ld %4d %4d\n", teamInfo->args, teamInfo->team, printf("%-50s %5" B_PRId32 " %8" B_PRId32 " %4d %4d\n", teamInfo->args,
teamInfo->thread_count, teamInfo->uid, teamInfo->gid); teamInfo->team, teamInfo->thread_count, teamInfo->uid, teamInfo->gid);
} }
@@ -37,7 +37,7 @@ static void
printTeamThreads(team_info *teamInfo, bool printSemaphoreInfo) printTeamThreads(team_info *teamInfo, bool printSemaphoreInfo)
{ {
char *threadState; char *threadState;
uint32 threadCookie = 0; int32 threadCookie = 0;
sem_info semaphoreInfo; sem_info semaphoreInfo;
thread_info threadInfo; thread_info threadInfo;
@@ -51,18 +51,21 @@ printTeamThreads(team_info *teamInfo, bool printSemaphoreInfo)
else else
threadState = sStates[threadInfo.state - 1]; threadState = sStates[threadInfo.state - 1];
printf("%-37s %5ld %8s %4ld %8llu %8llu ", printf("%-37s %5" B_PRId32 " %8s %4" B_PRId32 " %8" B_PRIu64 " %8"
threadInfo.name, threadInfo.thread, threadState, B_PRId64 " ", threadInfo.name, threadInfo.thread, threadState,
threadInfo.priority, (threadInfo.user_time / 1000), threadInfo.priority, (threadInfo.user_time / 1000),
(threadInfo.kernel_time / 1000)); (threadInfo.kernel_time / 1000));
if (printSemaphoreInfo) { if (printSemaphoreInfo) {
if (threadInfo.state == B_THREAD_WAITING && threadInfo.sem != -1) { if (threadInfo.state == B_THREAD_WAITING && threadInfo.sem != -1) {
status_t status = get_sem_info(threadInfo.sem, &semaphoreInfo); status_t status = get_sem_info(threadInfo.sem, &semaphoreInfo);
if (status == B_OK) if (status == B_OK) {
printf("%s(%ld)\n", semaphoreInfo.name, semaphoreInfo.sem); printf("%s(%" B_PRId32 ")\n", semaphoreInfo.name,
else semaphoreInfo.sem);
printf("%s(%ld)\n", strerror(status), threadInfo.sem); } else {
printf("%s(%" B_PRId32 ")\n", strerror(status),
threadInfo.sem);
}
} else } else
puts(""); puts("");
} else } else
@@ -74,7 +77,7 @@ int
main(int argc, char **argv) main(int argc, char **argv)
{ {
team_info teamInfo; team_info teamInfo;
uint32 teamCookie = 0; int32 teamCookie = 0;
system_info systemInfo; system_info systemInfo;
bool printSystemInfo = false; bool printSystemInfo = false;
bool printThreads = false; bool printThreads = false;
@@ -153,13 +156,13 @@ main(int argc, char **argv)
// system stats // system stats
get_system_info(&systemInfo); get_system_info(&systemInfo);
printf("\nSystem Info\n"); printf("\nSystem Info\n");
printf("%luk (%lu bytes) total memory\n", printf("%" B_PRIu32 "k (%" B_PRIu32 " bytes) total memory\n",
(systemInfo.max_pages * B_PAGE_SIZE / 1024), (systemInfo.max_pages * B_PAGE_SIZE / 1024),
(systemInfo.max_pages * B_PAGE_SIZE)); (systemInfo.max_pages * B_PAGE_SIZE));
printf("%luk (%lu bytes) currently committed\n", printf("%" B_PRIu32 "k (%" B_PRIu32 " bytes) currently committed\n",
(systemInfo.used_pages * B_PAGE_SIZE / 1024), (systemInfo.used_pages * B_PAGE_SIZE / 1024),
(systemInfo.used_pages * B_PAGE_SIZE)); (systemInfo.used_pages * B_PAGE_SIZE));
printf("%luk (%lu bytes) currently available\n", printf("%" B_PRIu32 "k (%" B_PRIu32 " bytes) currently available\n",
(systemInfo.max_pages - systemInfo.used_pages) * B_PAGE_SIZE / 1024, (systemInfo.max_pages - systemInfo.used_pages) * B_PAGE_SIZE / 1024,
(systemInfo.max_pages - systemInfo.used_pages) * B_PAGE_SIZE); (systemInfo.max_pages - systemInfo.used_pages) * B_PAGE_SIZE);
printf("%2.1f%% memory utilisation\n", printf("%2.1f%% memory utilisation\n",