File size: 1,122 Bytes
94e70c3
f647d54
94e70c3
 
 
f647d54
 
 
 
 
 
 
 
 
 
 
 
 
94e70c3
f647d54
 
 
 
 
 
 
 
 
 
 
 
 
94e70c3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Setup script to initialize power profile to balanced mode

echo "Setting up power profile test environment..."

# Check if powerprofilesctl is available
if command -v powerprofilesctl &> /dev/null; then
    echo "Using powerprofilesctl..."
    powerprofilesctl set balanced
    current_profile=$(powerprofilesctl get)
    echo "Current power profile: $current_profile"
    
    if [ "$current_profile" = "balanced" ]; then
        echo "Setup completed successfully - power profile set to balanced"
    else
        echo "Setup failed - could not set power profile to balanced"
        exit 1
    fi
else
    echo "powerprofilesctl not available, trying alternative methods..."
    
    # Try using cpupower if available
    if command -v cpupower &> /dev/null; then
        echo "Using cpupower..."
        cpupower frequency-set -g conservative
        echo "Set CPU governor to conservative (power-saving mode)"
    else
        echo "No power management tools available"
        echo "This is a simulation - assuming balanced mode is set"
    fi
    
    echo "Setup completed (using available tools)"
fi