Saturday, September 4, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to get the current local networks public facing IP address while connected to a vpn, using the terminal?

Posted: 04 Sep 2021 10:15 AM PDT

Is there a command or file in Linux from which I can retrieve the currently connected networks public facing IP address while I am connected to a vpn? Reason I ask is because I would like for curl wttr.in to retrieve the weather information based on my current location and not the location of the vpn server I am connected to. I have a script which runs in the background that retrieves the weather for whichever location I am in at the time and saves that information to a temporary file in which another script reads from. Like so.

  #!/bin/sh    while true; do        [ ! -f /tmp/weather_report.tmp ] && touch /tmp/weather_report.tmp        curl "wttr.in?format=%C+%t" > /tmp/weather_report.tmp \      || echo "..." > /tmp/weather_report.tmp        sleep 300    done  

Marking multiple lines in ed

Posted: 04 Sep 2021 10:08 AM PDT

I've opened ed and inserted the following text:

This text  Is a  Test  

However, when I attempt to mark lines 1-3 using the following command:

1,3ki  

And print them with

'ip  

It only prints the last occurence. Is there a way I can mark all three line (i.e. 1,3)? Much appreciated.

Can not install any linux distros

Posted: 04 Sep 2021 09:47 AM PDT

I can not install any linux distros on my old pc despite having easily install 2 times on my Win 10 PC. I am using Win XP 32 bit 2.82GHz Dual Core CPU, 1.99GB RAM. I have tried many instructions, watching countless videos, reading answers from forums for a month and still doesn't work it keeps going from problem to problem: rufus and etcher doesnt support, burn device not found on CDBurner XP, I also use Linux Live USB Creator but after a while it seems to work just like instructed and then nothing happen :(( I dont know what to do. Plan to throw my computer :< Btw, sorry for my English

Can you expand (execute) function inline with bash to use the result for another command's argument?

Posted: 04 Sep 2021 09:46 AM PDT

I'm making some simple logging tools to use for work and i have a niche problem that i'm trying to solve when typing commands in a shell. I want to, as smoothly as possible, use a function's result for the argument of another command, all while keeping it inline. For example:

sudo some-command --output "<my-function>_log.txt"    <tab><tab> =>  sudo some-command --output "2021_project_a_log.txt"  

I want to expand, or rather execute, my-function while writing some-command. The double tab is just to get the use across, that's what i mean by "inline" but i might be misusing that term. I don't want to split the command, i.e. execute my-function, store the variable or use the stdout, and then type some-command. The functions print meta data basically such as project name, timestamps etc. I will use them to name and store the output from various commands and tools.

These are the ways i've found so far that works:

  • I can write "`my-function`_log.txt"
  • I can write "$(my-function)_log.txt"

These two can then either be used as is (in which case i cannot check them first) or i can use the shortcut Ctrl + Alt + E to use shell-expand-line to expand them but this has the following problems that i try to get around:

  • All functions (OK) and all aliases (not OK) are expanded
  • Quotes are removed and since i will be using this type of expansion for string input that can break things

I don't want to expand all aliases as some of them can be long and unnecessary which will clutter the prompt.

Question:

Is there a way to expand, such as with Ctrl + Alt + E, only the selected function or the function that's under the cursor or something? Alternatively, can i block certain aliases from being expanded?

Thanks!

I can't install cgpt in Arch Linux using Pacman, what to do?

Posted: 04 Sep 2021 09:45 AM PDT

I've been unable to install cgpt in Arch linux.

I don't know what it is, but it's a dependency.

Here is the output of my Terminal:

# pacman -S cgpt  error: target not found: cgpt  # cgpt  -bash: cgpt: command not found  

How to get pacman to work?

Searching "error: target not found: cgpt" with brackets on Google doesn't give results, showing this is very unique.

Ubuntu 20.04 will not boot on Dell Inspiron 3891

Posted: 04 Sep 2021 10:17 AM PDT

I have failed at installing Ubuntu. I don't know where I went wrong. I'm not very experienced in Linux and I'm sure I've made a simple mistake. Here's the situation.

When I power up the computer, I see the Dell logo and then nothing. The screen is clearly backlit, but it is black. Nothing further happens.

When I power up the computer and hold down Shift, I get the same result.

When I power up the computer and tap F12, I can get to the BIOS (version 1.0.14). I can choose my boot order. I can point towards the drive with Ubuntu on it. I even have a selection called Ubuntu. It doesn't matter which of these I choose, the result is the same.

There are no other operating systems installed on this computer. The OS I did attempt to install was Ubuntu 20.04 LTS. It was working a few days ago, but then I tried to update the firmware to 1.0.14. It said it was successful, but then I ran into this problem.

If I put in the boot flash drive and choose it as a boot option, I will get apparent success. The installation GUI shows up. It says it works. I get the message that Installation is complete and that I should reboot. When it tells me to take the boot drive out, I do so.

The machine is a Dell Inspiron 3891 Intel Core i5-11400. Brand new, straight out of the box. I have made no changes to the insides of this machine.

I tried installing Ubuntu to the 256 GB SSD. I tried installing to the 1TB HDD. Same result.

About two days into this troubleshooting process, I lost my temper and starting reformatting everything. In retrospect, maybe this was not the best move.

I tried booting off the boot flash drive and running boot-repair.

If I power the machine while tapping Esc, I do get GNU GRUB version 2.04. However, nothing seems to work from here. I found instructions that said I should type C at this point, but I got error: can't find command 'C'.

I've run the Dell SupportAssist On-Board Diagnostics. It says all tests passed successfully.

Yesterday I found an Ubuntu website that displays all the "Ubuntu certified hardware". It lists the Dell Inspiron Core i7 and the Core i9, but it does not list the Core i5-11400. I would give up at this point, but I did see it work at least once. My initial attempt worked great. I only ran into trouble when I tried to update the firmware. I KNOW this system can run this OS.

I tried downgrading the BIOS to 1.0.13. This did not help. I tried downgrading to BIOS 1.0.12 and I got an error that this downgrade was not supported. I verified in the BIOS setup that BIOS downgrade is allowed, but it won't allow this. I don't know what BIOS was active when I first bought the machine, I didn't think to look.

I originally burned the flash drive with ubuntu-20.04.2.0-desktop-amd64.iso with balenaEtcher using the default settings. I then tried the same ISO but using Rufus 3.13.1730, and burning the image as a dd. Its interesting that I get a little farther witih this. I can install the OS and then it will boot to the text screen that lets me choose Ubuntu, but then it dies immediately afterwards. It dies in the same fashion - backlight is on and slightly flickering, otherwise featureless black screen.

Last night I noticed that Ubuntu now has 20.04.3. I tried downloading that ISO and burning it to my flash drive as a dd using my Rufus software. This flash drive won't even allow me to install. I can get into the BIOS and choose the flash drive as the boot medium, but when it tries to boot from the flash drive I get the same freeze. Dell logo nice and clear, then freeze on a backlit black screen. I did verify the checksum for this iso.

There's no urgency to this question. I am taking a Linux class, but this problem has nothing to do with that class. I'm doing this for the learning experience. Well, that's not exactly true. I started this project for the learning experience. Now I'm refusing to give up out of sheer stubbornness.

I'm lost. I don't know where to go from here. Can anyone offer advice please?

Updated to add: I tried removing the CMOS battery to set the nvram back to factory defaults. I don't think it worked. When I powered the machine back on. I did get an error that the time was not set. However, the BIOS still had SATA set to AHCI and SecureBoot was still off. I am positive that when I first got this machine, SATA was set to RAID and SecureBoot was on.

Wi-Fi isn't working on HP 15s-eq2055

Posted: 04 Sep 2021 09:30 AM PDT

