diff options
author | Jonathan Bauer | 2020-07-31 17:41:08 +0200 |
---|---|---|
committer | Jonathan Bauer | 2020-07-31 17:41:08 +0200 |
commit | 43183623f824de88932be1ace50a4b7544550826 (patch) | |
tree | a370ae56291b58e4b9f0e68cc6069e228f5960d8 /core/modules/busybox | |
parent | [vbox-src] Disable cloud gateway network bullshit (diff) | |
download | mltk-43183623f824de88932be1ace50a4b7544550826.tar.gz mltk-43183623f824de88932be1ace50a4b7544550826.tar.xz mltk-43183623f824de88932be1ace50a4b7544550826.zip |
[busybox] update to 1.32.0
TODO:
* fix rtcwake patch, currently not applied in module.build
* refine fbsplash.cfg sanity checks when determining sizes of
screen/image
Diffstat (limited to 'core/modules/busybox')
-rw-r--r-- | core/modules/busybox/fbsplash-center.patch | 85 | ||||
-rw-r--r-- | core/modules/busybox/fbsplash-fillbg.patch | 50 | ||||
-rw-r--r-- | core/modules/busybox/module.build | 12 | ||||
-rw-r--r-- | core/modules/busybox/module.conf | 2 |
4 files changed, 38 insertions, 111 deletions
diff --git a/core/modules/busybox/fbsplash-center.patch b/core/modules/busybox/fbsplash-center.patch deleted file mode 100644 index 748420fd..00000000 --- a/core/modules/busybox/fbsplash-center.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c -index 7b695b2..e3a55ca 100644 ---- a/miscutils/fbsplash.c -+++ b/miscutils/fbsplash.c -@@ -9,6 +9,7 @@ - * - put somewhere fbsplash.cfg file and an image in .ppm format. - * - run applet: $ setsid fbsplash [params] & - * -c: hide cursor -+ * -x: center image (if smaller than screen) - * -d /dev/fbN: framebuffer device (if not /dev/fb0) - * -s path_to_image_file (can be "-" for stdin) - * -i path_to_cfg_file -@@ -22,10 +23,11 @@ - */ - - //usage:#define fbsplash_trivial_usage --//usage: "-s IMGFILE [-c] [-d DEV] [-i INIFILE] [-f CMD]" -+//usage: "-s IMGFILE [-c] [-x] [-d DEV] [-i INIFILE] [-f CMD]" - //usage:#define fbsplash_full_usage "\n\n" - //usage: " -s Image" - //usage: "\n -c Hide cursor" -+//usage: "\n -x Center image (if smaller than screen)" - //usage: "\n -d Framebuffer device (default /dev/fb0)" - //usage: "\n -i Config file (var=value):" - //usage: "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT" -@@ -54,6 +56,7 @@ struct globals { - unsigned red_shift; - unsigned green_shift; - unsigned blue_shift; -+ bool bcenter_image; - }; - #define G (*ptr_to_globals) - #define INIT_G() do { \ -@@ -349,6 +352,8 @@ static void fb_drawimage(void) - char *read_ptr; - unsigned char *pixline; - unsigned i, j, width, height, line_size; -+ int xoffset = 0; -+ int yoffset = 0; - - if (LONE_DASH(G.image_filename)) { - theme_file = stdin; -@@ -396,6 +401,13 @@ static void fb_drawimage(void) - line_size = width*3; - pixline = xmalloc(line_size); - -+ if (G.bcenter_image) { -+ if (width < G.scr_var.xres) -+ xoffset = ((G.scr_var.xres - width) / 2) * G.bytes_per_pixel; -+ if (height < G.scr_var.yres) -+ yoffset = (G.scr_var.yres - height) / 2; -+ } -+ - if (width > G.scr_var.xres) - width = G.scr_var.xres; - if (height > G.scr_var.yres) -@@ -407,7 +419,7 @@ static void fb_drawimage(void) - if (fread(pixline, 1, line_size, theme_file) != line_size) - bb_error_msg_and_die("bad PPM file '%s'", G.image_filename); - pixel = pixline; -- src = G.addr + j * G.scr_fix.line_length; -+ src = G.addr + (j + yoffset) * G.scr_fix.line_length + xoffset; - for (i = 0; i < width; i++) { - unsigned thispix = fb_pixel_value(pixel[0], pixel[1], pixel[2]); - fb_write_pixel(src, thispix); -@@ -463,6 +475,7 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) - FILE *fp = fp; // for compiler - char *num_buf; - unsigned num; -+ unsigned optret; - bool bCursorOff; - - INIT_G(); -@@ -471,8 +484,10 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) - fb_device = "/dev/fb0"; - cfg_filename = NULL; - fifo_filename = NULL; -- bCursorOff = 1 & getopt32(argv, "cs:d:i:f:", -+ optret = getopt32(argv, "cxs:d:i:f:", - &G.image_filename, &fb_device, &cfg_filename, &fifo_filename); -+ bCursorOff = 1 & optret; -+ G.bcenter_image = 2 & optret; - - // parse configuration file - if (cfg_filename) diff --git a/core/modules/busybox/fbsplash-fillbg.patch b/core/modules/busybox/fbsplash-fillbg.patch index 51695ba7..8c8af905 100644 --- a/core/modules/busybox/fbsplash-fillbg.patch +++ b/core/modules/busybox/fbsplash-fillbg.patch @@ -1,30 +1,37 @@ diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c -index e3a55ca..daea60d 100644 +index 1419578..e920c06 100644 --- a/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c -@@ -23,11 +23,12 @@ - */ +@@ -9,6 +9,7 @@ + * - put somewhere fbsplash.cfg file and an image in .ppm format. + * - run applet: $ setsid fbsplash [params] & + * -c: hide cursor ++ * -b: fill background with the color of top left pixel of image + * -d /dev/fbN: framebuffer device (if not /dev/fb0) + * -s path_to_image_file (can be "-" for stdin) + * -i path_to_cfg_file +@@ -47,10 +48,11 @@ + //kbuild:lib-$(CONFIG_FBSPLASH) += fbsplash.o //usage:#define fbsplash_trivial_usage --//usage: "-s IMGFILE [-c] [-x] [-d DEV] [-i INIFILE] [-f CMD]" -+//usage: "-s IMGFILE [-c] [-x] [-b] [-d DEV] [-i INIFILE] [-f CMD]" +-//usage: "-s IMGFILE [-c] [-d DEV] [-i INIFILE] [-f CMD]" ++//usage: "-s IMGFILE [-c] [-b] [-d DEV] [-i INIFILE] [-f CMD]" //usage:#define fbsplash_full_usage "\n\n" //usage: " -s Image" //usage: "\n -c Hide cursor" - //usage: "\n -x Center image (if smaller than screen)" +//usage: "\n -b Fill background with color of top left pixel of image" //usage: "\n -d Framebuffer device (default /dev/fb0)" //usage: "\n -i Config file (var=value):" //usage: "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT" -@@ -57,6 +58,7 @@ struct globals { +@@ -82,6 +84,7 @@ struct globals { + unsigned red_shift; unsigned green_shift; unsigned blue_shift; - bool bcenter_image; + bool bfill_background; }; #define G (*ptr_to_globals) #define INIT_G() do { \ -@@ -342,6 +344,23 @@ static void fb_drawprogressbar(unsigned percent) +@@ -369,6 +372,23 @@ static void fb_drawprogressbar(unsigned percent) G.nbar_colr, G.nbar_colg, G.nbar_colb); } @@ -48,27 +55,34 @@ index e3a55ca..daea60d 100644 /** * Draw image from PPM file -@@ -420,6 +439,10 @@ static void fb_drawimage(void) +@@ -440,6 +460,10 @@ static void fb_drawimage(void) bb_error_msg_and_die("bad PPM file '%s'", G.image_filename); pixel = pixline; - src = G.addr + (j + yoffset) * G.scr_fix.line_length + xoffset; + src = G.addr + (G.img_posy + j) * G.scr_fix.line_length + G.img_posx * G.bytes_per_pixel; + + if (G.bfill_background && j == 0) -+ fb_fillbackground(pixel, xoffset / G.bytes_per_pixel, yoffset, width, height); ++ fb_fillbackground(pixel, G.img_posx, G.img_posy, width, height); + for (i = 0; i < width; i++) { unsigned thispix = fb_pixel_value(pixel[0], pixel[1], pixel[2]); fb_write_pixel(src, thispix); -@@ -484,10 +507,11 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) +@@ -496,6 +520,7 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) + FILE *fp = fp; // for compiler + char *num_buf; + unsigned num; ++ unsigned optret; + bool bCursorOff; + + INIT_G(); +@@ -504,8 +529,10 @@ int fbsplash_main(int argc UNUSED_PARAM, char **argv) fb_device = "/dev/fb0"; cfg_filename = NULL; fifo_filename = NULL; -- optret = getopt32(argv, "cxs:d:i:f:", -+ optret = getopt32(argv, "cxbs:d:i:f:", +- bCursorOff = 1 & getopt32(argv, "cs:d:i:f:", ++ optret = getopt32(argv, "cbs:d:i:f:", &G.image_filename, &fb_device, &cfg_filename, &fifo_filename); - bCursorOff = 1 & optret; - G.bcenter_image = 2 & optret; -+ G.bfill_background = 4 & optret; ++ bCursorOff = 1 & optret; ++ G.bfill_background = 2 & optret; // parse configuration file if (cfg_filename) diff --git a/core/modules/busybox/module.build b/core/modules/busybox/module.build index a6954efd..fe02a6f3 100644 --- a/core/modules/busybox/module.build +++ b/core/modules/busybox/module.build @@ -5,16 +5,14 @@ fetch_source() { git clone --depth 1 "${REQUIRED_GIT}" --branch "$REQUIRED_BRANCH" src || perror "Could not clone busybox git" fi cde src - # Patch image centering and background filling if not patched yet - if ! grep -q "bcenter_image" "miscutils/fbsplash.c"; then - git apply "${MODULE_DIR}/fbsplash-center.patch" || perror "Could not apply busybox patch for fbsplash image centering" - fi + # Patch background filling if not patched yet if ! grep -q "bfill_background" "miscutils/fbsplash.c"; then git apply "${MODULE_DIR}/fbsplash-fillbg.patch" || perror "Could not apply busybox patch for fbsplash background filling" fi - if ! grep -q 'suspend.*"no"' "util-linux/rtcwake.c"; then - git apply "${MODULE_DIR}/rtcwake-compat.patch" || perror "Could not apply busybox patch for rtcwake compat with util-linux" - fi + # TODO fix this patch + #if ! grep -q 'suspend.*"no"' "util-linux/rtcwake.c"; then + # git apply "${MODULE_DIR}/rtcwake-compat.patch" || perror "Could not apply busybox patch for rtcwake compat with util-linux" + #fi # make sure Makefile allows a preset CC if [ -n "$CC" ]; then sed -i -r 's/^CC\s*=\s*(\S)/CC ?= \1/' Makefile || perror "Could not patch Makefile" diff --git a/core/modules/busybox/module.conf b/core/modules/busybox/module.conf index cdd45a18..ac606abe 100644 --- a/core/modules/busybox/module.conf +++ b/core/modules/busybox/module.conf @@ -1,6 +1,6 @@ #!/bin/bash REQUIRED_GIT="git://git.busybox.net/busybox" -REQUIRED_BRANCH="1_25_1" +REQUIRED_BRANCH="1_32_0" REQUIRED_BINARIES="busybox" REQUIRED_DIRECTORIES=" /bin |