Skip to content

Commit 0b8f9bf

Browse files
committed
allow system to be considered as laptop
set LAPTOP=1 or to a specific supported model to enable laptop mode. The smbios entries for that model have to be in dmidata. Use dmidata/dump to dump the smbios on a physical machine.
1 parent 0c97ea2 commit 0b8f9bf

File tree

6 files changed

+17
-0
lines changed

6 files changed

+17
-0
lines changed

bmwqemu.pm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ $ENV{QEMUPORT}||=15222;
101101
$ENV{INSTLANG}||="en_US";
102102
$ENV{CASEDIR}||="$scriptdir/distri/$ENV{DISTRI}" if $ENV{DISTRI};
103103
if(defined($ENV{DISTRI}) && $ENV{DISTRI} eq 'archlinux') {$ENV{HDDMODEL}="ide";}
104+
105+
if ($ENV{LAPTOP}) {
106+
$ENV{LAPTOP} = 'dell_e6330' if $ENV{LAPTOP} = '1';
107+
die "no dmi data for '$ENV{LAPTOP}'\n" unless -d "$scriptdir/dmidata/$ENV{LAPTOP}";
108+
$ENV{LAPTOP} = "$scriptdir/dmidata/$ENV{LAPTOP}";
109+
}
110+
104111
## env vars end
105112

106113
## keyboard cmd vars

dmidata/dell_e6330/smbios_type_1.bin

63 Bytes
Binary file not shown.

dmidata/dell_e6330/smbios_type_2.bin

63 Bytes
Binary file not shown.

dmidata/dell_e6330/smbios_type_3.bin

67 Bytes
Binary file not shown.

dmidata/dump

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
for i in 1 2 3; do
3+
dmidecode -t $i -u | grep $'^\t\t[^"]' | xargs -n1 | perl -lne 'printf "%c", hex($_)' > smbios_type_$i.bin
4+
done

inst/startqemu.pm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ if($self->{'pid'}==0) {
8585
}
8686
}
8787

88+
if ($ENV{LAPTOP}) {
89+
for my $f (<$ENV{LAPTOP}/*.bin>) {
90+
push @params, '-smbios', "file=$f";
91+
}
92+
}
93+
8894
for my $i (1..$ENV{NUMDISKS}) {
8995
my $boot="";#$i==1?",boot=on":""; # workaround bnc#696890
9096
push(@params, "-drive", "file=$basedir/l$i,cache=unsafe,if=$ENV{HDDMODEL}$boot");

0 commit comments

Comments
 (0)