Bug 145485

Summary: How to detect a laptop?
Product: [openSUSE] SUSE Linux 10.1 Reporter: Martin Vidner <mvidner>
Component: YaST2Assignee: Steffen Winterfeldt <snwint>
Status: RESOLVED FIXED QA Contact: Klaus Kämpf <kkaempf>
Severity: Normal    
Priority: P5 - None    
Version: Beta 2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Martin Vidner 2006-01-25 13:52:36 UTC
For SL, NetworkManager should be enabled by default if the machine is a laptop. What method should I use to detect it? Currently I use hd_has_pcmcia, but Stano told me HAL should have something better(?). Can you advise me?
Comment 1 Steffen Winterfeldt 2006-01-25 15:36:57 UTC
libhd 11.36 implements feature 100199. It reports the formfactor in
the system record. In C it looks like:

hd_t *hd;
sys_info_t *st;
char *form;

hd = hd_list(hd_data, hw_sys, 1, NULL);
if(
  hd->detail && hd->detail->type == hd_detail_sys &&
  (st = hd->detail->sys.data)
) {
  form = st->formfactor;
}


yast already gets hw_sys for other things, you probably just have to make
the formfactor field known to it.

Note: formfactor is NULL if HAL says 'unknown'.

Hm, made it libhd 12.0 now. After all it's an api change.
Comment 2 Martin Vidner 2006-01-25 17:31:02 UTC
Thanks.
Submitted yast2-hardware-detection-2.13.2. yast2-network-2.13.20 will use it.