I installed Manjaro Linux GNOME version on my laptop and everything is okay except the wifi settings. Manjaro tells me that I don't have a Wi-Fi adapter. I didn't find any drivers for that problem on HP`s site.enter image description here

Reading in shell scripting without waiting to hit enter

Posted: 04 Sep 2021 10:25 AM PDT

I'm working on a small bash script, and it essentially will just do two things. Execute two update commands together, and list keybinds. In the same way, for example, chmod +x would work, using +x as a variable. The way I'd like it is if I entered bash filename.sh -Y, I would get the keybinds I needed, and if I replaced -Y with -X, I would have my two update commands running. How would I do this?

Edit; I forgot to mention this, but it honestly doesn't matter if the variable has a hyphen in it. What I mean by the title of the post is, how do I use the -Y in bash filename.sh -Y without having to hit enter first? Here's the script I'm currently using.

#!/bin/sh    read var    if [ var == upd ]  then       sudo pacman -Syyu; yay -Syu  fi  

This works perfectly fine when I input upd after pressing enter after running bash filename.sh. How would I get the same input with bash filename.sh upd?

How to permanently allow use of port 81?

Posted: 04 Sep 2021 08:48 AM PDT

I am using a VPS on nginx ubuntu and I am hosting two different files on default port (80) and the port 81.

The problem is that I ALWAYS have to run this command below before making the port 81 useable

sudo iptables -A INPUT -p tcp --dport 81 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT  

So if the VPS reboot I would no be able to access the server that is hosted on 81.

If someone could help me with that, thank you :)

Mount a detected but not listed in disks list SD card

Posted: 04 Sep 2021 07:25 AM PDT

My problem is a bit complicated to describe knowing that I'm not really a passionate about partitioning, but here's what I'm trying to do, What I tried and what doesn't work :

Goal

My goal is to simply mount and reset my micro-sd card. It putted it in a micro-sd to sd adapater (female micro-sd/male sd) in order to access it from my laptop. It's not an OS problem, as I have similar problems on my other PC with this micro-sd card, and it's not the adapter, I have tried with a micro-sd to usb-A adapter.

What I tried and doesn't work (and why)

Linux (Fedora)

GUI-based programs

GNOME File Explorer

My SD card isn't listed.

GNOME disk software

In the disk selection, my micro-sd card appears. I can select it, and formatting operation are visibles. But when I try to format it, the following error is displayed : udisk-error-quark, 0. Performance tests returns an error too.

Gparted

When launching gparted, I can see that informations about my sd card are loaded (and are surprisingly long) in the footer, but it just doesn't appears in the disk list at all.

Raspberry Pi Imager

I know this isn't the best solution, but I tried to install raspbian using the raspberry pi imager, just to see. The SD card is listed, and I can click on the install button. the loading starts and progresses without problems, but when it reaches 99%, the following error is displayed : write error in storage (error during fsync execution)

CLI-based programs

fdisk

When I run fdisk -l without sudo permissions, I can see my sd card listed, with the mention permission not granted, like the other disks. But when I run it with the sudo permissions, There is no mention of my sd card at all.

Windows 10 (not really relevant here but maybe it can help you to understand where the problem is)

GUI-based programs

File Explorer

my SD card isn't listed.

Disk Manager

if my SD card is connected, the loading is infinite and the program does not respond.

Peripherals and printers/peripherals manager (configuration pannel)

my SD card is listed, but I can't do anything on it. In the peripherals manager, when I go in the properties on my card, then go to 'details' it crashes. when I go to 'Volumes' and try to 'populate', it crashes. In Peripherals and printers, it crashes when I try to display the properties.

third-party softwares (like EASEUS partition manager)

my SD card isn't listed

Raspberry Pi Imager

My SD card isn't listed, or it's listed for some obscure reason, and when I try to install raspbian, the load remains stuck at preparing to write (opening drive)

CLI-based programs

diskpart, get-volume, ...

if my SD card is connected, the loading is infinite.

fsutils, get-psdrive, ...

my Sd card isn't listed.

Android

I tried to put my sd card on an android smartphone, then go to storage, and then reset it. It aborted and displayed the following toast notification : command '10 volume partition disk: 179:192 public' failed with '400 10 Command failed'

Apparition of the problem

I simply tried to reset my SD card using the dedicated tool in the raspberry pi imager (windows). It kept getting stuck at the first step, something like "preparing to reset", so I clicked cancel after a while, the cancel succeded without any problem. That's all. The SD card didn't have any problem or something.

Conclusion

As you can see, I tried a lot of different things. My SD card is detected, but I can do nothing on it at all. I really have no idea where the problem is, and how to repair it. Thanks in advance for your help.

MBR converted to GPT based system, how to boot Linux and Windows

Posted: 04 Sep 2021 07:04 AM PDT

How to boot GPT based system to Linux and Windows? This is not a question of starting from a fresh GPT based system, but starting from a MBR converted to GPT based system.

My Asus laptop initial setup,

  • I disabled the Secure Boot Control, and
  • I enabled [Launch CSM] (Compatibility Support Module)
  • I partitioned my HD using MBR
  • All my systems on my Asus laptop were boot from such BIOS/MBR/CSM mode, including Win8 and all my Linux

However, I found that my USB is booted only in EFI style, and Windows 10 is refusing to be installed to my BIOS/MBR/CSM mode system when my USB is booted in EFI style.

So I converted my MBR disk to GPT, and of course, as Krunal warned, such practice ruined my system boot, and I need make everything bootable again.

Alright, so now is my question.

  • In BIOS/MBR/CSM mode, I have an active MBR partition, all my systems were boot from it (using extlinux), including Win8 and all my Linux.
  • In GPT mode, however, this is where the problem begins for me.

So I basically don't know which way to go, and don't want to further mess up with my already-messed-up and unbootable system.

So clear instructions on how to boot Linux (and Windows) from such environment is really appreciated. Thanks.

Deja-dup/Duplicity GPG error

Posted: 04 Sep 2021 06:53 AM PDT

Preparing for a distro change, I made a backup using deja-dup, and verified I could access de backed up files. After installing a new distro alongside the original one, I still could access and restore them. However, after I wiped my computer and did a fresh install, an error started appearing after trying to restore the files.

===== Begin GnuPG log =====  gpg: [don't know]: invalid packet (ctb=00)  ===== End GnuPG log =====  

This message appears on either deja-dup or duplicity CLI.

The output of duplicity collection-status is

Last full backup date: Thu Sep  2 12:18:18 2021  Collection Status  -----------------  Connecting with backend: BackendWrapper  Archive dir: /home/bs/.cache/duplicity/db7c0f583d45b95c45d4d76e12d54364    Found 0 secondary backup chains.    Found primary backup chain with matching signature chain:  -------------------------  Chain start time: Thu Sep  2 12:18:18 2021  Chain end time: Thu Sep  2 12:18:18 2021  Number of contained backup sets: 1  Total number of contained volumes: 272   Type of backup set:                            Time:      Num volumes:                  Full         Thu Sep  2 12:18:18 2021               272  -------------------------  No orphaned or incomplete backup sets found.  

I've looked around everywhere but found no solution to my problem. Can anyone help me recover my files?

PS: I also have a copy of the backup stored on Google Drive, but deja-dup can't "see" it, when it searches for the files it just creates an empty folder with the same name as the one I entered and finds no files.

How to listen the requests sent to a unix socket

Posted: 04 Sep 2021 06:44 AM PDT

I'm learning docker and wanted to see the API commands sent by the client to the docker server/engine. I know that the communication between the two processes happens via /var/run/docker.sock. Is there a way to check what commands are being sent via the socket to the server?

Linux showkey utility inside a bash script not returning data

Posted: 04 Sep 2021 07:39 AM PDT

I am bit puzzled, when I run this showkey -a command on shell, the command is run and I can interact with it in realtime.

See below

timeout 10 /usr/bin/showkey -a    Press any keys - Ctrl-D will terminate this program    t   116 0164 0x74  a    97 0141 0x61  s   115 0163 0x73  d   100 0144 0x64  f   102 0146 0x66  g   103 0147 0x67  j   106 0152 0x6a  f   102 0146 0x66  k   107 0153 0x6b  l   108 0154 0x6c  d   100 0144 0x64  

Now when I add this command in a shell script, I do not see any output, or in other words I cannot interact with script or command that is run inside the script.

Here is my bash script.

#!/bin/bash  timeout 10 /usr/bin/showkey -a  exit 0  

When I run this script, it waits for 10 seconds and exit to the shell. How can I make it show keys pressed, codes and interact with the user.

The reason I want this because the script has to execute many tasks before coming to keyboard testing and after keyboard test there are various other tasks that the scripts performs. I couldn't find any answers anywhere, so as a last resort I had to ask this question here. I hope someone can help.

Align numeric values to the right (recfmt output)

Posted: 04 Sep 2021 06:40 AM PDT

I'm making a Unix database in a plain text with GNU Recutils. With the following script I get a books list of a selected category:

recsel -t book -e "Category='$1'" "$RECFILE" | recfmt -f bycat.templ  

The output is the following:

1: Book title  2: Book title  55: Book title  128: Book title  

The file bycat.templ has the following content:

{{Id}}: {{Title}} (read: {{Read}})  

It seems it's impossible to define the alignment to the right side from this file, according to the manual.

So I try to find a Unix solution, probably using printf, awk, xargs or perhaps a for bucle for every line. I don't know how to achieve this.

The desired output:

  1: Book title    2: Book title   55: Book title  128: Book title  

OpenJFX instead OpenJDK

Posted: 04 Sep 2021 06:05 AM PDT

System: Debian 11, 5.10.0-8-amd64

I have installed OpenJFX package in purpose to use it instead of OpenJDK. Typing "java --version":

openjdk 11.0.12 2021-07-20  OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2)  OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing)  

I would like to use openjfx but how to replace it? OpenJFX is localisated in /usr/share/openjfx/lib. Thanks you.

How to make a link to have the same timestamp as the target file

Posted: 04 Sep 2021 10:13 AM PDT

Suppose you have file file with a given mtime. If I create a symlink sym pointing to file via ln -s the symlink itself gets a mtime-stamp that corresponds to the time where the symlink was created which is not the same as the mtime of file.

So is there a way to create a symlink such that it has the same mtime as the file it is pointing to?

The background to this question is this script, where a directory of links to the n newest files of a cloud mirror is created. Now if I do for example ls -lt in this current directory, it doesn't show me the dates where the actual files were created but when the symlinks were created. But I want to see the files creation date.

Edit In my original post I erroneously asked for ctime (I changed it above), however the question should be about mtime. Thanks to @ilkkachu indicating this.

Two keyboard keys are reporting the same scancode

Posted: 04 Sep 2021 08:15 AM PDT

I have an HP 15-da1071ne, I'm trying to remap the brightness up/down keys. The issue is that these two keys report the same scancode:

0xe0 0x54 0xe0 0xd4  

Edit: I am running Pop OS 21.04, kernel 5.11. I used showkey --scancodes to get these codes, also evtest reports same output for these 2 keys. Is there a solution for this issue or only a complaint to HP?

iptables not allowing and tcpdump is not reporting traffic from IP

Posted: 04 Sep 2021 09:33 AM PDT

I constructed a very simple set of iptables rules that block all traffic except from a single IP address:

*filter  :INPUT ACCEPT [0:0]  :FORWARD ACCEPT [0:0]  :OUTPUT ACCEPT [0:0]  -A INPUT -s 192.185.195.89 -m comment --comment "TEST" -j ACCEPT  -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT  -A INPUT -i lo -j ACCEPT  -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j DROP  -A INPUT -j REJECT --reject-with icmp-host-prohibited  -A FORWARD -j REJECT --reject-with icmp-host-prohibited  COMMIT  

When iptables is stopped I can SSH into the server and I can see the connection attempt using tcpdump. When iptables is started, I get a "Could not connect to server" error. Most confusingly, I don't see my connection attempts anymore with tcpdump.

Can anyone give me some insight into what could be causing this? Thanks.

Potential Reach of Windows Malware via Wine and Mono

Posted: 04 Sep 2021 07:47 AM PDT

Scenario: I have a desktop Ubuntu 21.04 system with Wine and Mono installed. The only program I run on Wine is VisiPics, a Windows photo comparison tool. VisiPics needs read-write access to the external drive on which those photo files are stored, so as to delete unwanted duplicates.

My question is, to what extent do Wine and/or Mono pose security risks in that scenario?

Certain comments contribute to my confusion:

  • Is it only a question of what software I deliberately use? Some consider Wine and Mono intrinsically risky, regardless of what software I run. It is reported that "malware can be delivered in many ways" and that WannaCry (for example) has a "worm aspect." So could malware find its own way to my Linux system from an infected file on the external drive, as soon as I make that drive available to the system?
  • How great is the threat level, in practical terms? Some say that "your Linux computer is completely safe with WINE" unless you use it to run infected software. Others claim that malware will face so many complexities, in Wine, that it is unlikely to get far. Yet researchers warn that "Wine can pose serious security implications when used to run Windows software in a Linux environment."
  • Is it likely that, if the user can access the external data drive with VisiPics, Windows malware running on Wine can too?
  • Regardless of whether a generic Linux installation needs antivirus software, shouldn't Wine users install antivirus software? If so, would that be Linux antivirus software that can detect Windows malware, or Windows antivirus software running on Wine?

To repeat, my question is, to what extent do Wine and/or Mono pose security risks in the stated scenario?

How to split a partition into two without formatting?

Posted: 04 Sep 2021 08:18 AM PDT

There is only one partition in my SSD currently. That is where the Linux code lies. I am using ubuntu distro.

$ lsblk -l /dev/sda  NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT  sda    8:0    0 298.1G  0 disk  sda1   8:1    0 298.1G  0 part /  

Can I split this partition into two without formatting? If yes, how?

Organizing a CSV file with missing columns

Posted: 04 Sep 2021 10:29 AM PDT

I have a .csv file that was not filled in properly, which has missing column information.

The file looks something like this (whitespace is for clarity):

  C1,  C2,  C3,  C4,  R1C1,R1C2,R1C3,R1C4,  R2C1,R2C3,    ,    ,  R3C1,R3C4,    ,    ,  ...  

Where Cx is the column header and shares a string value with RyCx. For example,

Name     , Date       , Address           , Email              ,  Name Alex, Date Sept 3, Address 123 Madeup, Email Alex@mail.com,  Name Jenn, Date Sept 4, Email Jenn@mail.co,                    ,  

Where now Email Jenn@mail.co is incorrectly in the Address column.

There is any number of null spaces after the data. The data is laid out so that each row is in order [R1C1,R1C2,R1C3 ...] unless the data does not exist - in which case the columns shift left but their tag Cx does not change. This is because the program outputting the data did not create null cells.

There are no other patterns to this data.

I would like to reorganize this data into the appropriate column as:

  C1,  C2,  C3,  C4,  R1C1,R1C2,R1C3,R1C4,  R2C1,    ,R2C3,    ,  R3C1,    ,    ,R3C4,  ...  

or in the example as

Name     , Date       , Address           , Email              ,  Name Alex, Date Sept 3, Address 123 Madeup, Email Alex@mail.com,  Name Jenn, Date Sept 4,                   , Email Jenn@mail.co ,  

I cannot go back to where the information was gathered, it's older supercomputer simulation results.


Edit and Attempt

Thanks to FKEinternet I made some progress.

Here is the bash script I have tried with a mock file.

while IFS= read -r line; do # read input line by line  IFS=, read -ra fields <<<"$line" #separate fields by commas    for i in $(cat headers.txt) ; do  #loop through the column headers (now in separate file)      for j in {0..8} ; do    #loop through the colums        if [ "${fields[j]}" == "$i" ] ; then    #check if column mathches header          printf '%s,' "${fields[j]}"         #if column matches header, write that column        else          printf '%s,'                        #if column doesn't match header, write blank column          break                               #if I don't break, i get a ton of commas between the desired output and they aren't correctly spaced                                          #if i do break, i get a series of commas after the first entry, without any new entries        fi      done    done  printf '%s\n'        #print new line/row after search  done < datafile.txt > solution.csv  

I made a file containing the column headers:

a  b  c  d  e  f  g  h  

all on separate lines in headers.txt.

And I made another mock file called datafile.txt.

a,b,c,d,e,  a,c,e  b,d,f,g,h  c,d,g,h  d,h  b,f,g  a,d,f,g  

Running the bash script I get:

a,,,,,,,,,  a,,,,,,,,,  ,b,,,,,,,,  ,,c,,,,,,,  ,,,d,,,,,,  ,b,,,,,,,,  a,,,,,,,,,  

which are correctly positioned but only the first entry in each row. I can't figure out why it isn't working.

How to add a DER public key to the system keyring to load a signed kernel module on next boot

Posted: 04 Sep 2021 07:40 AM PDT

Bumping this question to 2021.

SecuredLight is a VM running RHEL 8.4 running on top of a R710 bare metal machine running RHEL 8.4, Royal.

Following Red Hat guide, section 4.5

I have a signed kernel module built from the script and spec file. The module has a digital signature and other parts such as Author. From userland I can insmod mod.ko and it loads.

With the kernel module signed and built in to an rpm, using modprobe, this is my output:

[root@securedlight user]#  modprobe -v thor  insmod /lib/modules/4.18.0-305.12.1.el8_4.x86_64/extra/kmod-thor/thor.ko  modprobe: ERROR: could not insert 'thor': Required key not available  [root@securedlight user]#  

Here's what I see on the command line within the VM:

[root@securedlight user]# efibootmgr -v  BootCurrent: 0003  Timeout: 0 seconds  BootOrder: 0003,0002,0000  Boot0000* UiApp FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)  Boot0002* UEFI Misc Device      PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x0)N.....YM....R,Y.  Boot0003* Red Hat Enterprise Linux      HD(1,GPT,b909a0bb-ff78-4a93-9700-1d6a24278560,0x800,0x12c000)/File(\EFI\redhat\shimx64.efi)  [root@securedlight user]#  

From my initial command line history I have done this with a requisite reboot:

5  scp user@192.168.52.196:/home/user/my_signing_key_pub.der .  6  scp user@192.168.52.196:/home/user/my_signing_key.priv .  7  keyctl list %:.builtin_trusted_keys  8  mokutil --import my_signing_key_pub.der  9  reboot  

10 keyctl list %:.builtin_trusted_keys Printing the platform and builtin_trusted_keys I see this

[root@securedlight user]# !10  keyctl list %:.builtin_trusted_keys  3 keys in keyring:   24589180: ---lswrv     0     0 asymmetric: Red Hat Enterprise Linux kernel signing key: 69a8e9938123f1b6a76551b1f90d9ccaa787f945  981517995: ---lswrv     0     0 asymmetric: Red Hat Enterprise Linux kpatch signing key: 4d38fd864ebe18c5f0b72e3852e2014c3a676fc8  999974919: ---lswrv     0     0 asymmetric: Red Hat Enterprise Linux Driver Update Program (key 3): bf57f3e87362bc7229d9f465321773dfd1f77a80  [root@securedlight user]# !12  keyctl list %:.platform  3 keys in keyring:  736775877: ---lswrv     0     0 asymmetric: Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e4f9ae17c55af53     434628: ---lswrv     0     0 asymmetric: Red Hat Secure Boot CA 5: cc6fa5e72868ba494e939bbd680b9144769a9f8f  773003300: ---lswrv     0     0 asymmetric: Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4  [root@securedlight user]#  

After running the mokutil --import and rebooting, there's no option to "enroll MOK" presented.

Here are results from efivars -l and mokutil --import on SecuredLight (VM)

[root@securedlight user]# efivar -l | head -n 5  8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder  8be4df61-93ca-11d2-aa0d-00e098032b8c-ErrOut  8be4df61-93ca-11d2-aa0d-00e098032b8c-ConIn  8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut  eb704011-1402-11d3-8e77-00a0c969723b-MTC  [root@securedlight user]#  

The MokAuth and MokNew efivars are present above the BootOrder var.

[root@securedlight user]# mokutil --import my_signing_key_pub.der  input password:  input password again:  [root@securedlight user]# efivar -l | head -n 5  605dab50-e046-4300-abb6-3dd810dd8b23-MokAuth  605dab50-e046-4300-abb6-3dd810dd8b23-MokNew  8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder  8be4df61-93ca-11d2-aa0d-00e098032b8c-ErrOut  8be4df61-93ca-11d2-aa0d-00e098032b8c-ConIn  [root@securedlight user]#  

It's a bit lost to share the cat /proc/keys yet the key isn't added.

[root@securedlight user]# mokutil --list-new  [key 1]  SHA1 Fingerprint:   2e:05:c9:d3:63:66:4d:82:38:34:13:89:5d:c5:64:04:bd:9d:2f:5f  Certificate:      Data:          Version: 3 (0x2)          Serial Number:              2d:32:04:5c:02:29:9e:b6:89:53:ab:2f:e4:68:2c:c9:74:b1:b7:9e          Signature Algorithm: sha256WithRSAEncryption          Issuer: O=Organization, CN=Organization signing key/emailAddress=E-mail address          Validity              Not Before: Aug 13 16:13:21 2021 GMT              Not After : Jul 20 16:13:21 2121 GMT          Subject: O=Organization, CN=Organization signing key/emailAddress=E-mail address          Subject Public Key Info:              Public Key Algorithm: rsaEncryption                  RSA Public-Key: (4096 bit)                  Modulus:                      00:c8:7d:51:9c:e4:c5:cb:af:36:24:f4:11:45:7c:  

Full stuff is here:

[root@securedlight user]# !51  mount -t iso9660 -o loop /tmp/dd-thor-1.0.0-1.1.iso /mnt/iso  mount: /mnt/iso: WARNING: device write-protected, mounted read-only.  [root@securedlight user]# cd /mnt/iso/  [root@securedlight iso]# ls  rhdd3  rpms  src  [root@securedlight iso]# cd rpms/  [root@securedlight rpms]# ls  x86_64  [root@securedlight rpms]# cd x86_64/  [root@securedlight x86_64]# ls  kmod-ARONETICS-thor-1.0.0-1.el8.x86_64.rpm    Installed:    kmod-ARONETICS-thor-1.0.0-1.el8.x86_64    Complete!  [root@securedlight x86_64]# updatedb  [root@securedlight x86_64]# locate thor.ko  /usr/lib/modules/4.18.0-305.12.1.el8_4.x86_64/extra/kmod-ARONETICS-thor/thor.ko  [root@securedlight x86_64]# modprobe thor  modprobe: ERROR: could not insert 'thor': Required key not available  [root@securedlight x86_64]# mokutil --import ~user/thor_pub.der  input password:  input password again:  [root@securedlight x86_64]# mokutil --list-new  [key 1]          Issuer: O=Aronetics, CN=Thors Signing ...           59:3c:bb:51:19:7e:43:a6  [root@securedlight x86_64]# reboot  Connection to 192.168.122.92 closed by remote host.  Connection to 192.168.122.92 closed.  [root@royal bin]# ssh user@192.168.122.92  user@192.168.122.92's password:  Warning: No xauth data; using fake authentication data for X11 forwarding.  Activate the web console with: systemctl enable --now cockpit.socket    Last login: Fri Sep  3 23:45:43 2021 from 192.168.122.1  PuTTY X11 proxy: Authorisation not recognised  [user@securedlight ~]$ sudo -s  [sudo] password for user:  [root@securedlight user]# modprobe thor  modprobe: ERROR: could not insert 'thor': Required key not available  [root@securedlight user]# mokutil --list-enrolled  [key 1]  Issuer: O=Red Hat, Inc., CN=Red Hat Secure Boot CA   ...  [root@securedlight user]# mokutil --list-new  [root@securedlight user]#  

On Royal (the bare metal machine), this in the /etc/libvirt/qemu.conf

#nvram = [  #   "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd",  #   "/usr/share/OVMF/OVMF_CODE.secboot.fd:/usr/share/OVMF/OVMF_VARS.fd",  #   "/usr/share/AAVMF/AAVMF_CODE.fd:/usr/share/AAVMF/AAVMF_VARS.fd",  #   "/usr/share/AAVMF/AAVMF32_CODE.fd:/usr/share/AAVMF/AAVMF32_VARS.fd"  #]  

This is the output from the efibootmgr

EFI variables are not supported on this system.  [root@royal tmp]#  

I have enabled the OVMF entries and the VMs in the cockpit disappear. I have to disabled them, systemctl restart libvirtd possibly reboot to reinitialize the socket and the VMs return.

How do I successfully enroll a kernel module in to the keyring? I enter the password twice and reboot but there's no option to add a third password to make it permanent.

Does the BIOS boot of Royal impact the UEFI SecuredLight options or are options lack from the cockpit TianoCore UEFI?

On Royal within the cockpit,

Emulated machine pc-q35-rhel8.2.0  Firmware UEFI  

Distribution-agnostic package search and installation

Posted: 04 Sep 2021 08:48 AM PDT

I'm trying to figure out a distribution-agnostic way to install packages providing specific executables or files. I know that it is impossible to get this perfect, but I think I have something that is almost good enough and I was hoping that maybe someone has an idea on how to improve upon it.

Basically I've written a script that provides an abstraction layer around the most common package managers:

commandAvailable() { command -v $1 &> /dev/null; }    if commandAvailable dnf; then      updatePackageInfo() { dnf check-update; }      searchPath() { dnf provides $1 2> /dev/null | grep ' : ' | head -1 | cut -d'.' -f1 | rev | cut -d'-' -f 2- | rev; }      searchBin() { searchPath {/bin,/sbin,/usr/bin/,/usr/sbin}/$1; }      install() { dnf install -y $@; }  elif commandAvailable yum; then      updatePackageInfo() { yum check-update; }      searchPath() { yum provides $1 2> /dev/null | grep ' : ' | head -1 | cut -d'.' -f1 | rev | cut -d'-' -f 2- | rev; }      searchBin() { searchPath {/bin,/sbin,/usr/bin/,/usr/sbin}/$1; }      install() { yum install -y $@; }  elif commandAvailable apt-get; then      updatePackageInfo() { apt-get update && if ! commandAvailable apt-file; then install apt-file; fi && apt-file update; }      searchPath() { apt-file search $1 | head -1 | cut -d':' -f1; }      searchBin() { searchPath {/bin,/sbin,/usr/bin/,/usr/sbin}/$1; }      install() { apt-get install -y $@; }  elif commandAvailable pacman; then      updatePackageInfo() { pacman -Sy && pacman -Fy; }      searchPath() { pacman -F $1 | head -1 | rev | cut -d' ' -f2 | rev; }      searchBin() { pacman -F $1 | grep -B 1 -P "    (usr/bin|usr/sbin|bin|sbin)/$1" | head -1 | cut -d' ' -f1; }      install() { pacman -S --noconfirm $@; }  elif commandAvailable zypper; then      updatePackageInfo() { zypper refresh; }      searchPath() { zypper search -f $1 | grep " | package" | head -1 | tr -d ' ' | cut -d'|' -f2; }      searchBin() { searchPath {/bin,/sbin,/usr/bin/,/usr/sbin}/$1; }      install() { zypper --non-interactive install "$@"; }  elif commandAvailable emerge; then      updatePackageInfo() { emerge-webrsync -v && if ! commandAvailable e-file; then install app-portage/pfl; fi; }      searchPath() { e-file $1 | grep -P "(\[I\]| \* )" | sed 's/*//g' | sed 's/\[I\]//g' | tr -d ' '; }      searchBin() { searchPath /usr/bin/$1; searchPath /usr/sbin/$1; searchPath /bin/$1; searchPath /sbin/$1; }      install() { emerge $@; }  fi    searchBins() { for executable in "$@"; do searchBin $executable; done | tr "\n" " "; echo; }  searchPaths() { for path in "$@"; do searchPath $path; done | tr "\n" " "; echo; }  installPkgWithPath() { install $(searchPath "$1"); }  installPkgsWithPaths() { install $(searchPaths $@); }  installPkgWithExecutable() { install $(searchBin $1); }  installPkgsWithExecutables() { install $(searchBins $@); }  

The functions it creates can be used like this:

updatePackageInfo                                  # Equivalent to apt-get update    installPkgWithPath "curl/curl.h"                   # Installs the package containing the header file curl/curl.h    installPkgsWithPaths "curl/curl.h" "/usr/bin/wget" # Installs multiple packages by file paths    installPkgWithExecutable curl                      # Install the package that provides the `curl` executable    installPkgsWithExecutables curl wget make          # Install all packages required to get these 3 executables  

This basically works fine on Fedora, RHEL, Debian, Arch, Gentoo, OpenSuse (and many more I would think). But it does not work on Ubuntu for example because Ubuntu doesn't have the required apt-file package (unless you enable the Universe repository that provides it).
Another thing that doesn't work is installing things like vlc in Fedora. On Fedora you would usually enable the RPM Fusion repositories for that.
And I'm sure other distributions have similar situations.

What I have considered is maybe adding a --force flag that, when set, causes these repositories to be searched and added if needed. But I would hate to end up in a situation where I have to maintain lists of repositories. My hope is that most distributions somehow reference these semi-trusted repositories in a way that I don't have to maintain a list of repositories for every distribution.

Any ideas?

How Can I Disable the Global Shortcut CTRL + SHIFT + U in Linux Mint?

Posted: 04 Sep 2021 07:16 AM PDT

Backstory: some Linux distributions setup a keyboard shortcut to let you enter Unicode characters, and they use CTRL + SHIFT + U as that shortcut. As a programmer, I want to instead use that shortcut in my code editor, so I'd like to disable the system one ... but I can't seem to figure out what program is responsible for it.

Everything I've found (eg. in this question about re-enabling that shortcut: How to re-enable the Ctrl+Shift+U shortcut in Cinnamon Mint 17.3?) suggests that it's dependent on my IME (input method editor). But when I went to "Input Method" (in the system menu), it said I didn't have an IME selected.

I then tried switching to the Fcitx IME (since I would like to be able to type Japanese characters), but that didn't help. Also, I went through all of the Fcitx configuration, and couldn't find any mention of a CTRL + SHIFT + U shortcut in it.

My question is: how can I disable this global CTRL + SHIFT + U shortcut? Preferably with the Fcitx IME, but if I have to disable it I can.

Creating .deb with systemd service but without SysV init scripts

Posted: 04 Sep 2021 06:02 AM PDT

I'm trying to add a systemd service file to an existing Debian package. I followed https://wiki.debian.org/Teams/pkg-systemd/Packaging, so I created debian/packagename.service. Because my debhelper is version 9.x, I also:

  • added dh-systemd to Build-Depends in debian/control
  • added --with systemd to the dh command in debian/rules.

Now when I rebuild the package with debuild -i -us -uc -b, it fails with this output:

Now running lintian...  [...]  W: packagename: init.d-script-not-marked-as-conffile etc/init.d/packagename  E: packagename: init.d-script-not-included-in-package etc/init.d/packagename  

It seems like the build script expects an init.d script if there is a .service file. And indeed, the generated DEBIAN/postinst includes this section:

# Automatically added by dh_installinit  if [ -x "/etc/init.d/infinoted" ]; then          update-rc.d infinoted defaults >/dev/null          invoke-rc.d infinoted start || exit $?  fi  # End automatically added section  

Is this expected behavior? Should I always include SysV init scripts when I include a .service file? If not, what is the recommended way to prevent the generation of this section?

My system is Debian Jessie.

what(): locale::facet::_S_create_c_locale name not valid

Posted: 04 Sep 2021 09:00 AM PDT

I have a Kali Linux where I cannot install any packages. locale is not working and I cannot install it what can I do? I changed sources.list but it's of no help, I tried sudo dpkg-reconfigure locales it tells me:

Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16.  Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17.  dpkg: error: configuration error: /etc/dpkg/dpkg.cfg.d/multiarch:1: unknown option 'foreign-architecture'  /usr/sbin/dpkg-reconfigure: locales is not installed  

wget - how to reject string from downloading html pages

Posted: 04 Sep 2021 10:02 AM PDT

I am using the following wget command and it downloads the required files I need except for one thing...

wget -U "Mozilla/5.0" --wait=3 --load-cookies cookies.txt --timestamping --recursive --level=2 --convert-links --no-parent --page-requisites --adjust-extension --max-redirect=0 --exclude-directories=blog --reject "*per_page=18.html" --reject "*per_page=36.html" (url here)  

I want to download files like these:

a1546997.html  

But I don't want to download files like these:

a1546997.html?pwd=&per_page=36.html  

I cannot seem to figure out how to reject downloading the html pages containing the extra stuff at the end.

The main problem is that wget gets stuck retrying and times out on the second types of links because the don't go anywhere - and then wget client gets banned.

Any suggestions?

Centos 7 - Can't download RPM (Trying to connect with IPV6)

Posted: 04 Sep 2021 07:03 AM PDT

I am normally an Debian/Ubuntu guy, but I wanted to test the foreman on CentOS 7, but I am having some trouble with the rpm command. I have tried to disable IPV6 with

echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6  echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6  sysctl -p  

But nothing seems to work?

rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm  Retrieving http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm  curl: (7) Failed to connect to 2600:3c03::f03c:91ff:fedb:6b1d: Network is unreachable  error: skipping http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm - transfer failed  

How to convert grub config to use kernel device names instead of UUID

Posted: 04 Sep 2021 08:01 AM PDT

I've got a bunch of identical systems on which I want to clone the same openSUSE 12.3 installation.

I've set up clonezilla on PXE server.

After appling the disk-image of on another machine, it fails to boot.

This is because all the partitions are referred to be their UUIDs instead of the kernel-assigned name (sda1, sda2, etc).

How do I configure grub to be using the kernel names instead of the UUID so that the image can be truly ported to the other systems?

I have tried setting GRUB_DISABLE_LINUX_UUID=true in /etc/default/grub and then run grub2-mkconfig -o /boot/grub2/grub.cfg. I have also changed the entry in /etc/fstab.

After these changes, the system still boots fine on the source machine, but doesn't boot on all the others. Grub loads, but only shows the word "GRUB" and thats all. Nothing else happens.

My current grub.cfg is the following:

#  # DO NOT EDIT THIS FILE  #  # It is automatically generated by grub2-mkconfig using templates  # from /etc/grub.d and settings from /etc/default/grub  #    ### BEGIN /etc/grub.d/00_header ###  if [ -s $prefix/grubenv ]; then    load_env  fi  set default="${saved_entry}"    if [ x"${feature_menuentry_id}" = xy ]; then    menuentry_id_option="--id"  else    menuentry_id_option=""  fi    export menuentry_id_option    if [ "${prev_saved_entry}" ]; then    set saved_entry="${prev_saved_entry}"    save_env saved_entry    set prev_saved_entry=    save_env prev_saved_entry    set boot_once=true  fi    function savedefault {    if [ -z "${boot_once}" ]; then      saved_entry="${chosen}"      save_env saved_entry    fi  }    function load_video {    if [ x$feature_all_video_module = xy ]; then      insmod all_video    else      insmod efi_gop      insmod efi_uga      insmod ieee1275_fb      insmod vbe      insmod vga      insmod video_bochs      insmod video_cirrus    fi  }    if [ x$feature_default_font_path = xy ] ; then     font=unicode  else  insmod part_msdos  insmod ext2  set root='hd0,msdos5'  if [ x$feature_platform_search_hint = xy ]; then    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4  else    search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4  fi      font="/usr/share/grub2/unicode.pf2"  fi    if loadfont $font ; then    set gfxmode=auto    load_video    insmod gfxterm    set locale_dir=$prefix/locale    set lang=en_US    insmod gettext  fi  terminal_output gfxterm  insmod part_msdos  insmod ext2  set root='hd0,msdos5'  if [ x$feature_platform_search_hint = xy ]; then    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4  else    search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4  fi  insmod gfxmenu  loadfont ($root)/boot/grub2/themes/openSUSE/ascii.pf2  loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans10.pf2  loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans12.pf2  loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans-Bold14.pf2  insmod png  set theme=($root)/boot/grub2/themes/openSUSE/theme.txt  export theme  if [ x${boot_once} = xtrue ]; then    set timeout=0  elif sleep --interruptible 0 ; then    set timeout=5  fi  ### END /etc/grub.d/00_header ###    ### BEGIN /etc/grub.d/10_linux ###  menuentry 'openSUSE 12.3' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-5613d48c-eedb-4389-91bc-e49de73a1cc4' {      load_video      set gfxpayload=keep      insmod gzio      insmod part_msdos      insmod ext2      set root='hd0,msdos5'      if [ x$feature_platform_search_hint = xy ]; then        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4      else        search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4      fi      echo    'Loading Linux 3.7.10-1.4-default ...'      linux   /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5   splash=silent acpi=on barrier=off reboot=pci  init=linuxrc splash=silent quiet showopts      echo    'Loading initial ramdisk ...'      initrd  /boot/initrd-3.7.10-1.4-default  }  submenu 'Advanced options for openSUSE 12.3' $menuentry_id_option 'gnulinux-advanced-5613d48c-eedb-4389-91bc-e49de73a1cc4' {      menuentry 'openSUSE 12.3, with Linux 3.7.10-1.4-default' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.7.10-1.4-default-advanced-5613d48c-eedb-4389-91bc-e49de73a1cc4' {          load_video          set gfxpayload=keep          insmod gzio          insmod part_msdos          insmod ext2          set root='hd0,msdos5'          if [ x$feature_platform_search_hint = xy ]; then            search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4          else            search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4          fi          echo    'Loading Linux 3.7.10-1.4-default ...'          linux   /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5   splash=silent acpi=on barrier=off reboot=pci  init=linuxrc splash=silent quiet showopts          echo    'Loading initial ramdisk ...'          initrd  /boot/initrd-3.7.10-1.4-default      }      menuentry 'openSUSE 12.3, with Linux 3.7.10-1.4-default (recovery mode)' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.7.10-1.4-default-recovery-5613d48c-eedb-4389-91bc-e49de73a1cc4' {          load_video          set gfxpayload=keep          insmod gzio          insmod part_msdos          insmod ext2          set root='hd0,msdos5'          if [ x$feature_platform_search_hint = xy ]; then            search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4          else            search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4          fi          echo    'Loading Linux 3.7.10-1.4-default ...'          linux   /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5  showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe          echo    'Loading initial ramdisk ...'          initrd  /boot/initrd-3.7.10-1.4-default      }  }    ### END /etc/grub.d/10_linux ###    ### BEGIN /etc/grub.d/20_linux_xen ###  ### END /etc/grub.d/20_linux_xen ###    ### BEGIN /etc/grub.d/20_memtest86+ ###  ### END /etc/grub.d/20_memtest86+ ###    ### BEGIN /etc/grub.d/20_ppc_terminfo ###  ### END /etc/grub.d/20_ppc_terminfo ###    ### BEGIN /etc/grub.d/30_os-prober ###  menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-52EA4C7AEA4C5C7B' {      insmod part_msdos      insmod ntfs      set root='hd0,msdos1'      if [ x$feature_platform_search_hint = xy ]; then        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  52EA4C7AEA4C5C7B      else        search --no-floppy --fs-uuid --set=root 52EA4C7AEA4C5C7B      fi      chainloader +1  }  ### END /etc/grub.d/30_os-prober ###    ### BEGIN /etc/grub.d/40_custom ###  # This file provides an easy way to add custom menu entries.  Simply type the  # menu entries you want to add after this comment.  Be careful not to change  # the 'exec tail' line above.  ### END /etc/grub.d/40_custom ###    ### BEGIN /etc/grub.d/41_custom ###  if [ -f  ${config_directory}/custom.cfg ]; then    source ${config_directory}/custom.cfg  elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then    source $prefix/custom.cfg;  fi  ### END /etc/grub.d/41_custom ###    ### BEGIN /etc/grub.d/90_persistent ###  ### END /etc/grub.d/90_persistent ###  

No comments:

Post a Comment