Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade busybox to 1.32 #900

Merged
merged 1 commit into from
Dec 30, 2020
Merged

Upgrade busybox to 1.32 #900

merged 1 commit into from
Dec 30, 2020

Conversation

tlaurion
Copy link
Collaborator

Borrowed from #893

per @daym request to build easier under guix. Should pass CI, let's see.

@tlaurion tlaurion changed the title Upgrade busybox to 1.32 per Upgrade busybox to 1.32 Nov 15, 2020
@tlaurion
Copy link
Collaborator Author

No idea why CircleCI is not triggering.
Build happening here nonetheless for 5be4816 : https://app.circleci.com/pipelines/github/tlaurion/heads/608/workflows/4b5290b1-283d-4662-a0b7-1a70595f4a0d/jobs/656

@paulmenzel
Copy link
Contributor

Please amend the commit message to list the BusyBox configuration changes like CONFIG_PRINTF.

Please also note the resulting size changes.

Also, I do not understand the Guix reference.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Nov 15, 2020

@paulmenzel good points.

Please amend the commit message to list the BusyBox configuration changes like CONFIG_PRINTF.

Will do. Trace:

+CONFIG_STACK_OPTIMIZATION_386=y
+CONFIG_FLOAT_DURATION=y
+CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS=y
+CONFIG_FEATURE_EDITING_WINCH=y
+CONFIG_BZIP2_SMALL=8
+CONFIG_FEATURE_CP_REFLINK=y
+CONFIG_MKTEMP=y
+CONFIG_PRINTF=y
+CONFIG_SYNC=y
+CONFIG_FEATURE_SYNC_FANCY=y
+CONFIG_CMP=y
+CONFIG_DIFF=y
+CONFIG_PATCH=y
+CONFIG_FEATURE_FIND_EXECUTABLE=y
+CONFIG_FEATURE_FIND_QUIT=y
+CONFIG_FEATURE_FIND_EMPTY=y
+CONFIG_FEATURE_GPT_LABEL=y
+CONFIG_MKFS_VFAT=y
+CONFIG_DC=y
+CONFIG_FEATURE_LESS_RAW=y
+CONFIG_FEATURE_LESS_ENV=y
+CONFIG_FEATURE_NSLOOKUP_BIG=y
+CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y
+CONFIG_FEATURE_NTP_AUTH=y
+CONFIG_FEATURE_TFTP_HPA_COMPAT=y
+CONFIG_PIDOF=y
+CONFIG_FEATURE_PIDOF_SINGLE=y
+CONFIG_FEATURE_PIDOF_OMIT=y
+CONFIG_SHELL_ASH=y
+CONFIG_ASH_BASH_NOT_FOUND_HOOK=y
+CONFIG_FEATURE_SH_MATH_BASE=y
+CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS=y

Please also note the resulting size changes.

Following guidelines for size comparizon.

  • Download initird.cpio.xz, note size
  • extract content
  • compare busybox binary size
  • compare increase of initrd.cpio.xz size (ROM footprint change)

From master build : busybox 1.28 x230 board's initrd.cpio.xz:

user@x230-master:~/test_master$ wget https://655-103208611-gh.circle-artifacts.com/0/build/x230/initrd.cpio.xz
--2020-11-15 17:14:37--  https://655-103208611-gh.circle-artifacts.com/0/build/x230/initrd.cpio.xz
Resolving 655-103208611-gh.circle-artifacts.com (655-103208611-gh.circle-artifacts.com)... 3.220.126.117
Connecting to 655-103208611-gh.circle-artifacts.com (655-103208611-gh.circle-artifacts.com)|3.220.126.117|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://circle-production-customer-artifacts.s3.amazonaws.com/picard/5c5246504bd4750001b16ef9/5faed744db5fba0057c3a8e0-0-build/artifacts/build/x230/initrd.cpio.xz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20201115T221439Z&X-Amz-SignedHeaders=host&X-Amz-Expires=60&X-Amz-Credential=AKIAJR3Q6CR467H7Z55A%2F20201115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=a325879da81771afba29866cceb51fb3898f93ab4d679d1cf431196354abd238 [following]
--2020-11-15 17:14:38--  https://circle-production-customer-artifacts.s3.amazonaws.com/picard/5c5246504bd4750001b16ef9/5faed744db5fba0057c3a8e0-0-build/artifacts/build/x230/initrd.cpio.xz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20201115T221439Z&X-Amz-SignedHeaders=host&X-Amz-Expires=60&X-Amz-Credential=AKIAJR3Q6CR467H7Z55A%2F20201115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=a325879da81771afba29866cceb51fb3898f93ab4d679d1cf431196354abd238
Resolving circle-production-customer-artifacts.s3.amazonaws.com (circle-production-customer-artifacts.s3.amazonaws.com)... 52.217.39.4
Connecting to circle-production-customer-artifacts.s3.amazonaws.com (circle-production-customer-artifacts.s3.amazonaws.com)|52.217.39.4|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3838976 (3.7M) [application/x-xz]
Saving to: ‘initrd.cpio.xz’

