A Samsung N150 Plus netbook that I plan to mainly use to mess around
with Windows, but also as a very portable computer for any smol
computing needs or as a backup.

As it will mainly run Windows, it shall be named after an industrial
disaster, like my other Windows systems. AZF is a factory in Toulouse
where 300 tons of ammonium nitrate exploded on September 21, 2001.

Specifications

-   Birth date: 2011-03-??
-   Bought second-hand for 30€ + 6.49€ shipping
-   Received on 2024-05-11
-   Model: NP-150-JP04FR
-   Serial: ZU1H93LB301294D
-   Intel Atom N455, 1.66 GHz
-   10.1" 1024×600 display
-   RAM:
    -   Originally 1GB PC3-8500
    -   Installed 2GB PC3-10600
-   Disk:
    -   Originally WDC WD2500BEVT-35A23T0, SATA 250GB 5400rpm
    -   Installed a GUDGA (AliExpress) M.2 2280 256GB SSD, with a
        M.2→SATA adapter
-   Intel Graphics Media Accelerator 3150
-   Intel 10/100 Ethernet
-   Broadcom BCM94313HMGB DHXB-81 802.11b/g/n + Bluetooth card
-   Samsung AA-PB2VC6B battery, li-ion, 11.1V 4400mAh
-   3 USB 2.0 ports
-   1 VGA port
-   1 Ethernet port
-   SD card reader

Places it went to

-   Grenoble
    -   My home
    -   A laundromat near my home
    -   Parc Berty Albrecht
        -   Journaled
    -   Kateb Yacine public library
        -   Posted on RSRSSS
    -   City center public library
        -   Drafted an email
        -   Updated my books list
    -   A bench on Cours Lafontaine
        -   Finished an email
    -   French Coffee Shop
        -   Drafted a blog post using Open Live Writer
-   Saint-Martin-d’Hères
    -   Grenoble-Alpes university
        -   A small concrete wall on Place Centrale
            -   Updated this list
            -   Started a blog post using Open Live Writer
        -   A bench in front of MUSE
            -   Continued the blog post and got interrupted by rain
        -   A fancy roofed picnic table in front of PhITEM A
            -   Finished the blog post
-   Seyssinet-Pariset
    -   Parc Lesdiguières
        -   Updated this list
        -   Drafted two blog posts using Open Live Writer

Setup

The drive is split into three partitions:

-   Windows XP, 110GB
-   Windows 7, 110GB
-   Alpine, 36GB

Windows XP

A Windows XP Pro SP3 install, in French. I first tried to transfer the
partition directly from LUBRIZOL, but I could never get the system to
work properly afterwards, so I started over from scratch.

Windows 7

A completely normal Windows 7 install disk has been used to install
Windows 7 Ultimate x64 in French with various updates already installed,
as well as .NET 4.6.1.

Alpine

This was set up using the Alpine Standard 3.20.3 ISO.

The main disk was already formatted. /dev/sda4 is intended to hold
Alpine, and /dev/sdc is a USB drive with a single /dev/sdc1 partition,
intended to hold the MBR and boot partition.

Initial fluff

1.  Run setup-alpine
2.  Use fr-oss as the keyboard variant
3.  Set azf-alpine as the hostname
4.  Configure wlan0 with DHCP
5.  Use busybox as the NTP client
6.  Create a lucidiot non-root user
7.  Do not install an SSH server
8.  Enable the community repo
9.  Auto-detect the fastest mirror
10. Hit ^C

LVM on LUKS

1.  Install the tools for the LVM on LUKS setup:
    apk add lvm2 cryptsetup parted e2fsprogs mkinitfs
2.  Format the LUKS partition: cryptsetup luksFormat /dev/sda4
3.  Mount it: cryptsetup luksOpen /dev/sda4 lvmcrypt
4.  Create the LVM physical volume: pvcreate /dev/mapper/lvmcrypt
5.  Create the LVM volume group: vgcreate vg0 /dev/mapper/lvmcrypt
6.  Add a swap logical volume large enough to support hibernation:
    lvcreate -L 3G vg0 -n swap
7.  Add a root logical volume: lvcreate -l 100%FREE vg0 -n root
8.  Format the swap logical volume: mkswap /dev/vg0/swap
9.  Format the root logical volume: mkfs.ext4 /dev/vg0/root
10. Format the boot partition on the USB drive: mkfs.ext4 /dev/sdc1
11. Mount the root logical volume: mount -t ext4 /dev/vg0/root /mnt/
12. Mount the boot partition:
    mkdir /mnt/boot && mount -t ext4 /dev/sdc1 /mnt/boot
13. Activate the swap partition: swapon /dev/vg0/swap

Install

