File: chkboot-testing-lib

package info (click to toggle)
chkboot 1.3-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 288 kB
  • sloc: sh: 267; makefile: 31
file content (20 lines) | stat: -rw-r--r-- 606 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
setup_chkboot() {
    echo "probing testing environment"
    mountpoint="/boot"
    partition="$(findmnt --noheadings --target "${boot}" --output SOURCE)"
    disk="$(lsblk --paths -noheadings --output pkname "${partition}")"

    echo " mountpoint: ${mountpoint}"
    echo " partition: ${partition}"
    echo " disk: ${disk}"

    echo "adjusting configuration file"
    sed -e "s@^\\(BOOTDIR\\)=.*@\\1=${mountpoint}@g" \
        -e "s@^\\(BOOTPART\\)=.*@\\1=${partition}@g" \
        -e "s@^\\(BOOTDISK\\)=.*@\\1=${disk}@g" \
        -i "/etc/default/chkboot"

    chkboot -u

    echo "ready to test"
}