initrd.cpio.xz                        100%[=======================================================================>]   3.66M   476KB/s    in 7.7s    

2020-11-15 17:14:48 (489 KB/s) - ‘initrd.cpio.xz’ saved [3838976/3838976]

user@x230-master:~/test_master$ xz -d initrd.cpio.xz ; cpio -i < initrd.cpio
cpio: dev/console: Cannot mknod: Operation not permitted
22199 blocks
user@x230-master:~/test_master$ find . -type f -ls | sort -r -n -k7 |grep -v cpio
   316821   1592 -rwx------   1 user     user      1627856 Nov 15 17:14 ./bin/lvm
  1592608   1136 -rwx------   1 user     user      1160520 Nov 15 17:14 ./lib/libgcrypt.so.20
   316780    896 -rwx------   1 user     user       915328 Nov 15 17:14 ./bin/gpg
  1592605    740 -rwx------   1 user     user       757232 Nov 15 17:14 ./lib/libcairo.so.2
  1592615    652 -rwx------   1 user     user       666216 Nov 15 17:14 ./lib/libpixman-1.so.0
   316774    584 -rwx------   1 user     user       597112 Nov 15 17:14 ./bin/flashrom
  1592604    584 -rwx------   1 user     user       596544 Nov 15 17:14 ./lib/libc.so
   316741    472 -rwx------   1 user     user       483160 Nov 15 17:14 ./bin/busybox

From this PR build: busybox 1.32 x230 board's initrd.cpio.xz artifact


user@x230-master:~/test_busybox-1_32$ wget https://656-103208611-gh.circle-artifacts.com/0/build/x230/initrd.cpio.xz
--2020-11-15 17:04:53--  https://656-103208611-gh.circle-artifacts.com/0/build/x230/initrd.cpio.xz
Resolving 656-103208611-gh.circle-artifacts.com (656-103208611-gh.circle-artifacts.com)... 3.220.126.117
Connecting to 656-103208611-gh.circle-artifacts.com (656-103208611-gh.circle-artifacts.com)|3.220.126.117|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://circle-production-customer-artifacts.s3.amazonaws.com/picard/5c5246504bd4750001b16ef9/5fb0adf11db0124ba913682b-0-build/artifacts/build/x230/initrd.cpio.xz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20201115T220455Z&X-Amz-SignedHeaders=host&X-Amz-Expires=60&X-Amz-Credential=AKIAJR3Q6CR467H7Z55A%2F20201115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=ab40008ab34101d9753c4d4718a59e9f2299c40ccae86efa681884bf6cbac01b [following]
--2020-11-15 17:04:54--  https://circle-production-customer-artifacts.s3.amazonaws.com/picard/5c5246504bd4750001b16ef9/5fb0adf11db0124ba913682b-0-build/artifacts/build/x230/initrd.cpio.xz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20201115T220455Z&X-Amz-SignedHeaders=host&X-Amz-Expires=60&X-Amz-Credential=AKIAJR3Q6CR467H7Z55A%2F20201115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=ab40008ab34101d9753c4d4718a59e9f2299c40ccae86efa681884bf6cbac01b
Resolving circle-production-customer-artifacts.s3.amazonaws.com (circle-production-customer-artifacts.s3.amazonaws.com)... 52.216.27.100
Connecting to circle-production-customer-artifacts.s3.amazonaws.com (circle-production-customer-artifacts.s3.amazonaws.com)|52.216.27.100|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3853312 (3.7M) [application/x-xz]
Saving to: ‘initrd.cpio.xz’

initrd.cpio.xz                        100%[=======================================================================>]   3.67M   546KB/s    in 8.3s    

2020-11-15 17:05:04 (455 KB/s) - ‘initrd.cpio.xz’ saved [3853312/3853312]

