aboutsummaryrefslogtreecommitdiff
path: root/miscutils/fbsplash.c
AgeCommit message (Collapse)Author
2020-08-13build system: drop PLATFORM_LINUXRon Yorston
PLATFORM_LINUX is a hidden configuration option which is disabled by default and enabled at over a hundred locations for features that are deemed to be Linux specific. The only effect of PLATFORM_LINUX is to control compilation of libbb/match_fstype.c. This file is only needed by mount and umount. Remove all references to PLATFORM_LINUX and compile match_fstype.c if mount or umount is enabled. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-07-02libbb: reduce the overhead of single parameter bb_error_msg() callsJames Byrne
Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower overhead call to bb_perror_msg() when only a string was being printed with no parameters. This saves space for some CPU architectures because it avoids the overhead of a call to a variadic function. However there has never been a simple version of bb_error_msg(), and since 2007 many new calls to bb_perror_msg() have been added that only take a single parameter and so could have been using bb_simple_perror_message(). This changeset introduces 'simple' versions of bb_info_msg(), bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and bb_herror_msg_and_die(), and replaces all calls that only take a single parameter, or use something like ("%s", arg), with calls to the corresponding 'simple' version. Since it is likely that single parameter calls to the variadic functions may be accidentally reintroduced in the future a new debugging config option WARN_SIMPLE_MSG has been introduced. This uses some macro magic which will cause any such calls to generate a warning, but this is turned off by default to avoid use of the unpleasant macros in normal circumstances. This is a large changeset due to the number of calls that have been replaced. The only files that contain changes other than simple substitution of function calls are libbb.h, libbb/herror_msg.c, libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c, networking/udhcp/common.h and util-linux/mdev.c additonal macros have been added for logging so that single parameter and multiple parameter logging variants exist. The amount of space saved varies considerably by architecture, and was found to be as follows (for 'defconfig' using GCC 7.4): Arm: -92 bytes MIPS: -52 bytes PPC: -1836 bytes x86_64: -938 bytes Note that for the MIPS architecture only an exception had to be made disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h) because it made these files larger on MIPS. Signed-off-by: James Byrne <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2018-12-28config: update size informationDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2018-03-29fbsplash: support configurable image positionPeter Korsgaard
For some setups (E.G. for supporting different screen resolutions), positioning the image somewhere else than the top left corner may be interesting. Add support for IMG_LEFT/IMG_TOP settings to specify the image location, similar to how it is done for the progress bar. function old new delta fbsplash_main 994 1038 +44 static.param_names 57 74 +17 packed_usage 32631 32647 +16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 77/0) Total: 77 bytes Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-09-13*: use ESC define instead of "\033"; use ESC[m instead of ESC[0mDenys Vlasenko
text data bss dec hex filename 922535 481 6832 929848 e3038 busybox_old 922534 481 6832 929847 e3037 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-21config: deindent all help textsDenys Vlasenko
Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-18Update menuconfig items with approximate applet sizesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-22Convert all miscutils/* applets to "new style" applet definitionsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-22Split miscutils/Config.src items into miscutils/*.c filesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-21*: hopefully all setup_common_bufsiz() are in placeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-21libbb: make bb_common_bufsiz1 1 kbyte, add capability to use bss tail for itDenys Vlasenko
The config item is FEATURE_USE_BSS_TAIL. When it is off (default): function old new delta read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 push 46 44 -2 inetd_main 2136 2134 -2 uevent_main 421 418 -3 addLines 97 92 -5 bb_common_bufsiz1 8193 1024 -7169 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/5 up/down: 62/-7181) Total: -7119 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829901 4086 1904 835891 cc133 busybox_unstripped FEATURE_USE_BSS_TAIL=y: read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 inetd_main 2136 2134 -2 bb_common_bufsiz1 8193 - -8193 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 8/1 up/down: 62/-8195) Total: -8133 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829911 4086 880 834877 cbd3d busybox_unstripped FIXME: setup_common_bufsiz() calls are missing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-27fbsplash: use virtual y size in mmap size calculationsTimo Teräs
The virtual y can be larger - and we can be even writing there since we are taking into account the y offset. Avoids possible crash. But use it only if set, seems it is not set if virtual area is not allocated (though, often fbcon allocates some scrollback area). Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-03-12libbb: introduce and use is_prefixed_with()Denys Vlasenko
function old new delta is_prefixed_with - 18 +18 complete_username 78 77 -1 man_main 737 735 -2 fsck_device 429 427 -2 unpack_ar_archive 80 76 -4 strip_unsafe_prefix 105 101 -4 singlemount 1054 1050 -4 rtc_adjtime_is_utc 90 86 -4 resolve_mount_spec 88 84 -4 parse_one_line 1029 1025 -4 parse_conf 1460 1456 -4 may_wakeup 83 79 -4 loadkmap_main 219 215 -4 get_irqs_from_stat 103 99 -4 get_header_cpio 913 909 -4 findfs_main 79 75 -4 fbsplash_main 1230 1226 -4 load_crontab 776 771 -5 expand_vars_to_list 1151 1146 -5 date_main 881 876 -5 skip_dev_pfx 30 24 -6 make_device 2199 2193 -6 complete_cmd_dir_file 773 767 -6 run_applet_and_exit 715 708 -7 uudecode_main 321 313 -8 pwdx_main 197 189 -8 execute 568 560 -8 i2cdetect_main 1186 1176 -10 procps_scan 1242 1230 -12 procps_read_smaps 1017 1005 -12 process_module 746 734 -12 patch_main 1903 1891 -12 nfsmount 3572 3560 -12 stack_machine 126 112 -14 process_timer_stats 449 435 -14 match_fstype 111 97 -14 do_ipaddr 1344 1330 -14 open_list_and_close 359 343 -16 get_header_tar 1795 1779 -16 prepend_new_eth_table 340 323 -17 fsck_main 1811 1794 -17 find_iface_state 56 38 -18 dnsd_main 1321 1303 -18 base_device 179 158 -21 find_keyword 104 82 -22 handle_incoming_and_exit 2785 2762 -23 parse_and_put_prompt 774 746 -28 modinfo 347 317 -30 find_action 204 171 -33 update_passwd 1470 1436 -34 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/49 up/down: 18/-540) Total: -522 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-02zcat: complain if input is not compressedDenys Vlasenko
function old new delta buffer_fill_and_print 178 191 +13 varvalue 735 743 +8 bbunpack 747 755 +8 open_zipped 85 89 +4 xmalloc_open_zipped_read_close 61 63 +2 get_addr_1 240 242 +2 fbsplash_main 1228 1230 +2 pstree_main 322 321 -1 builtin_type 121 119 -2 do_load 954 926 -28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 7/3 up/down: 39/-31) Total: 8 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14whitespace fixes. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-10-17fbsplash: fix regression from e4fa7b7Timo Teräs
commit e4fa7b7 (limit progress bar flicker) made the progress bar counter unsigned causing i < 0 to never come true. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-09-06fbsplash: support non-RGB565 pixels in 16-bit modeLinus Walleij
function old new delta fbsplash_main 953 989 +36 fb_pixel_value 80 110 +30 Signed-off-by: Linus Walleij <triad@df.lth.se> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-02-29fbsplash: use line_length instead of xres * bytes_per_pixelYin Kangkai
In some system (e.g. my "strange" device), line_length is not equal xres * bytes_per_pixel, so we need to use line_length in scr_fix to mmap and draw rectangle etc. My "strange" device output this: bytes_per_pixel: 4 xres: 600, yres: 1024 yoffset: 0, xoffset: 0, line_length: 2432 G.addr: b74da000 Signed-off-by: Yin Kangkai <kangkai.yin@intel.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-17fbsplash: support 8bit modePeter Korsgaard
Fake truecolor support using a RGB:332 palette. function old new delta fb_setpal - 172 +172 fbsplash_main 920 953 +33 fb_pixel_value 50 80 +30 fb_write_pixel 47 51 +4 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/0 up/down: 239/0) Total: 239 bytes Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-17fbsplash: limit progress bar flickerPeter Korsgaard
Progress bar updates flicker quite a bit on slow hw / high resolutions as the background is completely cleared before the new progress bar position is drawn on top. Improve it by first drawing the progress bar and then only fill the remaining rows with the background. function old new delta fb_drawprogressbar 444 429 -15 Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-05*: remove "Options:" string from help textsDenys Vlasenko
function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11move remaining help text from include/usage.src.hPere Orga
Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-28fbsplash: Add support for 24 and 32 bit color depthNuno Lucas
function old new delta fb_drawprogressbar 372 447 +75 fb_pixel_value - 50 +50 fb_write_pixel - 47 +47 fbsplash_main 889 920 +31 fb_drawfullrectangle 101 131 +30 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/0 up/down: 233/0) Total: 233 bytes Signed-off-by: Nuno Lucas <ntlucas@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-05Let fbsplash display images even when a second buffer is activeDan Fandrich
If a previous application uses double buffering and makes the second buffer visible, fbsplash's images (written to the first buffer) otherwise won't be visible. Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-16*: make GNU licensing statement forms more regularDenys Vlasenko
This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-12*: s/xatoi_u/xatoi_positive/g - I got bored of mistyping xatoi_u as xatou_iDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-16consolidate ESC sequencesDenys Vlasenko
function old new delta bell 2 - -2 CMdown 2 - -2 Ceos 4 - -4 Ceol 4 - -4 CMup 4 - -4 SOs 5 - -5 SOn 5 - -5 CMrc 9 - -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-14fbsplash: reinstate drawing of over/undersized images; shrinkDenys Vlasenko
Based on the patch by Nuno Lucas <ntlucas@gmail.com> function old new delta fbsplash_main 938 864 -74 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-09compat and warning fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-15libbb: added xfdopen_for_read/writeDenys Vlasenko
function old new delta xfdopen_helper - 40 +40 logdir_open 1163 1184 +21 process_stdin 433 443 +10 xfdopen_for_write - 9 +9 doCommands 2465 2474 +9 patch_main 1214 1222 +8 bbunpack 457 465 +8 xfdopen_for_read - 7 +7 scan_tree 258 262 +4 xstrtoul_range_sfx 230 231 +1 sendmail_main 957 955 -2 passwd_main 1027 1023 -4 parse 969 964 -5 test_main 253 247 -6 sed_main 655 649 -6 dos2unix_main 437 429 -8 fbsplash_main 950 938 -12 handle_dir_common 371 354 -17 expand_vars_to_list 2197 2169 -28 update_passwd 1275 1246 -29 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 7/10 up/down: 117/-117) Total: 0 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-07fbsplash: allow compressed image filesVladimir Dronnikov
Signed-off-by: Vladimir Dronnikov <dronnikov@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-06*: use {i,u}toa() where appropriateDenys Vlasenko
function old new delta startservice 377 363 -14 setari_u 54 40 -14 ash_main 1375 1361 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-42) Total: -42 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-02-18- bail out if screen resolution does not match PPM dimensions.Bernhard Reutner-Fischer
Previously a 640x480 PPM on an e.g. 720x400 console would just segfault when reading the lines. While this bug should perhaps be fixed to handle such cases properly we just exit gracefully until somebody is willing to take care of it properly.
2009-02-18- document ppm header and skip whitespaceBernhard Reutner-Fischer
2009-02-16- PPMs can have comments in the header.Bernhard Reutner-Fischer
Thanks to Denys for pointing that out. (~+7b)
2009-02-14- misc untested shrinkage:Bernhard Reutner-Fischer
$ ./scripts/bloat-o-meter _bb_un.oorig busybox_unstripped function old new delta fbsplash_main 595 985 +390 fb_drawimage 493 - -493 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 390/-493) Total: -103 bytes $ size miscutils/fbsplash.o* text data bss dec hex filename 2019 0 0 2019 7e3 miscutils/fbsplash.o.oorig 1857 0 0 1857 741 miscutils/fbsplash.o.new
2009-01-27- update Michele addressBernhard Reutner-Fischer
2008-07-26fix several problems with config parser:Denis Vlasenko
a bug where it underflows the string a bug where it never frees parser_t struct make read_config() return 0 if parser is NULL, make config_close() accept and ignore NULL parser - eliminates many if() blocks reverse the sense of parser bit flags - negative flags are harder to grok. hexdump: revert the change to use config parser, it is BIGGER and also requires additional quirks in parser *: explicitly use PARSER_NORMAL instead of 0 function old new delta login_main 1575 1596 +21 config_close 18 29 +11 bbunpack 383 391 +8 qgravechar 106 109 +3 rtnl_tab_initialize 121 117 -4 expand 1697 1693 -4 man_main 717 712 -5 nameif_main 674 668 -6 hexdump_main 597 591 -6 read_config 217 209 -8 dnsd_main 1478 1470 -8 sysctl_main 203 189 -14 config_open2 44 25 -19 make_device 1177 1141 -36 config_read 597 549 -48 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/11 up/down: 43/-158) Total: -115 bytes
2008-07-24*: conversion to config parserDenis Vlasenko
function old new delta config_read 540 597 +57 config_open2 41 44 +3 rtnl_rtprot_initialize 70 66 -4 rtnl_rttable_initialize 78 73 -5 rtnl_rtscope_initialize 88 83 -5 rtnl_rtrealm_initialize 48 43 -5 rtnl_rtdsfield_initialize 48 43 -5 process_module 566 560 -6 bbunpack 391 383 -8 rtnl_tab_initialize 279 121 -158 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/8 up/down: 60/-196) Total: -136 bytes
2008-07-21libbb: [x]fopen_for_{read,write} introduced and used.Denis Vlasenko
(by Valdimir) function old new delta config_open2 - 41 +41 config_read 507 542 +35 find_pair 169 187 +18 fopen_for_write - 14 +14 fopen_for_read - 14 +14 find_main 406 418 +12 xfopen_for_write - 10 +10 xfopen_for_read - 10 +10 popstring 134 140 +6 parse_inittab 396 401 +5 next_token 923 928 +5 pack_gzip 1659 1661 +2 bb__parsespent 117 119 +2 fallbackSort 1719 1717 -2 evalvar 1376 1374 -2 qrealloc 36 33 -3 ... ... ... ... singlemount 4579 4569 -10 process_stdin 443 433 -10 patch_main 1111 1101 -10 ifupdown_main 2175 2165 -10 file_action_grep 90 80 -10 uuidcache_init 649 637 -12 hush_main 797 785 -12 read_config 230 217 -13 dpkg_main 3835 3820 -15 read_line_input 3134 3110 -24 sysctl_main 232 203 -29 config_open 40 10 -30 WARN_BAD_LINE 44 - -44 login_main 1714 1575 -139 ------------------------------------------------------------------------------ (add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737) Total: -563 bytes
2008-07-05*: rename ATTRIBUTE_XXX to just XXX.Denis Vlasenko
2008-06-25whitespace fixes. no code changesDenis Vlasenko
2008-04-22whitespace fixes. no code changesDenis Vlasenko
2008-04-04fbsplash: more compact support for named pipes + EOF scenarioDenis Vlasenko
function old new delta fbsplash_main 1121 1043 -78
2008-03-28fbsplash: move to /sbin; small shrinkDenis Vlasenko
function old new delta fb_drawprogressbar 413 423 +10 fbsplash_main 1146 1121 -25
2008-03-27fbsplash: support this usage:Denis Vlasenko
mkfifo cmd_pipe fbsplash -f cmd_pipe .... & ... echo 33 >cmd_pipe ... echo 66 >cmd_pipe Code size: fbsplash_main +116 bytes :(
2008-03-26fbsplash: fix broken handling of buffered case:Denis Vlasenko
"{echo 45; echo 33; } | { sleep 1; fbsplash -f - ...; }" function old new delta fb_drawprogressbar - 413 +413 xmalloc_fgetline - 46 +46 xmalloc_reads 184 183 -1 xmalloc_getline 46 - -46 fbsplash_main 1472 1030 -442 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 0/2 up/down: 459/-489) Total: -30 bytes text data bss dec hex filename 801181 641 7380 809202 c58f2 busybox_old 801151 641 7380 809172 c58d4 busybox_unstripped
2008-03-26fbsplash: cosmetic comment and Config text fixes; rename .ini -> .cfgDenis Vlasenko
2008-03-26fbsplash: shrink, better help text; inifile cannot specify image now;Denis Vlasenko
image can come from stdin function old new delta packed_usage 23872 23932 +60 static.param_names - 57 +57 fbsplash_main 1525 1472 -53 static.param_value 100 - -100 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/1 up/down: 117/-153) Total: -36 bytes text data bss dec hex filename 801202 641 7380 809223 c5907 busybox_old 801181 641 7380 809202 c58f2 busybox_unstripped