I am running a custom build Debian OS.

I have tried various methods to rename the Grub standard wlp3s0 to the more usable wlan0 in a live system in unpacked squashfs, including the widely suggested udev rules. All fail after .iso build and boot.

Unpack and chroot entry is as follows, if it helps:

mount -t proc none /proc/
mount -t sysfs none /sys/
export HOME=/root

I also want to avoid the specificity of having to identify the iface in any form other than standard name assigned to any initial wireless device, so a renamed label will be assigned to initial wireless, whatever it is.

How can an interface be renamed in unpacked squashfs? Renaming the iface in a running live system is easy, so is there something I can copy across to the system that remains generic enough to work on any system where a wireless interface would be called wlp3s0 otherwise?

  • Is the squashfs image "unpacked" or "mounted"? If mounted, then it is read only, and you can't... Depending on the filesystem size and available RAM, you could mount a tmpfs filesystem, copy things into it, and pivotroot... but you'll probably need to do that before init...
    – Attie
    Jul 25, 2020 at 18:30

3 Answers 3


The Linux Live Kit might be a solution. Create your customized Linux distribution, perhaps inside a VM, then convert it to a live USB.

a set of shell scripts which allows you to create your own Live Linux from an already installed Linux distribution. The Live system you create will be bootable from CD-ROM or USB Flash Drive.

It requires that that the aufs and squashfs kernel modules are supported by your kernel. In some distributions both are included automatically. You may need to install the aufs-dkms package on some Linux distributions.

You would also do best to slim down your Linux installation by as much as possible.

More information is to be found on the Linux Live Kit website.


In a Debian OS, the likely working solution will be to edit the network interface configuration rules in /etc/init/network-interface.conf. This file contains entries like the following for loopback:

if [ "$INTERFACE" = lo ]; then
    # bring this up even if /etc/network/interfaces is broken
    ifconfig lo up || true
    initctl emit -n net-device-up \
        IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true

The right scripted entry here for any wireless otherwise named wlp3s0 should rename wlp3s0 to wlan0 as the OS is booting. So the right entry is needed.

I can try the following, with up an option:

if [ "$INTERFACE" = wlp3s0 ]; then
ifconfig wlp3s0 down \
ip link set dev wlp3s0 name wlan0 \
#ifconfig wlan0 up
  • Sadly, looks like this fails. All that is required is a way to bring an iface down at boot, and rename it. Passing the ip link commands in config-hooks seems to break interface operation also. There must be some way of doing this. I know the grub2 naming schemas are unpopular.
    – Kebam
    Aug 1, 2020 at 13:56

I hadn't read the manpage for udev, which I had ignored after the examples I'd seen on the web. It directs readers to man systemd.link for interface configuration. I had never seen this mentioned anywhere online, and will test it in my next rebuild.

So, apparently a custom naming rule is as simple as adding a numbered rule file .link to /etc/systemd/network, with the proviso that rules are evaluated across the three (system in /lib/systemd/network, volatile in /run and admin /etc/systemd/network) locations in order, and that kernel naming policy should be absent to allow admin rule, it seems.



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .