-
Notifications
You must be signed in to change notification settings - Fork 324
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
resize x86 rootfs to 36 MB and kernel to 16 MB #1814
Conversation
256MB isn't enough anymore since Gluon v2017.1 has been released in 2017, see the note in its release notes: |
just 2 notes: (this is not a statement for or against the proposal)
|
@rotanid: The Release Notes state that more than 273 MB disk size are needed. There is no explanation why. Can you state why such big disks are needed?
|
@@ -12,3 +12,6 @@ packages 'kmod-ath9k' | |||
packages $ATH10K_PACKAGES | |||
packages 'kmod-gpio-button-hotplug' 'kmod-gpio-nct5104d' 'kmod-hwmon-core' 'kmod-leds-gpio' 'kmod-leds-apu2' 'kmod-sp5100_tco' | |||
packages 'kmod-usb-core' 'kmod-usb-ohci' 'kmod-usb2' 'kmod-usb3' 'kmod-usb-serial' | |||
|
|||
config 'CONFIG_TARGET_KERNEL_PARTSIZE=16' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
16 is already the default. Why setting it explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Maybe not to be surprised from upstream changes to partition layout? I am fine either way, though.
no i can't, as i didn't commit related changes, i can only quote from existing docs.
one version later? please check again or explain |
The increased image size was introduced by upstream commit a1f83bad606411a561e8e60110c71232b1a28aa2. However, no rationale is given on why this change is needed. Maybe someone who's more involved in OpenWRT development knows. Then, later it was increased to 2 GiB to allow online resizing. After that, they reverted back to 256 MB. In master, however, they have now switched to 128 MB.
For now, Freifunk Stuttgart maintains their own fork of Gluon just to keep 256 MB Futros we might have alive (difficult to see how many of these we have, though). I'd like to avoid having to maintain this fork for a long time. If you say squashfs will also solve the problem (don't know myself tbh as filesystem IMO doesn't have anything to do with partition size, does it?), I'm also fine maintaining this fork for v2018.2.x and then abandoning it when we switch to v2019.x. |
thank you for your analysis. maybe we should switch the value from OpenWrt Master then instead of reducing it as much as you propose? either way, as you said yourself we need someone else to think about this, e.g. neoraider or blocktrron. |
256 MB is very uncommen for x86 targets. There are other Devices than Futros and all Futros I know have at least 1 GB Flash. Would it be possible to offer an x86-tiny image for this special usecase? |
I have no in depth knowledge about the x86 Image generation, however 36M Rootfs size might clash with GLUON_DEBUG. There were Futros with 256M CF card in circulation, however these should all be very old models from around 2004. We've only seen them on old Geodes and Transmetas. I would keep the value close to upstream. I've not yet heard of communities which accidentally killed a lot of devices with this update. Another point is that x86 is very hard to predict hardware-wise. So it always has a higher chance of breaking on updates. |
we (@mweinelt ) discussed this topic on IRC yesterday and thought if we change it, we should use something more meaningful, at least can't make sense of 36+16 (this PR) or 128+16 (openwrt master) |
I would suggest to use 111+16 (to leave some space for bootloader and alignment) or even 110+16 (no idea how much space is reserved for the bootloader?). But I don't really want to discuss this in Gluon - we should just use the defaults from OpenWrt, and discuss changes upstream. |
9f82767
to
0bdc5bf
Compare
Changed to 110+16 for now. I think we only need to reserve space for the MBR. The first-stage bootloader is then stored in the MBR and contains the offset to the second-stage bootloader in the partition itself. I will also submit this change upstream. |
This will allow x86 devices with 128 MB disk to upgrade.
0bdc5bf
to
ca79d5f
Compare
We need to confirm that the generated images are actually smaller than a 128MB card. As @T-X pointed out in IRC, an (arbitrarily chosen) 256MB card had only 254,435,328 bytes, making the actual limit for the image size ~242MiB (in units of 1024). I assume it will be similar for 128MB cards. Also, I have no idea where grub-mkimage puts the second stage - the only sane option is to add it between the MBR and the first partition, so it would need to be considered for the full image size, but I'm not sure if the image generation code is sane ;) In any case, making a test build and checking the size of the generated image is the best way to find out if the size is correct. |
Is there a reason for the filesystem to have a specific size? Wouldn't it be optimal to generate the image with as little padding as possible, and then resize the filesystem to fill the drive after installing? |
@kpanic23 Sure, theoretically possible (and what OpenEmbedded does by default), but I don't see why we should put much effort into implementing that - the current solution works well enough IMO. |
what does this mean, we don't do anything in Gluon until upstream changes its defaults again? |
I can take care of proposing a patch upstream (I did a few tests and ended up with 16+104 MiB to make it fit a 128MB CF card). I wouldn't change anything downstream for now - after all, this issue existed for several Gluon versions, so I don't see a reason to hurry. |
Pushed to OpenWrt master in https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=61c57af618e264e9ed3ebd795eb923cbf32797c8, so we will get the change with OpenWrt 19.07 + 1. |
Is there anythin speaking against backporting this change? I've talked to @nrbffs and it would greatly simplify upgrading the Gluon version from 2016.2 to the upcoming Gluon Release for their x86 nodes. |
I guess there is no harm in backporting this change. |
By default, OpenWRT 18.06 uses 256 MB rootfs and 16 MB kernel partition size, see
config/Config-images.in
:This will result in an image larger than 256 MB. However, some x86 devices such as Futros will have just a 256 MB CF card and thus won't be able to upgrade (in my observations).
To resolve, make kernel and rootfs as small as possible for x86, allowing x86 devices with 256 MB disk to upgrade.