user@x230-master:~/test_busybox-1_32$ xz -d initrd.cpio.xz ; cpio -i < initrd.cpio
cpio: dev/console: Cannot mknod: Operation not permitted
22249 blocks
user@x230-master:~/test_busybox-1_32$ find . -type f -ls | sort -r -n -k7 |grep -v cpio
  1592419   1592 -rwx------   1 user     user      1627856 Nov 15 17:05 ./bin/lvm
  1592541   1136 -rwx------   1 user     user      1160520 Nov 15 17:05 ./lib/libgcrypt.so.20
  1592378    896 -rwx------   1 user     user       915328 Nov 15 17:05 ./bin/gpg
  1592538    740 -rwx------   1 user     user       757232 Nov 15 17:05 ./lib/libcairo.so.2
  1592548    652 -rwx------   1 user     user       666216 Nov 15 17:05 ./lib/libpixman-1.so.0
  1592367    584 -rwx------   1 user     user       597112 Nov 15 17:05 ./bin/flashrom
  1592537    584 -rwx------   1 user     user       596544 Nov 15 17:05 ./lib/libc.so
  1592332    496 -rwx------   1 user     user       507776 Nov 15 17:05 ./bin/busybox

Notes:
Net increase of 24kB for busybox binary:

  • busybox 1.28 : 484kB
  • busybox 1.32: 508kB

Increase of 15kB of needed BIOS region space:

  • ROM's initrd.cpio.xz with busybox 1.28: 3839kB
  • ROM's initrd.cpio.xz with busybox 1.32: 3854kB

Also, I do not understand the Guix reference.

@paulmenzel :
@daym said on slack that building for busybox 1.28 from guix builder's PoC (attempted replacement of musl-cross-make to have reproducible builds from guix added layer to any OS, cachable in CIs) was problematic for 1.28. I invite him to detail here, or on another issue, the current progress and blockers.

I just took what @osresearch added under #893 here, since those busybox changes were required by him in his TPM2 (swtpm dependencies for qemu's board run Makefile statement) to be able to have a software TPM so that qemu builds become more useable (and for safeboot's board addition here.)

@tlaurion
Copy link
Collaborator Author

tlaurion commented Dec 5, 2020

#590 (comment) has a used compressed used/free space comparison.

This commit changes x230 board's used compressed space from 6851524 -> 6863812 (out of 7mb)
Coherent reduction of free available space being 143768 -> 131480 before saturation (out of 7mb)

@tlaurion
Copy link
Collaborator Author

@MrChromebox

@MrChromebox
Copy link
Contributor

doesn't appear to break anything here

+CONFIG_STACK_OPTIMIZATION_386=y
+CONFIG_FLOAT_DURATION=y
+CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS=y
+CONFIG_FEATURE_EDITING_WINCH=y
+CONFIG_BZIP2_SMALL=8
+CONFIG_FEATURE_CP_REFLINK=y
+CONFIG_MKTEMP=y
+CONFIG_PRINTF=y
+CONFIG_SYNC=y
+CONFIG_FEATURE_SYNC_FANCY=y
+CONFIG_CMP=y
+CONFIG_DIFF=y
+CONFIG_PATCH=y
+CONFIG_FEATURE_FIND_EXECUTABLE=y
+CONFIG_FEATURE_FIND_QUIT=y
+CONFIG_FEATURE_FIND_EMPTY=y
+CONFIG_FEATURE_GPT_LABEL=y
+CONFIG_MKFS_VFAT=y
+CONFIG_DC=y
+CONFIG_FEATURE_LESS_RAW=y
+CONFIG_FEATURE_LESS_ENV=y
+CONFIG_FEATURE_NSLOOKUP_BIG=y
+CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y
+CONFIG_FEATURE_NTP_AUTH=y
+CONFIG_FEATURE_TFTP_HPA_COMPAT=y
+CONFIG_PIDOF=y
+CONFIG_FEATURE_PIDOF_SINGLE=y
+CONFIG_FEATURE_PIDOF_OMIT=y
+CONFIG_SHELL_ASH=y
+CONFIG_ASH_BASH_NOT_FOUND_HOOK=y
+CONFIG_FEATURE_SH_MATH_BASE=y
+CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS=y

This commit changes used compressed space from 6851524 -> 6863812.
Coherent reduction of free available space being 143768 -> 131480 before saturation.

Net increase of 24kB for busybox binary:

    busybox 1.28 : 484kB
    busybox 1.32: 508kB

Increase of 15kB of needed BIOS region space:

    ROM's initrd.cpio.xz with busybox 1.28: 3839kB
    ROM's initrd.cpio.xz with busybox 1.32: 3854kB
@tlaurion
Copy link
Collaborator Author

rebased. Rebuilding. Will merge #938 #900 and #932 when this is successful.

@Thrilleratplay
Copy link
Contributor

@tlaurion Can #909 also be merged along with #938 #900 and #932

@tlaurion tlaurion merged commit 4addeab into linuxboot:master Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants