@@ -403,6 +403,47 @@ var amazonlinux = &PlatformResolver{
403403 },
404404}
405405
406+ var bottlerocket = & PlatformResolver {
407+ Name : "bottlerocket" ,
408+ IsFamily : false ,
409+ Detect : func (r * PlatformResolver , pf * inventory.Platform , conn shared.Connection ) (bool , error ) {
410+ f , err := conn .FileSystem ().Open ("/etc/bottlerocket-release" )
411+ if err != nil {
412+ return false , nil
413+ }
414+ defer f .Close ()
415+
416+ c , err := io .ReadAll (f )
417+ if err != nil || len (c ) == 0 {
418+ log .Debug ().Err (err )
419+ return false , nil
420+ }
421+
422+ content := strings .TrimSpace (string (c ))
423+ osr , err := ParseOsRelease (content )
424+ if err != nil || osr ["ID" ] != "bottlerocket" {
425+ return false , nil
426+ }
427+
428+ if len (osr ["ID" ]) > 0 {
429+ pf .Name = osr ["ID" ]
430+ }
431+
432+ if len (osr ["PRETTY_NAME" ]) > 0 {
433+ pf .Title = osr ["PRETTY_NAME" ]
434+ }
435+ if len (osr ["VERSION_ID" ]) > 0 {
436+ pf .Version = osr ["VERSION_ID" ]
437+ }
438+
439+ if len (osr ["BUILD_ID" ]) > 0 {
440+ pf .Build = osr ["BUILD_ID" ]
441+ }
442+
443+ return false , nil
444+ },
445+ }
446+
406447var windriver = & PlatformResolver {
407448 Name : "wrlinux" ,
408449 IsFamily : false ,
@@ -936,7 +977,7 @@ var eulerFamily = &PlatformResolver{
936977var linuxFamily = & PlatformResolver {
937978 Name : inventory .FAMILY_LINUX ,
938979 IsFamily : true ,
939- Children : []* PlatformResolver {archFamily , redhatFamily , debianFamily , suseFamily , eulerFamily , amazonlinux , alpine , gentoo , busybox , photon , windriver , openwrt , ubios , plcnext , mageia , defaultLinux },
980+ Children : []* PlatformResolver {archFamily , redhatFamily , debianFamily , suseFamily , eulerFamily , bottlerocket , amazonlinux , alpine , gentoo , busybox , photon , windriver , openwrt , ubios , plcnext , mageia , defaultLinux },
940981 Detect : func (r * PlatformResolver , pf * inventory.Platform , conn shared.Connection ) (bool , error ) {
941982 detected := false
942983 osrd := NewOSReleaseDetector (conn )
0 commit comments