Recommended Posts

But if the drive is blank ^ then it won't detect an EFI table because the disk won't have one :/.

hmm, good point. I'm not too sure on that one. I found a small tidbit here:

Access to UEFI Runtime services is provided by "efivars" kernel module which is enabled through the CONFIG_EFI_VAR=m kernel config option. This module once loaded exposes the variables under the directory /sys/firmware/efi/vars. One way to check whether the system has booted in UEFI boot mode is to load the "efivars" kernel module and check for the existence of /sys/firmware/efi/vars directory with contents similar to :

So in theory, one could just do:

modprobe efivars && ls /sys/firmware/efi/vars

I've rewritten most of the code I was using to play around with reading partition tables so that it's more structured. The figures seem to be coming out right now, on my system at least. It's still somewhat buggy and I haven't tested it thoroughly, but if you want to play around with it, I've attached the code.

post-429662-0-72300800-1350242493_thumb.

disks.zip

The program needs to be run as a super user ( sudo ) if you wish to see the 'used' statistic of unmounted file systems. It temporarily mounts them if they aren't already mounted and registered in /etc/mtab.

Some outstanding problems:

1. The gtk widget I created for visualising the disk layout isn't perfect. Specifically, I need to fix the way it allocates space for each volume. Currently it runs out of space quickly. Perhaps I need to loop through the volumes and adjust the spacing before I do the actual rendering, but I'll try and fix that later.

2. I had a real hassle trying to programmatically mount the block device file systems so I could get statistics via statvfs (). Specifically, the mount () function requires file system specific esoteric arguments that I just couldn't get to work ( as of yet ), so for now I'm just calling out to the shell's mount command. It's not ideal, but it works.

Again, there are bugs, and the code is messy in parts. To compile you'll need your distro's gtk3 dev package. On arch, it's just extra/gtk3. On Ubuntu/Mint/others it's probably libgtk-3-dev or something like similar. Obviously, you'll need gcc/pkg-config installed as normal.

When I have more time, I'll fix the outstanding bugs.

That looks beautiful! Nice work! :D

Only problem with it is that it needs GTK3, and PHP-GTK is GTK2 only :(

EDIT: Ah you've done it as C... Guess we could run that seperately somehow and output a command list the installer could read?

Edited by n_K

That looks beautiful! Nice work! :D

Only problem with it is that it needs GTK3, and PHP-GTK is GTK2 only :(

Thanks. It's a start at least.

As far as gtk goes, it's easy enough to convert it to gtk2. The only major changes needed to convert it revolve around:

PRIVATE void
disk_layout_class_init ( DiskLayoutClass *in )
{
	GtkWidgetClass *base;

	base = GTK_WIDGET_CLASS ( in );
	base->draw  = disk_layout_draw;

	g_type_class_add_private ( in, sizeof ( disk_info ) );
}

Just change the 'base->draw' override to 'base->expose_event'. There are a few other minor changes like retrieving the widget's allocation, and container v/h boxes.

EDIT: Ah you've done it as C... Guess we could run that seperately somehow and output a command list the installer could read?

The code is quite modular. You could stick some of it ( block_dev.c, partition.c, fs.c ) into a shared library and call it from php perhaps. Or as you say, run it separately. The code I have here already prints the tables to stdout, so I suppose you could redirect that or parse it in some way.

The widget could easily be implemented in php I would think.

Edit: The same information can probably be obtained from /proc/partitions and /sys/block if you prefer the directory iteration / parsing static text files route. I opted for reading the partition tables directly from the block devices just to see if I could do it ;). I get the list of block devices from /sys/block myself.

I've fixed the widget problem (mostly). As I thought, it was as simple as reserving space for each volume:

post-429662-0-84184100-1350303874.png

PRIVATE int
disk_layout_calc_reserved ( PartitionTable * t )
{
	Partition *p;
	int	   res = 0;

	p = NULL;
	while ( NULL != ( p = LIST_ITER ( t, p ) ) )
		res += VOLUME_LINE_WIDTH + VOLUME_SPACING;

	res += VOLUME_SPACING;
	return res;	
} 
...
PRIVATE gboolean
disk_layout_draw ( GtkWidget *layout, cairo_t *cr )
...
geometry.width -= disk_layout_calc_reserved ( info->table ); 

There might be an easier or better way of doing it without pre-calculating space to reserve, but I haven't thought of one yet, so this will do for now.

  • Like 3
  • 2 weeks later...
  • 2 weeks later...

OK so I just quickly added the PHP-GD code to the installer code (after compiling php-gd twice!) and made it change the first image to see if it'd work. It did! So then I got it working via a GDKPixBuf using a GD image instead of having to save the file at all, so it's pretty nifty!

look in to the https://gitorious.org/chakra/tribe it the Chakra installer witch is a arch based distro witch you might be able to make use of

b

im just saying use the installer code and use gnome if you want

No, it's been discussed and it'd be pointless, might as well just use their distro if that's all we were doing. And having GTK3 and QT on an installer ISO would make it massive for no real reason and confuse people.

Installer's still at the same progress as it was, don't really have the time to work on it much now plus the update has borked this arch OS so I can't startx to run things on the VM remotely for testing so until arch bucks up and I get more free time it's completely stale.

Yeah you're missing the point, why just stick that on arch, make an ISO and distribute it? There's nothing to be learnt by doing that, anyone can do it. Making a GUI etc. is all experience and gets you up to scratch with the base of the OS.

  • 9 months later...
This topic is now closed to further replies.
  • Posts

    • If they ever come out and say the AI is no longer accessible to the gen pop people aren't going to know how to tie their own shoelaces.
    • It's hard not to when they are shoehorning Ai into EVERYTHING. Some are active users by choice, I bet a lot of them are because it's shoved in their face the entire time.
    • Thunderbird 152.0 by Razvan Serea Thunderbird is a free, open-source, cross-platform application for managing email and news feeds. It is a local (rather than a web-based) email application that is powerful yet easy-to-use. Thunderbird is clean and elegant by default, but easily customizable to match your workflow and visual preferences. It is loaded with unique and powerful features. Thunderbird is developed, tested, translated and supported by the folks at Mozilla Corporation and by a group of dedicated volunteers. Thunderbird gives you control and ownership over your email. There are lots of add-ons available for Thunderbird that enable you to extend and customize your email experience. Thunderbird gives you IMAP/POP support, a built-in RSS reader, support for HTML mail, powerful quick search, saved search folders, advanced message filtering, message grouping, labels, return receipts, smart address book LDAP address completion, import tools, and the ability to manage multiple e-mail and newsgroup accounts. Thunderbird 152.0 changelog: SecurityDevices enabled in enterprise policies One-click account setup for Thundermail accounts What’s Changed Use 'Add' instead of 'New' for account, calendar, address book creation buttons GMail OAuth updated to use PKCE Mail server hostname also checked when detecting address books and calendars Updated about:rights to replace local with hosted url 'Hide completed tasks' now also hides cancelled tasks What’s Fixed New mail alerts appeared on wrong monitor in three-monitor setup Spam messages triggered new mail notifications before being moved to Spam folder Filtered IMAP or NNTP subscriptions were lost after closing Subscribe dialog 'Download Headers' dialog for newsgroups failed to open Messages nested deeper than 255 levels disappeared from threading view Performing Delete followed by Undo on thread parent message could corrupt view Single messages still appeared collapsible after thread members were deleted Updated threads remained misordered until folder refresh or resort Non-threaded subject sorting separated 'RE:' replies from original messages BCC recipients were included in signed email headers Filter search on Body missed draft messages containing German umlauts Thunderbird could crash during local message search Blocked file warning showed without 'Unblock File' button in compose window Forwarding/Redirecting Exchange messages failed with NS_ERROR_OUT_OF_MEMORY Compose window closed early and send progress dialog hung after NNTP failure Compose window stayed open after sending when mailnews.sendInBackground set Microsoft OAuth2 failed when HTTPS localhost redirect was not intercepted Pasting contact photos stopped working when photo button had focus Filter dialog lacked focus ring and had poorly distinguishable buttons Subfolder kept stale accessibility unread count after unread messages were deleted 'Edit as New Message' and inline 'Forward' not possible with PGP-signed messages Various MIME improvements EWS messages could go missing from folder view IMAP "Show only subscribed folders" could not be changed without restart Unable to delete more than 1000 messages at a time on Microsoft 365 EWS folders in Trash were moved to Trash again instead of being hard deleted IMAP notifications repeated for emails read on another device after sleep wake POP3 deadlocked when server went silent without closing socket Calendar acceptance no longer distinguished between single occurrence and series Transparent popups on macOS made calendar event editing difficult Duplicate attendees were added to invitations instead of being filtered out Task percentage complete was not preserved separately from status in tooltips Visual and UX improvements Security fixes Download: Thunderbird 152.0 for Windows (EN/US) | 32-bit | ~70.0 MB (Open Source) Download: Thunderbird 152.0 for Mac OS (EN/US) | 145.0 MB Download: Thunderbird 152.0 in other languages View: Thunderbird Website | Screenshot | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Nearly half of American adults now use AI, but concerns are also growing by Hamid Ganji Since the launch of ChatGPT in 2022, the way people research, get their news, and perform routine tasks has changed dramatically. Now, almost everything around us has a touch of AI, and companies are trying to embed it into nearly every product and service they offer. With that in mind, new research shows how Americans are actually adopting this change and using AI in their everyday lives. According to new research conducted by the Pew Research Center, 49% of American adults now use AI chatbots like ChatGPT or Gemini. This marks a significant increase over last year, when only 33% of American adults reported using AI. Additionally, four in ten U.S. adults (42%) said they use AI tools to research information, while 38% said they use these tools to handle tasks at work. Entertainment, image and video editing, and getting medical advice are among the other ways Americans are using AI. Moreover, ChatGPT dominates the U.S. AI market, with 44% of respondents saying they use OpenAI's chatbot. Gemini follows at 24%, while Copilot and Meta AI account for 17% and 14%, respectively. Respondents also said that AI chatbots generally have a positive impact on their productivity and how informed they are. But when it comes to AI’s impact on society, Americans remain largely skeptical. About 40% of American adults believe AI will be more harmful than beneficial to society over the next 20 years. Additionally, 31% expect AI to have a negative effect on them personally. Another 31% of respondents say AI could be equally positive and negative. As for data security, pessimism remains high: 71% of respondents say AI will make their personal information less secure, while only 3% believe it will make their data more secure. American adults also largely lack confidence in both the government and AI companies when it comes to regulating and developing AI. About 67% of Americans have little to no confidence in the U.S. government’s ability to regulate AI effectively. Six in ten adults are also not confident that U.S. companies will develop and use these tools responsibly.
    • MultiOS-USB 0.11.1 by Razvan Serea MultiOS-USB is a versatile, open-source utility designed to create multiboot USB drives capable of hosting multiple operating systems on a single portable device. The project simplifies the process of building a bootable USB by automating the configuration of various boot loaders and file systems, enabling users to install and run diverse operating systems, including Windows, Linux distributions, and diagnostic tools, directly from one drive. It supports ISO booting and persistence, which allows changes made during live sessions to be retained, making it ideal for testing, troubleshooting, or system recovery. Features: BIOS and UEFI support Secure Boot support (boot, manage uefi keys) Load UEFI drivers Launch .efi executables and other boot loaders Boot Linux from .iso images Boot WinPE from bootable .wim images Boot Windows 10/11 installer from ISO (currently, SB must be disabled during installation) Boot Linux installer from network (experimental) Boot locally installed systems: Linux, Windows Automatically update configuration files Without background services exFAT file system support Automatic detection of compatible ISO images (GRUB loopback) Support for systems without loopback support Allows customisation of ISO boot menu (for example: custom kernel options) Support for USB, SSD, nvme, mmcblk, loop, nbd and virtual disks Support for x86, x86_64 A list of tested ISO images can be found here MultiOS-USB 0.11.1 changelog: 68122b7: Fixed-release AUR package #63 fba0283: Update shim to 16.1 8c2ae95: Update grub to v2.14-1 ea15c1d: Update Memtest86+ to v8.10 162f4e6: Add secureblue (#71) b2da8ae: Add AerynOS (#74) ac6640e: Bump config.version 34e9ca6: Add Bluefin (#72) 7a10edd: Add Aurora (#66) cab701b: Update wimboot to v2.9.0-1 90da7f7: Fix Windows error: 0x80070001 - 0x4002F (#52) 2dea73d: Add Microsoft certificates 01f479e: Remove old efi_uga module Download: MultiOS-USB 0.11.1 | 5.3 MB (Open Source) View: MultiOS-USB Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      Vincian earned a badge
      One Month Later
    • First Post
      Jocimo earned a badge
      First Post
    • Week One Done
      suprememobiles48 earned a badge
      Week One Done
    • One Month Later
      Windows Guy earned a badge
      One Month Later
    • One Month Later
      Prasann earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      509
    2. 2
      +Edouard
      172
    3. 3
      PsYcHoKiLLa
      90
    4. 4
      Steven P.
      76
    5. 5
      neufuse
      69
  • Tell a friend

    Love Neowin? Tell a friend!