1.  Install Alpine: setup-disk -m sys /mnt/
2.  Append /dev/vg0/swap\tswap\tswap\tdefaults\t0\t0 to /mnt/etc/fstab
3.  Check that cryptsetup, keymap and usb are in the features of
    /mnt/etc/mkinitfs/mkinitfs.conf
4.  Build the initial RAM disk:
    mkinitfs -c /mnt/etc/mkinitfs/mkinitfs.conf -b /mnt/ $(ls /mnt/lib/modules/)

MBR

1.  Install Syslinux: apk add syslinux
2.  Check that cryptroot=<LUKS UUID> cryptdm=lvmcrypt is set
    default_kernel_opts in /mnt/etc/update-extlinux.conf
    The UUID of the LUKS partition can be obtained with
    blkid -s UUID -o value /dev/sda4
3.  Check that cryptsetup,keymap,lvm are in the modules in
    /mnt/etc/update-extlinux.conf
4.  Build the MBR: chroot /mnt/; update-extlinux; exit
    Ignore the cannot find device for path /boot warning.
5.  Unmount the boot partition: umount /mnt/boot
6.  Write the MBR:
    dd bs=440 count=1 conv=notrunc if=/mnt/usr/share/syslinux/mbr.bin of=/dev/sdc
7.  Make the boot partition bootable: fdisk /dev/sdc; a; 1; w

Reboot cleanly

    cd
    umount /mnt/boot
    swapoff /dev/vg0/swap
    umount /mnt
    vgchange -a n
    cryptsetup luksClose lvmcrypt
    reboot

Configure and install software

    doas su

    # Add a lot of software
    setup-xorg-base \
        blueman \
        brightnessctl \
        curl \
        doas-sudo-shim \
        docs \
        fastfetch \
        figlet \
        firefox \
        fish \
        font-dejavu \
        font-liberation \
        font-noto-emoji \
        fuse-openrc \
        git \
        gvfs-fuse \
        gvfs-mtp \
        gvfs-smb \
        htop \
        kdeconnect \
        libreoffice \
        linux-firmware-intel \
        lxqt-desktop \
        ntfs-3g \
        openssh \
        pass \
        pavucontrol-qt \
        pciutils \
        pipewire-alsa \
        pipewire-pulse \
        redshift \
        sddm \
        setxkbmap \
        smartmontools \
        syncthing \
        thunderbird \
        tlp \
        tmux \
        tree \
        udisks2 \
        vim \
        vlc-qt \
        wireplumber \
        xf86-input-evdev \
        xf86-input-synaptics \
        xf86-video-intel \
        i3lock

    # Keyboard settings
    cat <<EOF
    Section "InputClass"
            Identifier      "Keyboard Default"
            MatchIsKeyboard "yes"
            Option          "XkbLayout" "fr"
            Option          "XkbVariant" "oss"
            Option          "XkbOptions" "compose:menu"
    EndSection
    EOF >/usr/share/X11/xorg.conf.d/20-keyboard.conf

    # Erase /tmp automatically
    sed -i /wipe_tmp=/s/NO/YES/ /etc/conf.d/bootmisc

    # Use local time on the RTC to please Windows
    sed -i /clock/s/UTC/local/ /etc/conf.d/hwclock

    chsh lucidiot -s $(which fish)

    # Boot faster by not waiting for networking
    rc-update del networking boot
    rc-update del wpa_supplicant boot
    rc-update add networking default
    rc-update add wpa_supplicant default

    # Add other services
    rc-update add hwclock default
    rc-update add dbus default
    rc-update add fuse default
    rc-update add cpufreqd default
    rc-update add tlp default
    rc-update add bluetooth default
    rc-update add swap default
    rc-update add syncthing default
    rc-update add sddm default

    reboot

After booting LXQt once, change the settings:

    # Use i3lock as screen locker
    echo '[Screensaver]
    lock_command=i3lock' >> /home/lucidiot/.config/lxqt/lxqt.conf
    sed -i 's/xdg-screensaver.*$/i3lock/' /home/lucidiot/.config/lxqt/globalkeyshortcuts.conf

Troubleshooting

Screen backlight control

To get the backlight keys (Fn + Up and Fn + Down) to work under Windows:

1.  Install Samsung Easy Display Manager. This works on both Windows XP
    32-bit and Windows 7 64-bit.

2.  If you have the Intel GMA 3150 drivers installed, backlight control
    still may not work. To solve this, apply the following registry edit
    (source):

        Windows Registry Editor Version 5.00

        [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000] 
        "FeatureTestControl"=dword:00000084

    Revert this change by resetting the value to 0x184 instead of 0x84.

Under Linux, brightnessctl can handle this perfectly fine. LXQt’s
default brightness management does not seem to like though, so you will
need to update the shortcut keys for brightness management to use
brightnessctl.